I have a pdf file which has images compressed using jpeg2000 compression. The iPad can't display these images in the pdf. Is there a free utility to convert the pdf file to a pdf version where all the images do not use jpeg2000 compression? Looking for a quick solution as in open pdf file, change some setting, save as ..
I'm giving this advice with all reservations, since I currently don't have a way to verify it...
However, what I'm sure about: Ghostscript does support JPEG2000 compression of images (but you may need to specifically build it that way; see http://svn.ghostscript.com/ghostscript/trunk/gs/doc/Make.htm).
Now, what I'm not sure about: there is this
-dAutoFilterColorImages=... commandline parameter. You may be able to use it like this:
gswin32c.exe ^ -dBATCH ^ -dNOPAUSE ^ -dSAFER ^ -sDEVICE=pdfwrite ^ -dAutoFilterColorImages=false ^ -dUseFlateCompression=true ^ -sOutputFile=output-pdf-flate.pdf ^ c:/path/to/input-jpeg2000.pdf
If it works as I think it does, a JPEG2000-enabled Ghostscript build would read your problematic PDF in without error, and write the output PDF with pictures using flate compression instead of JPEG2000.
UPDATE: Found out some additional pieces of info.
- Recent Ghostscript releases (current is 8.71) are JPEG2000-enabled by default.
- 'JPEG2000-enabled' means: 'can read and process JPEG2000 in input PDF'.
- Ghostscript does not write JPEG2000 to its output PDF [*].
[*] Reason: There is no support for creating JPEG2000 images, because the encoder costs money to licence (and it is patent encumbered, so it is risky to write an own implementation).
This means you should not even need to add the
-dUseFlateCompression=... parameters to the commandline. A simple re-distillation of the PDF should work:
gswin32c .... -sDEVICE=pdfwrite -sOutputFile=out.pdf input.pdf
For those with a Windows PC and no access to a Mac:
- Download both GSView and Ghostscript.
- Install Ghostscript and then GSView.
- Open your PDF in GSView
- From the File menu, select Convert.
- In the dialog box, under Device, choose PDFWrite, then OK
The resulting output should display properly on iOS devices.