Free Support Forum - aspose.com

"Wrong image extracting" error and possible memory leak

We purchased Aspose.PDF.Kit to extract images from PDF files, and we are using the sample code from the web site to extract images. We get an error returned from the line of code 'extractor.ExtractImage();' on several PDF files. The error is "Wrong image extracting, please check your pdf." I searched the forum for that error and found a reference saying it occurs when Aspose.PDF.Kit is used on a computer running 64-bit Windows. The reference was written in April 2008, and said that it was hoped that the problem would be fixed within two months. I'm getting the error from Aspose.PDF.Kit 3.2, which appears to be the latest version available. Does the product still not work on 64-bit Windows?

The second problem I encountered, which may be related, is that my program's memory usage kept getting larger and larger. The program runs in batch mode and processes several hundred PDF files at a time. My program finally failed when it got to about 1.5 gigabytes. Its memory usage is usually about 30 megabytes. I'll test my program on 32-bit Windows and see if I have the same problem if I'm not getting that error message. I may have to determine somehow in code if I'm running on 64-bit Windows and avoid calling ExtractImage if I am, so I don't have the memory problem.

Thanks.

Hi,

Thank you for considering Aspose and sorry for the inconvenience you have experienced.

Because of technical reason 64-bit Windows is still not supported. Now we are busy working on it and the new ETA is late this year.

Can you please provide your code and some example PDF files so we can check this problem?

Here's a sample PDF file and some code. Create a new vb.net app and replace the code in Form1 with this code:

Imports Aspose.Pdf.Kit

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim extractor As PdfExtractor = New PdfExtractor()

Cursor.Current = Cursors.WaitCursor

extractor.BindPdf("c:\Test\3280_0_PIIA DSTEWART 082902.pdf")

extractor.StartPage = 1

extractor.EndPage = 10

extractor.ExtractImage()

Dim imageCount As Integer = 1

While extractor.HasNextImage()

extractor.GetNextImage("c:\test\" & imageCount & ".jpg")

imageCount = imageCount + 1

End While

Cursor.Current = Cursors.Default

End Sub

End Class

The first issue I'm having is that the memory usage of this program goes really high, like 400 meg or more. As I process more and more PDF files, the memory usage keeps going higher and higher until my application crashes. I'm having the problem on 32-bit Windows, and also on 64-bit Windows when I use VB6 instead of VB.Net. If I run this sample application on 64-bit Windows, it immediately returns an error, and the memory usage doesn't increase, as I would expect.

The second problem is that the extracted image jpg files look strange. I assume this 10-page PDF file must be composed of ten scanned images, and I would have expected to see jpg representations of those images, but I'm getting something very different.

Hi,

Yes, it’s quite strange on the resultant image. For the issue, further study is required, and we have logged it as PdfKitNet-6425 in our issue tracking system. We will try to resolve the issue before we could provide a 64 bit supported version for this feature.

As a workaround, please use the methods of Converting To Image instead of Extracing images.

Thanks,

The issues you have found earlier (filed as 6425) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.