Print Page | Close Window

Output PDF file handle not getting released

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=1217
Printed Date: 01 Feb 26 at 8:21PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Output PDF file handle not getting released
Posted By: bob123
Subject: Output PDF file handle not getting released
Date Posted: 14 Sep 09 at 5:48PM
 
Am using the QuickPDF library to generate thumbnail in VB.NET/VS2008/.NET2.0. Code below.
 
After thumbnail is created when user tries to view the actual pdf file ... many a times am getting the message from Adobe PDF Reader "There was an error opening this document. This file is already open or in use by another application.". Sounds like the QuickPDF library is not releasing the file-handle.
 
Question: Is their anyway to dispose of the QuickPDF object guaranteed .. this way the adobe reader will get a clean read. Thanks@
 

' Create Image using QuickPDF
Dim QP As QuickPDFAX0715.PDFLibrary
Dim Result As Integer
Dim lngFileHandle As Long
Dim pageRef As Long
Dim imageConversionResult As Integer
QP = New QuickPDFAX0715.PDFLibrary
Result = QP.UnlockKey("license-key")
lngFileHandle = QP.DAOpenFile("C:\my.pdf", "")
pageRef = QP.DAFindPage(lngFileHandle, 1)
imageConversionResult = QP.DARenderPageToFile(lngFileHandle, pageRef, 5, 75, "C:\my.png")
QP = Nothing
 



Replies:
Posted By: Michel_K17
Date Posted: 15 Sep 09 at 2:47AM
Hi,

   Not sure it will fix the problem, but this is the way I code my application:

   - DAOpenFile
   - Do stuff
   - DACloseFile

   Not surprisingly (from the instructions), DACLoseFile "Closes a file that was originally opened using the DAOpenFile function" and I suspect will release the filehandle (since I am not having the problem you are describing).

   Cheers!



-------------
Michel


Posted By: bob123
Date Posted: 15 Sep 09 at 2:15PM
 
That was it! ... QuickPDF library is good .. just wish they had more samples


Posted By: deabrew
Date Posted: 15 Sep 09 at 2:34PM
Thanks, agreed .... they're on their way. 



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