Convert pdf file with images in jpeg2000 to pdf with non jpeg2000 images
Solution 1
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.
Solution 2
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 -dAutoFilterColorImages=...
and -dUseFlateCompression=...
parameters to the commandline. A simple re-distillation of the PDF should work:
gswin32c .... -sDEVICE=pdfwrite -sOutputFile=out.pdf input.pdf
Update 2:
- Ghostscript for Windows, 32bit, download location: http://ghostscript.com/releases/gs871w32.exe
- Ghostscript for Windows, 64bit, download location: http://ghostscript.com/releases/gs871w64.exe
Tony_Henrich
Updated on September 17, 2022Comments
-
Tony_Henrich almost 2 years
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 ..
-
Kurt Pfeifle almost 13 yearsSo? Did my answer work out for you?
-
-
Tony_Henrich almost 14 yearsI downloaded gswin32c.exe from the web but I get an error about unable to load a dll. Are there any dependencies? I don't have the tools to compile this tool. Is the full tool available for download?
-
Kurt Pfeifle almost 14 yearsDownloading the gswin32c.exe is not enough. You need all the accompanying resources as well (plus, the .dll). Everything is here in the
gs871w??.exe
(s): ghostscript.com/releases (scroll down). -
Kurt Pfeifle almost 13 years@Tony_Henrich: did downloading and installing the
gs871w??.exe
(instead of the singlegswin32c.exe
work for you? -
AnNaSF almost 13 yearsThe issue that I have is that, this works, but it seems to keep cutting off the text. If I use 72dpi conversion it gets most of it, but still cuts off about an inch off the right side. I'm looking through their help, but any other help would be appreciated.