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 Hanging
  FAQ FAQ  Forum Search   Register Register  Login Login

LoadFromFile Hanging

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


Joined: 15 Aug 15
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mcourt Quote  Post ReplyReply Direct Link To This Post Topic: LoadFromFile Hanging
    Posted: 15 Aug 15 at 11:34AM
Delphi.

Basically, this code has been running fine, but our application hung when it came across a corrupt pdf, rather than get trapped and handled by the except block it just hangs.

We know it is a bad PDF file because when we open it in Acrobat viewer we get this message: "There was an error opening this document. The file is damaged and could not be repaired."

So Adobe acrobat can trap and handle it, why will the current code not trap it:

//Note QP was created before and tmpfilepath has been set......as we mentioned it works fine for a good pdf file, so why do we not get the BADFile message

try
  QP.LoadFromFile(tmpFilePath);   //tmpFilepath is valid and points to the pdf
  showmessage('OK');
except
  showmessage('BAD File?');
end;


This is a link to the bad pdf.

It is vital to be able to handle bad pdf's to allow applications to handle gracefully and keep on processing....especially in batch systems.

We also tried variations of loadfromfile like
if QP.LoadFromFile(tmpFilePath) = 1
if QP.LoadFromFile(tmpFilePath) = 0

But still hangs.

Kind Regards
Mark

Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 15 at 9:22PM
Hi.
I get:
! __QPDF_ErrorNotiffy:
>     $iResultError = 401
>     $sLastErrorDescription = Could not open input file

btw.
You must set password, as it is a required parameter
so you have to use:
if QP.LoadFromFile(tmpFilePath, "") = 1 
if QP.LoadFromFile(tmpFilePath, "") = 0
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
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