We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF Form to Image problem

Hi,
I have a PDF form which of I need a preview. When I use this code (from examples):
’ The path to the documents directory.
Dim dataDir As String = Path.GetFullPath("…/…/…/Data/")
'create PdfConverter object
Dim objConverter As New PdfConverter()

'bind input pdf file
objConverter.BindPdf(dataDir & “input.pdf”)

'initialize the converting process
objConverter.DoConvert()
objConverter.ShowHiddenAreas = True

'check if pages exist and then convert to image one by one
Do While objConverter.HasNextImage()
objConverter.GetNextImage(dataDir & DateTime.Now.Ticks.ToString() & “.jpg”, System.Drawing.Imaging.ImageFormat.Jpeg)
Loop

'close the PdfConverter object
objConverter.Close()

I get Object refernce not set to an instance of an object exception on BindPdf function.
When I use this code:
Public Class RenderPdf
Implements IRenderer

Private Pdf As Aspose.Pdf.Document

Public Sub New(FilePath As String)
Pdf = New Aspose.Pdf.Document(FilePath)
End Sub

<MethodImpl(MethodImplOptions.Synchronized)>
Public Function RenderFull(Page As Integer) As Byte() Implements IRenderer.RenderFull
Using imageStream As New MemoryStream()
Dim resolution As New Aspose.Pdf.Devices.Resolution(300)
If Pdf.Pages(Page).Rect.Width >= 2000 Or Pdf.Pages(Page).Rect.Height >= 2000 Then resolution = New Aspose.Pdf.Devices.Resolution(60)
Dim jpegDevice As New Aspose.Pdf.Devices.JpegDevice(resolution)
jpegDevice.Process(Pdf.Pages(Page), imageStream)
RenderFull = imageStream.ToArray()
imageStream.Close()
End Using
End Function

Public Sub Close() Implements IRenderer.Close
Pdf.Dispose()
End Sub

Public Function PageCount() As Integer Implements IRenderer.PageCount
Return Pdf.Pages.Count
End Function
End Class

I get one image saying Please wait… and someother text.
Pdf and image in attachments.

Thanks Pilscom.

Hi there,

Thanks for your inquiry. I have tested your scenario with shared document using Aspose.Pdf for .NET 10.5.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-38935 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

Please feel free to contact us for any further assistance.

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
Calibri;color:#333333;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>Best Regards

Hi,
Are there any news regarding this issue?

Thanks pilscom.

Hi Pilscom,


Thanks for your inquiry. I am afraid your above reported issue(PDFNEWNET38935) is still not resolved as product team is busy in resolving other issues in the queue, reported earlier. However I have raised the priority of your issue and requested our team to share an ETA at their earliest. We will notify you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,