Print Page | Close Window

LoadFromFile fails

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2034
Printed Date: 03 Feb 26 at 5:40PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: LoadFromFile fails
Posted By: Betanin
Subject: LoadFromFile fails
Date Posted: 08 Nov 11 at 12:46PM
I'm using Quick PDF to render pdf files, it was working correctly up to last week, when the function LoadFromFile stopped to work without an apparent reason. The result code is 0, when I evoke the method LastErrorCode the code is 401. I thought it was lincense, but i bought it yesterday. Someone can help me? Thanks



Replies:
Posted By: Dan
Date Posted: 08 Nov 11 at 2:39PM
Which language are you programming in?

To troubleshoot this I'd start with checking the return value from the UnlockKey method. If the unlock method fails code execution will continue but none of the functions will be available. I'm using the dll version of QPL in VB. Here is the code I use:

Dim DLLPath As String = "D:/Bin/QuickPDFDLL.dll"     
Dim key As String = "your key here"
Dim pdf As PDFLibrary = New PDFLibrary(DLLPath)
If Not pdf.LibraryLoaded() Then
     Throw New Exception("QuickPDF Library Not Loaded")
End If
If pdf.UnlockKey(key) = 0 Then
     Throw New Exception("Did not unlock QuickPDF")
End If

Dan


Posted By: machalla
Date Posted: 08 Nov 11 at 3:00PM
A wild guess but perhaps you have upgraded from an older version of quickpdf to the latest V8.

LoadFromFile has changed its syntax in Version 8.  You need to specify a password field for the file even if its blank.  Its possible this might be the cause of the code not working if you have updated to the latest Version 8 qpdf from previous versions.

http://www.quickpdflibrary.com/help/quickpdf/LoadFromFile.php


Posted By: Betanin
Date Posted: 08 Nov 11 at 3:33PM
Hy Dan,

I'm programming in Delphi 2009, and i'm not using DLL, but the DCU's package. The return value of UnlockKey method is 1, it works correctly, my key is valid. Have you another tip? Thanks


Posted By: Betanin
Date Posted: 08 Nov 11 at 3:37PM
Hi machalla,

Unfortunatelly it can't be the problem, because I was in version 8.11 and now in 8.12. Thanks


Posted By: Dan
Date Posted: 08 Nov 11 at 4:28PM
The last error code indicates it http://www.quickpdflibrary.com/help/quickpdf/LastErrorCode.php - could not open the file. .

Perhaps there's something corrupted or 'special' about the pdf you are trying to load? I assume you're attempting to load the same file as you were when it was working? If so, it could be something that's no longer supported in 8.12 or a bug.

Good luck,
Dan


Posted By: Betanin
Date Posted: 08 Nov 11 at 4:42PM
Hi Dan,

I had checked the error code and all of your suppositions. The trouble started in version 8.11, where I made the component works correctly and another day with the same code, the same pdf file, the same component version and key stopped works. I thought it was my license wich was trial, but now that I bought the licence, the problem persist. Thanks


Posted By: AndrewC
Date Posted: 09 Nov 11 at 1:13PM
As mentioned in the official support case, this PDF is malformed and Acrobat fixes the file when it loads it.  The fixed file now loads and renders correctly in QPL 8.11.

Andrew



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk