Print Page | Close Window

DLL Error while trying to generate an image

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=1995
Printed Date: 09 Jul 25 at 1:59PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DLL Error while trying to generate an image
Posted By: wjbons
Subject: DLL Error while trying to generate an image
Date Posted: 12 Oct 11 at 9:10AM
Sometimes I get an error while trying to generate a image from a loaded pdf document
 
ERROR:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 
Error occures at the line which is bold.
I use the 8.11 version (.Net)
 
Anybody an idea what could be wrong with this??
 
    Public Function RenderPageToString(ByVal DPI As Integer, ByVal Page As Integer, _
        ByVal Options As Integer) As Byte()
      If (dll Is Nothing) Then
        Return New Byte(-1) {}
      Else
        Dim data As IntPtr = dll.QuickPDFRenderPageToString(instanceID, DPI, Page, Options)
        Dim size As Integer = dll.QuickPDFAnsiStringResultLength(instanceID)
        Dim result As Byte() = New Byte(size - 1) {}
        Marshal.Copy(data, result, 0, size)
        Return result
      End If
    End Function



Replies:
Posted By: AndrewC
Date Posted: 13 Oct 11 at 2:27PM
This is most likely related to the particular PDF file you are trying to render.  Can you please open a support case via  http://www.quickpdflibrary.com/support/support-query.php - http://www.quickpdflibrary.com/support/support-query.php  and send us the PDF file in question.


Posted By: wjbons
Date Posted: 13 Oct 11 at 3:40PM
It occured twice until now in 3 days while working (developing and testing).
It is possible that there would be 2 asynchrone processes reading a pdf file.
 
Is there a possibility that when loading the dll twice in different threads that they can cause problems?
For example when they both are reading the pdf doc at the same time (async)....


Posted By: Ingo
Date Posted: 13 Oct 11 at 7:19PM
Hi!

I've read here in the forum more than once that QuickPDF isn't threadsafe.
Don't know if this is still valid for the current version?
I think it's not possible for two instances of QuickPDF calling/opening the same pdf-document.

Cheers, Ingo



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