What pdf elements can cause crashes?

This is a very general question, but it is based on a specific problem. I created a PDF reader for iPad and it works great, except for some PDF pages that always cause the application to crash. Now we find out that the same pages crash Safari, as I began to suspect that the problem is somewhere in the Apple pdf rendering code.

From what I could see, the crash pages cause the rendering libraries to start distributing memory as a mind until the application is killed. I have nothing else to help me determine what causes this process.

This does not necessarily happen with the largest documents, or with the largest forms. In fact, we did not find a single parameter that will help us predict which pages will break and which will not.

Now we just discovered that launching pages through a consumer program that allows you to combine documents is getting rid of the problem, but I could not determine which attribute or element it is key. Manually changing documents is also not an option for us in the long run. We need to start the automatic process on our server.

I hope someone with a deeper knowledge of the pdf file format can point me in a reasonable direction to look for document functions that can cause this behavior. All I have found so far is something about JBIG2 images, and I don’t think we have such.

+7
safari objective-c iphone pdf ipad
source share
4 answers

The same problem arose with two “special” PDF files that could not be displayed in an iPad application or Safari for iPad. In my case, the problem was isolated from some translucent gradient shades.

By the way, converting PDF to postscript and then back to PDF again seems to remove internal elements that PDFKit doesn't like. The original document was 1.9 MB in size with many vector shapes, after the conversion process reduced the file size to 600 KB and was seamlessly presented on the iPad.

+1
source share

This is not a PDF feature, but support, which is a problem. You need to separate the PDF and see what it contains - you can do it in Acrobat 9.0 - there is an article showing how you can use it to view inside the PDF at http://pdf.jpedal.org/java-pdf-blog/ bid / 10479 / Viewing-PDF-objects

We were sent several PDF files that crashed Mail on OS X, and the problem turned out to be inline, subsets of fonts.

+1
source share

I found out that the tensor shading elements are definitely application failures. Always! It is absolutely reproducible.

+1
source share

I also dealt with this problem. I narrowed the question down to one PDF file with a built-in black and white image. Opening a PDF in an adobe reader, either offline or in a browser, always gives the "Not enough data for the image" dialog box along with a damaged presentation after the item.

While researching the Internet for some tool for this very common situation led to one hint as the main reason - from http://forums.adobe.com/message/2151474#2151474

I also encountered the same question in the afternoon, and after many experiments it turned out that the root of my problem was to optimize PDF files using Adobe Acrobat 6 with monochrome compression using JBIG2. I removed compression only on monochrome images (color images, etc., Still compressed via JPEG), and now my files open simply in readers 9.1, 8, etc.

Perhaps this is the problem you are facing?


Continued .... I localized the "insufficient data for image" error for color images converted to b & W using mac. Using itext and java, I came up with this solution. Identify the problematic image space and rewrite it. These are miracles. Unable to replicate using another language.

image = Image.getInstance( imageUrl ); if( image.getColorspace() == 1 && image.isJpeg() ) { baseLog.warn( "bad image detected at " + imageUrl ); BufferedImage bufImage = ImageIO.read(new URL( imageUrl )); int imageType = bufImage.getType(); if ( imageType == 10 ) { // convert the image to get rid of bad stuff inside ColorSpace cs = ColorSpace.getInstance( ColorSpace.CS_GRAY ); ColorConvertOp op = new ColorConvertOp(cs, null ); image = Image.getInstance( op.filter(bufImage, null ), null ); } } 
+1
source share

All Articles