qpdf: Extracting PDF Streams

Published: 2024-11-02. Last Updated: 2024-11-02 13:08:21 UTC
by Didier Stevens (Version: 1)
0 comment(s)

In diary entry "Analyzing PDF Streams" I answer a question asked by a student of Xavier: "how can you export all streams of a PDF?". I explained how to do this with my pdf-parser.py tool.

I recently found another method, using the open-source tool qpdf. Since version 11, you can extract streams with qpdf.

If you want the contents of the streams inside a single JSON object (BASE64 encoded), use this command:

qpdf.exe --json --json-stream-data=inline exampl.pdf

And if you want the contents of the streams in separate files (filename prefix "stream"), use this command:

qpdf.exe --json --json-stream-data=file --json-stream-prefix=stream exampl.pdf

Didier Stevens
Senior handler
blog.DidierStevens.com

Keywords:
0 comment(s)

Comments


Diary Archives