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.