Problem making Thumbnail of PDF
-
- Posts: 14
- Joined: Fri Jan 20, 2012 8:18 am
Problem making Thumbnail of PDF
Hi,
I have a PDF that I am having problems with. It opens find in the Image Viewer, but when I try run the following command I get an error:
ImageID = ImageViewer.GetPageThumbnail(826, 1169, 3, Color.White)
The error is
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Looks like it has a problem where there are loads of pictures on the page.
Can you let me know how I can get around this, because it crashes the whole app.
Here is the link to the PDF:
http://www.linhorn.co.za/Downloads/ProblemPDF.pdf
Regards
Robert
I have a PDF that I am having problems with. It opens find in the Image Viewer, but when I try run the following command I get an error:
ImageID = ImageViewer.GetPageThumbnail(826, 1169, 3, Color.White)
The error is
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Looks like it has a problem where there are loads of pictures on the page.
Can you let me know how I can get around this, because it crashes the whole app.
Here is the link to the PDF:
http://www.linhorn.co.za/Downloads/ProblemPDF.pdf
Regards
Robert
Re: Problem making Thumbnail of PDF
Hello When I click on your link I have an error:
Kind regards,
Loïc
You can attach the document to this thread by zipping it.404 Not Found
Apologies, but the page you requested could not be found. Perhaps searching will help.
Kind regards,
Loïc
-
- Posts: 14
- Joined: Fri Jan 20, 2012 8:18 am
Re: Problem making Thumbnail of PDF
OK. Attached is the zip of the file.
- Attachments
-
- ProblemPDF.zip
- (824.74 KiB) Downloaded 392 times
Re: Problem making Thumbnail of PDF
Hello,
I've ran your line of code without any problem by using the latest version.
So if the problem persists please ensure to have the latest available version and provide us more information to reproduce the problem.
Kind regards,
Loïc
I've ran your line of code without any problem by using the latest version.
So if the problem persists please ensure to have the latest available version and provide us more information to reproduce the problem.
Kind regards,
Loïc
-
- Posts: 14
- Joined: Fri Jan 20, 2012 8:18 am
Re: Problem making Thumbnail of PDF
Hi Loic,
OK. I found the problem. The problem is with .NET Framework 4. I took your VB Document Viewer sample application and added the following code:
This is exactly the code I use in my application. This works in your application, but not in mine. I then changed the compile option of the project to Microsoft.NET Version 4, and it brings up the error.
I did download the latest version of GDPicture, and it is doing this in the latest version.
Regards
Robert
OK. I found the problem. The problem is with .NET Framework 4. I took your VB Document Viewer sample application and added the following code:
Code: Select all
Dim b As Integer
Dim NewImageID As Integer
Dim ImageViewerPages As Integer
ImageViewer.DisplayFromFile("C:\Temp\PDF.PDF")
ImageViewer.DocumentPosition = GdPicture.ViewerDocumentPosition.DocumentPositionMiddleCenter
ImageViewer.ZoomMode = GdPicture.ViewerZoomMode.ZoomModeWidthViewer
Application.DoEvents()
ImageViewerPages = ImageViewer.PageCount
For b = 1 To ImageViewer.PageCount
'Create an image of the file
Dim oGdPictureImaging As New GdPicture.GdPictureImaging
Try
NewImageID = ImageViewer.GetPageThumbnail(826, 1169, b, Color.White)
Catch ex As Exception
NewImageID = 0
End Try
If NewImageID <> 0 Then
If Not oGdPictureImaging.IsBlank(NewImageID, 99.9) Then
End If
oGdPictureImaging.SaveAsPNG(NewImageID, "C:Temp\" & b & ".png")
oGdPictureImaging.ReleaseGdPictureImage(NewImageID)
Else
NewImageID = 0
End If
Next
I did download the latest version of GDPicture, and it is doing this in the latest version.
Regards
Robert
Re: Problem making Thumbnail of PDF
Hello,
This is working fine for me with any Framework.
Could you attach the project of the demo application ? Please don't forget to remove the license key.
Kind regards,
Loïc
This is working fine for me with any Framework.
Could you attach the project of the demo application ? Please don't forget to remove the license key.
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 1 guest