EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Error Bad Document Trailer

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#5795
Posted: 04/09/2008 07:50:15
by DANIEL ALVAREZ (Standard support level)
Joined: 04/09/2008
Posts: 2

Hi

We have an error when we try find out if a pdf document is signed.

This is the code:
Code
       TempPath = Path.GetTempFileName()
        System.IO.File.Copy(ruta, TempPath, True)
        ' opening the temporary file
        DocumentChanged = False
        F = New FileStream(TempPath, FileMode.Open, FileAccess.ReadWrite)
        Document.Open(F)

        valido = Document.Signed

        Document.Close(False)
        F.Close()

The error happens in Document.Open(F), the error says "Bad document trailer".

This same code works with others files, the error only occurs with a specific pdf file, this pdf file opens in Adobe Reader without problems.
#5797
Posted: 04/09/2008 08:01:11
by Gustavo Marçaro (Basic support level)
Joined: 03/20/2008
Posts: 14

F := TFileStream.Create(C:\ + 'ARQ.PDF', fmOpenReadWrite or fmShareDenyWrite);
Document.Open(F);
if Document.Signed then begin
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
Success := true;
end;
Document.Close(Success);
#5800
Posted: 04/09/2008 08:07:49
by Eugene Mayevski (EldoS Corp.)

Quote
DANIEL ALVAREZ wrote:
This same code works with others files, the error only occurs with a specific pdf file, this pdf file opens in Adobe Reader without problems.


Moved to HelpDesk


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 2277 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!