Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ..

share|improve this question
    
So? Did my answer work out for you? –  Kurt Pfeifle Aug 8 '11 at 20:26

3 Answers 3

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.

  1. Recent Ghostscript releases (current is 8.71) are JPEG2000-enabled by default.
  2. 'JPEG2000-enabled' means: 'can read and process JPEG2000 in input PDF'.
  3. 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:

share|improve this answer
    
I 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? –  Tony_Henrich Aug 4 '10 at 6:24
    
Downloading 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 Aug 4 '10 at 8:49
    
@Tony_Henrich: did downloading and installing the gs871w??.exe (instead of the single gswin32c.exe work for you? –  Kurt Pfeifle Aug 8 '11 at 20:27
    
The 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. –  user95808 Aug 28 '11 at 15:59
    
@ERG: Which commandline did you use? You might need to add extra parameters for controlling resolution and page size. If you give some details about your input PDF (or a link to it) and your desired output page size, we might be able to give more hints.... –  Kurt Pfeifle Sep 1 '11 at 5:46

If you have a Mac, it is as easy as opening the file in Preview and saving it. Saved PDF is usualy 5 times bigger or so, but without JPEG200 compression.

share|improve this answer

For those with a Windows PC and no access to a Mac:

  1. Download both GSView and Ghostscript.
  2. Install Ghostscript and then GSView.
  3. Open your PDF in GSView
  4. From the File menu, select Convert.
  5. In the dialog box, under Device, choose PDFWrite, then OK

The resulting output should display properly on iOS devices.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.