I followed the following example to view a pdf in my App (Xamarin.iOS). Everything worked fine until recently I started to notice some pdf files can't be read using this method.
I open and got info on my mac and I noticed the following:
- if I export the document to pdf using the Mac viewer it can be read just fine, but the size is increase.
- If I try to open the file as is, nothing is viewable, but a white page.
- This happens for my iOS app only, the viewer on my Android works just fine.
I can export every file to pdf using the Mac's viewer, but it is an extra step than what I need. What can I do to fix this?
Original encoding: PDFScanLib v1.2.2 in Adobe Acrobat 10.1.16
Export encoding: Mac OS X 10.10.5 Quartz PDFContext
I ran additional tests to the program and I can conclude the issue is with the compression being used on the pdf files. Is there any way CGPDFDocument can remove or ignore the compression so I can view the pdf? I upload the pdf to my mobile backend where I split the pages. I am using Pdfsharp to accomplish this if possible is there a way to clean out the files before being save to the server? (This issue is only affecting the iOS version of my app).
After extra testing I have come accross the following bug: Here It will appear the JBIG2 compression used has a known bug that causes errors when reading a jpg in a pdf. ( I will continue further testing until I can find a solution.)
Corrections: The pdf compression is not JBIG2, but FlateDecode. After testing and reading the binary data I have notice that both the original and the export have the same type of compression. (Will update with more information as I try to figure this out.)