Jon (j_b) wrote,
Jon
j_b

How to unpack / inflate PDF FlateDecode sections

If you're trying to get at data inside a .PDF but it's in one of the FlateDecode subsections, you can unpack it using GNU GhostScript and the included PostScript program pdfinflt.ps

The script that does the work is part of the "toolbin" set of programs in the project's source code - unfortunately Ubuntu 10.4 doesn't ship that component with their packaged version of Ghostscript.

You can download the utility from the project's source repository here:
http://code.google.com/p/ghostscript/source/browse/trunk/gs/toolbin/pdfinflt.ps
http://git.ghostscript.com/?p=ghostscript.git;a=blob_plain;f=gs/toolbin/pdfinflt.ps;hb=HEAD (updated 2011-02-20)
http://git.ghostscript.com/?p=ghostpdl.git;a=blob_plain;f=gs/toolbin/pdfinflt.ps;hb=master (updated 2011-05-16 - Vielen Dank to anon commenter from Darmstadt :)

(the "View raw file" is what you want if you're saving it off).

Syntax:

$ gs -- pdfinflt.ps source.pdf output.pdf

Thanks to Ching-Lan Huang of DigDog Software for the info.



Other tools that achieve this:
  • QPDF: qpdf --qdf --object-streams=disable in.pdf out.pdf
  • mupdf-tools: pdfclean -d in.pdf out.pdf
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments