Live data from Hacker News

Show HN: IPA, a GUI for exploring inner details of PDFs

github.com

21–30 of 52 posts

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#21

what's a good tool to check if a pdf is not tampered with eg. as a tool to check before loading a pdf from a public bucket to your backend application?

If you sign the file, you should be able to verify that the signature still matches the file.

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#22
post #3

This is cool! Here are some other similar(?) tools, for seeing the inner contents of a PDF file (the raw objects etc), but I haven't compared them to this tool here: - https://pdf.hyzyla.dev/ - https://github.com/itext/i7j-rups (java -jar ~/Downloads/itext-rups-7.2.5.jar) - https://github.com/desgeeko/pdfsyntax (python3 -m pdfsyntax inspect foo.pdf > output.html) - https://github.com/trailofbits/polyfile (polyfile --…

Sweet, currently working on PDF signature stuff so I'm sure I'll find some stuff handy :)

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#23
post #3

This is cool! Here are some other similar(?) tools, for seeing the inner contents of a PDF file (the raw objects etc), but I haven't compared them to this tool here: - https://pdf.hyzyla.dev/ - https://github.com/itext/i7j-rups (java -jar ~/Downloads/itext-rups-7.2.5.jar) - https://github.com/desgeeko/pdfsyntax (python3 -m pdfsyntax inspect foo.pdf > output.html) - https://github.com/trailofbits/polyfile (polyfile --…

I am the author of PDFSyntax, thanks for mentioning it!

The HTML output is like a pretty print where you can read view objects and follow links to other objects.

Since I have added a new command (disasm) that is CLI oriented and displays a greppable summary of the structure. Here is an explanation: https://github.com/desgeeko/pdfsyntax/blob/main/docs/disasse...

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#24
post #4

Does anyone have any recommendations for a good tool that allows both programmatic inspection and modification of PDF primitives. For example, let's say someone wants to iterate through every embedded image in a PDF and apply some form of signal processing to the images in-place, then re-save the PDF?

My tool (PDFSyntax[1], mentioned in this thread) is a Python library that is able to both inspect and transform PDF files.

Depending on your transformation use case, you may write an incremental update with only a few bytes at the end of the original file instead of rewriting it entirely. To my knowledge this feature of the PDF specification is often overlooked and not a lot of libraries implements it.

It is a work in progress and I have not developed functions for images yet, though.

[1] https://github.com/desgeeko/pdfsyntax

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#26

This looks nice, and I didn't know about eGUI which looks like it runs on the web. Very interesting. https://www.egui.rs/

Thanks! Immediate paradigm might be a little bit scary if you used to play with Qt, but looks easy to manage and it's really interactive

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#27

I recently wanted to edit out a huge background image repeating on almost every page of a PDF and found out there's no obvious way to do it. Would appreciate any tool suggestions!

I've had good experience with pypdf, if you're willing to do a little coding.

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#28
post #3

This is cool! Here are some other similar(?) tools, for seeing the inner contents of a PDF file (the raw objects etc), but I haven't compared them to this tool here: - https://pdf.hyzyla.dev/ - https://github.com/itext/i7j-rups (java -jar ~/Downloads/itext-rups-7.2.5.jar) - https://github.com/desgeeko/pdfsyntax (python3 -m pdfsyntax inspect foo.pdf > output.html) - https://github.com/trailofbits/polyfile (polyfile --…

Mutool is the one I suggest to people. The easiest way to understand a PDF is to decompress it and then just read the contents.

    mutool clean -d in.pdf out.pdf
At that point you’ll realise that a PDF is mostly just a list of objects and that those objects can reference each other. After that you’ll journey through the spec understanding what each type of object does and what the fields in it control. The graphics stream itself is just a stack based co-ordinates drawing system that’s easy to follow too.

By way of an example. Here's an object that represents a Page. You can see the dimensions in the MediaBox. The contents themselves are contained at object "9 0 obj" ("9 0 R" is the pointer to it):

    2 0 obj
    >
    endobj
Meanwhile "9 0 obj" has the drawing instructions. They seem a little weird at first glance but you see the values ".23999999 0 0 -.23999999 0 792" each get pushed on the stack and then "cm" pops them to interpret them as the transformation matrix.

    9 0 obj
    >
    stream
    .23999999 0 0 -.23999999 0 792 cm
    q
    0 0 2551 3301 re
    ...
The depth and detail of all of the different possible things that can be represented in a PDF is insane. But understanding the structure above is all you need to begin your journey!

EDIT The rest of your journey is contained in this epic document: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandard...

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#29
post #28
post #3

This is cool! Here are some other similar(?) tools, for seeing the inner contents of a PDF file (the raw objects etc), but I haven't compared them to this tool here: - https://pdf.hyzyla.dev/ - https://github.com/itext/i7j-rups (java -jar ~/Downloads/itext-rups-7.2.5.jar) - https://github.com/desgeeko/pdfsyntax (python3 -m pdfsyntax inspect foo.pdf > output.html) - https://github.com/trailofbits/polyfile (polyfile --…

Mutool is the one I suggest to people. The easiest way to understand a PDF is to decompress it and then just read the contents. mutool clean -d in.pdf out.pdf At that point you’ll realise that a PDF is mostly just a list of objects and that those objects can reference each other. After that you’ll journey through the spec understanding what each type of object does and what the fields in it control. The graphics stre…

> mutool clean -d in.pdf out. pdf

My tool can do exactly the same (viewing internal structure, exporting objects, and see the uncompressed raw content for stream) with a graphical interface and without all this kind of flags (which one of the reasons I started to design this project with egui), but thanks for posting yours too.

Re: Show HN: IPA, a GUI for exploring inner details of PDFs

#30
post #3

This is cool! Here are some other similar(?) tools, for seeing the inner contents of a PDF file (the raw objects etc), but I haven't compared them to this tool here: - https://pdf.hyzyla.dev/ - https://github.com/itext/i7j-rups (java -jar ~/Downloads/itext-rups-7.2.5.jar) - https://github.com/desgeeko/pdfsyntax (python3 -m pdfsyntax inspect foo.pdf > output.html) - https://github.com/trailofbits/polyfile (polyfile --…

Recommend just letting people have their one day in the sun. We’ve become less the site of builders as the red team for testing your launch.
Post reply on HN