Free Support Forum - aspose.com

Aspose.pdf 7.7 PDF to image conversion

I am trialing your Aspose.pdf product.


I want to be able to convert PDFs to images. When it reaches {imagedevice}.Process method, it takes a few seconds to process a single page PDF. Cete DynamicPDF Rasterizer is much faster.

I need to be able to control the DPI of the resulting image.

Is there anyway to speed up the “process” method? I have tried PNG and JPG. I have attached 2 pdfs I am trying to convert.

I don’t know what the size of the PDFs will be or how many pages.

Here is my code:

Dim png As PngDevice = New PngDevice(New Resolution(96))
Dim jpg As JpegDevice = New JpegDevice(New Resolution(96), 50)
Dim hasMultiplePages As Boolean = False
Dim arrFiles() As String = {}
Using pdfDocument = New Document(strPDFFile)
Dim pageCounter As Integer = 0
If pdfDocument.Pages.Count = 1 Then
Using imageStream As New FileStream(strImageFile, FileMode.Create)
jpg.Process(pdfDocument.Pages(1), imageStream)
imageStream.Close()
End Using
Else
hasMultiplePages = True
ReDim arrFiles(pdfDocument.Pages.Count - 1)
For Each page As Page In pdfDocument.Pages
pageCounter += 1

arrFiles(pageCounter) = Path.GetDirectoryName(strImageFile) & “” & System.Guid.NewGuid.ToString() & “-” & pageCounter & “.jpg”
jpg.Process(page, arrFiles(pageCounter))
Next
End If

End Using

– Then I take the array and stitch the images together.

Hi Peter,


Thanks for your interest in our products.

I have tested the scenario where I have tried converting 41979.pdf file to JPEG format using JpegDevice and as per my observations, the process took 27 seconds to complete the job. For the sake of correction, I have logged this issue as PDFNEWNET-35079 in
our issue tracking system. We will further look into the details of this problem
and will keep you updated on the status of correction. Please be patient and
spare us little time.

Besides this, when I have tried converting SigCapBeyondPage1.pdf file to JPEG format using Aspose.Pdf for .NET 7.8.0, the conversion process is completed in 1 second. Can you please try using the latest release version and share your findings.

We are sorry for this inconvenience.