Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - LoadFromFile return 0
  FAQ FAQ  Forum Search   Register Register  Login Login

LoadFromFile return 0

 Post Reply Post Reply
Author
Message
gcaramia View Drop Down
Beginner
Beginner


Joined: 04 Oct 10
Location: Italy
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote gcaramia Quote  Post ReplyReply Direct Link To This Post Topic: LoadFromFile return 0
    Posted: 07 Oct 10 at 2:14PM
Please,
i have no idea why LoadFromFile, sometimes returns 0.
These .pdf files are generated by a Brother Scanner (may be this is the matter). They are well opened by Acrobat Reader and other readers.

Here my sample code:

procedure TForm1.Button1Click(Sender: TObject);
var
PDFLibrary: TQuickPDF0721;
UnlockResult: Integer;
risultato : integer;

begin
  WebBrowser1.Navigate('c:\I300.pdf'); <<<<< I300.pdf is shown >>>>>>>>>>>
  PDFLibrary := TQuickPDF0721.Create;
  try
    UnlockResult := PDFLibrary.UnlockKey('mykey');
    if UnlockResult = 1 then
      begin
        risultato := PDFLibrary.LoadFromFile('c:\I300.pdf');
        showmessage(inttostr(risultato)); <<<<<<<<< "0" is shown >>>>>>>>>>>>>>>>
        PDFLibrary.SaveToFile('C:\test.pdf');<<<<<<<<< empty document >>>>>>>>>>>
      end
    else
      begin
        ShowMessage('Invalid license key');
      end;
  finally
     PDFLibrary.Free;
  end;
end;

Here the I300.pdf:
www.winsvetta.com/QP/I300.zip

I can't figure out how can solve. Please, HELP.

Thx
Giovanni


Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 10 at 1:49PM
Hi Giovanni,

The I300.pdf file is a malformed PDF. I opened the PDF in Acrobat and ran a "Preflight > Report PDF syntax issues" report. The report confirmed that the document is malformed with this message:

"The PDF document is damaged. While Acrobat always tries to repair the document when it is opened, there is no guarantee that the document can be processed reliably."

Adobe Reader, Acrobat and some other PDF viewers try to open and display PDF files even if they are malformed, but they make no guarantees that you'll actually be able to do anything else with a malformed PDF.

Quick PDF Library does not attempt to repair malformed PDF files and so it cannot open this particular document. If all of the PDF files that are generated by your Brother Scanner then I would highly recommend letting them know so that they can fix this issue at the source.

Cheers,
- Rowan.
Back to Top
gcaramia View Drop Down
Beginner
Beginner


Joined: 04 Oct 10
Location: Italy
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote gcaramia Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 10 at 2:17PM
Thx Rowan
I was almost sure about Brother responsability. You confirm my hypothesis but, more, your declaration helps me to prove to customer that the malfunction is not the fault of my software.

thx again
Giovanni
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store