Free Support Forum - aspose.com

"Not a valid PDF" error when opening on Android Phone

Hi,

The attached 2 PDF files render fine on a Windows or IPad device, but will not open on Android phones.

The PDF's are constructed with Aspose.Pdf.dll version 7.0.0.0 and are basically containers for .tiff image files. The android phones are running vers. 2.3.4 and 4. Adobe Reader vers. 10.2.1 build 60548.

Your help is appreciated.

Doug Kemp

Hello Doug,


Thanks for using our products.

We are testing these PDF’s at our end and will get back to you soon. We are sorry for your inconvenience.

Hello Nayyer,

Have you had a chance to look at my PDF's to make an assessment? I have a customer that is interested in a resolution.

Doug Kemp

Hello Doug,


Thanks for your patience.

I have tried viewing the PDF documents in Adobe Reader X 10.2.1 Build 60548 over Android 2.3.4 and as per my observations, 201003651.PDF just shows 3 blank pages whereas _05-25-2012.pdf shows single page, where on top left corner, the word complaint is written. Can you please share the source TIFF images and the code snippet that you are using so that we can test the scenario at our end. We are sorry for your inconvenience.

Besides this, I have also tried viewing the PDF files in Office Suite 6 and they are appearing properly. Please take a look over the attached Image file.

Hi Nayyer,

Sorry for my delay, one of the original tiff files contained federally protected personal identification information that I needed to redact manually.

In the attched .zip file, you should find two directories each containing the image(s) and vb.net snippets I use to prepare the PDF's. Feel free to comment on my style if you note anything that needs attention.

Please let me know if I can supply any additional information.

Regards,

Doug Kemp

Hello Doug,


Thanks for sharing the resource files and sorry for replying you late.

I have tried converting the TIFF image into PDF format by simply placing it inside the PDF Section and when I have tried viewing it in Adobe Reader over Android, the image inside PDF document is properly being displayed. Besides this, I have also generated the PDF file with TIFF image placed inside it based over the code snippet that you have shared and now I will try viewing it in Adobe Reader over Android and see if the problem still persists when using Aspose.Pdf for .NET 7.0.0.

Soon you will be updated with the status of correction. We are sorry for your inconvenience.

Based on your code file, I have used the following subset.

[VB.NET]

Dim IVueImage As
Aspose.Pdf.Generator.Image = New Aspose.Pdf.Generator.Image(IVueSec1)<o:p></o:p>

IVueSec1.Paragraphs.Add(IVueImage)

IVueImage.ImageInfo.ImageFileType = Generator.ImageFileType.Tiff

IVueImage.ImageInfo.Alignment = Generator.AlignmentType.Center

Dim ImageHeight As Integer = 0

Dim ImageWidth As Integer = 0

Dim HRes As Single = 0

Dim VRes As Single = 0

'IVueImage.ImageInfo.ImageStream = mstream

IVueImage.ImageInfo.File = "D:\pdftest\393091\393091\_05-25-2012\1986.TIF"

Dim bmp As Bitmap = New Bitmap("D:\pdftest\393091\393091\_05-25-2012\1986.TIF")

ImageHeight = bmp.Height

ImageWidth = bmp.Width

HRes = bmp.HorizontalResolution

VRes = bmp.VerticalResolution

IVueImage.ImageInfo.IsBlackWhite = True

IVueImage.ImageInfo.TiffFrame = -1

Dim PageHeight As Single = IVueSec1.PageInfo.PageHeight

Dim PageWidth As Single = IVueSec1.PageInfo.PageWidth

Dim ImageHeightInPoints As Single = (CType(ImageHeight, Single) / VRes) * 72

Dim ImageWidthInPoints As Single = (CType(ImageWidth, Single) / HRes) * 72

Dim PageHeightOffset As Single = CType(200, Single)

If ImageHeightInPoints > PageHeight - PageHeightOffset Then

IVueImage.ImageInfo.FixHeight = IVueSec1.PageInfo.PageHeight - PageHeightOffset

End If

If ImageWidthInPoints > PageWidth Then

IVueImage.ImageInfo.FixWidth = IVueSec1.PageInfo.PageWidth - 50

End If


IVuePDF.Save("D:\pdftest\393091\393091\_05-25-2012\CustomerCode.pdf")


Hello Doug,


Thanks for your patience.

I have further investigated this problem and have observed that when the PDF document is created based on your code, the resultant PDF is being displayed as blank on Android device. For the sake of correction, I have logged this problem as PDFNEWNET-33887 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 your inconvenience.

PS, Besides this, please note that when I have created a PDF document by following the code snippet shared over following link, the resultant PDF is properly being displayed over Android device. How to Convert an Image to PDF

Hello Nayyer,

I have attempted to construct a PDF using your suggested code rather than my version and have attached it as the AndroidTest_2.PDF file.

However, the user reports that when they attempt to open it, all they are seeing is "black lines". Sorry, I am not getting a better description than that.

Can you please evaluate this file with the Android environment you were working with and let me know how it appears to you?

Regards, Doug Kemp

Hello Doug,

Thanks for sharing the sample file.

We are testing this file in our environment and will get back to you soon.

Hello Doug,


I have tried viewing the PDF file over Android device in Adobe Reader and as per my observations, a blank PDF is being displayed. We will continue with our investigations and will keep you posted with our status of correction. We are sorry for your inconvenience.

Hi Nayyer,

Have you had a chance to follow up on the problem reading the .pdf file on the Android phone?

Regards,

Doug Kempv

Hello Doug,


Thanks for your patience.

Our development team is working hard on resolving this issue but due to some technical difficulties, the issue is not resolved. Nevertheless, I have requested the development team to share the ETA regarding its resolution. As soon as I have some updates, I would be more than happy to update you with the status of correction. Please be patient and spare us little time. We are sorry for this delay and inconvenience.

Hello Doug,


Thanks for your patience.

We have investigated this problem and as per our current estimates, we plan to resolve this issue by mid of October-2012. Please be patient and wait for the new release.

Your patience and comprehension is greatly appreciated in this regard.

The issues you have found earlier (filed as PDFNEWNET-33887) have been fixed in Aspose.Pdf for .NET 7.5.0.


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

The issues you have found earlier (filed as PDFNEWNET-33887) have been fixed in Aspose.Pdf for .NET 7.6.0.


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