Convert .pdf to .tiff Fails with Some .pdfs

Hi,


I am following this code example:

http://www.aspose.com/docs/display/pdfnet/Convert+Particular+PDF+page+to+TIFF+Image

The only differences in my code is that I’m outputting the converted .tiff to a memory stream and I’m only converting one page in the pdf at a time. Here is the only modification my code requires:

Dim tiffMS As System.IO.MemoryStream = New System.IO.MemoryStream
tiffDevice.Process(pdfDoc, pageNo, pageNo, tiffMS)

This works 90% of the time. However, with some particular .pdf files, the code fails with the attached error. Any ideas for a fix or a work-around. I did upgrade to the latest version of aspose.pdf before submitting this case. Its 7.7.0.0.

Also, an example of a .pdf that is failing is attached.

Jim

Hi Jim,


Thanks for using our products.

I have tested the scenario over Windows 7 (64) where I have used Visual Studio 2010 while using Aspose.Pdf for .NET 7.7.0 and I am unable to notice any issue. The PDF files are properly being converted. Furthermore, I have also tried saving the PDF file in Stream object as well as on file system and I did not notice any issue. Please note that I have used a proper license during testing process.

Can you please share some details regarding your working environment. We are sorry for your inconvenience.

PS, For your reference, I have attached the output TIFF images that are being generated over my end.

Hi,


I’ve re-tested and verified that I am using a current license, and I am still having the same problem. Here are our environment details:
  • Windows Server 2008 R2 Enterprise
  • Problem occurs with VS 2010, in Chrome/Firefox/Explorer
  • Problem also occurs when hosted via IIS in Chrome/Firefox/Safari/Explorer (Macs and PCs)
If you would like, I could provide access to our dev server via an RDP connection.

Thanks,

Jim

When writing the last post, I also realized that it is possible that the way that I am converting the .pdf to and Aspose pdf object might be related to the problem, so I thought I would include my code sample as well:


Dim bytes As Byte() = BaseApplicationPage.f_UploadedFileToPDFStream(file)
Dim myfilestream As System.IO.MemoryStream = New System.IO.MemoryStream(bytes)
Dim pdfNewDoc As Aspose.Pdf.Document = New Aspose.Pdf.Document(myfilestream)

Note, the bytes variable represents the Byte() retured form my file upload. Again, note that 95% of the .pdfs that hit our system work fine. It is just the attached one that is not working. Furthermore, to double check that you have the correct “bad” file, I’ve reattached a couple examples of files that we are having trouble with.

Thanks!

Jim

Hi Jim,


Thanks for sharing the details.

I have again tested the scenario using PDF files which you have shared in your earlier post while using Visual Studio 2010 solution running over Windows 7 (X64) and I am still unable to notice any issue. However for the sake of further investigation, I have logged it as PDFNEWNET-34977 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. We are sorry for this inconvenience.

Okay, I found an acceptable solution, with that added bonus of a huge performance bump. Here is the article:

http://www.aspose.com/docs/display/pdfnet/Performance+Improvement+during+PDF+to+TIFF+Conversion

This resolved the error, as well as improved performance. While it is quite a bit more code, it is a far better solution than the article shown above.

Hi Jim,


I am glad to hear that your problem regarding PDF to TIFF conversion is resolved. Please continue using our products and in the event of any further query, please feel free to contact.