Show HN: PDF Debugger – Inspect Structure of PDF Files
pdf.hyzyla.dev
Show HN: PDF Debugger – Inspect Structure of PDF Files
1–10 of 27 posts
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#21. Is the source available anywhere? I'm curious to see how it works.
2. Is there a way to connect the structure displayed here, to the rendered version in the PDF? To visually display the subcomponents?
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#3I spotted a typo, which led me to a bug. When I click on a "stream contents" node, the right panel says "It's a actual content" (instead of "an"), and there is some mouse handling issue that prevents me from selecting the text in the right panel.
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#4That's very cool! 1. Is the source available anywhere? I'm curious to see how it works. 2. Is there a way to connect the structure displayed here, to the rendered version in the PDF? To visually display the subcomponents?
It's a bit different if you are looking at a tagged PDF, where the tagging structure is in there, but if you want to look at that in detail you are probably better served with e.g. ngPDF (https://ngpdf.com/) which will show the tagging structure including the mapping to rendered elements.
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#5Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#6Very neat! I spotted a typo, which led me to a bug. When I click on a "stream contents" node, the right panel says "It's a actual content" (instead of "an"), and there is some mouse handling issue that prevents me from selecting the text in the right panel.
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#7This is really cool, thank you. Maintaining good PDF parsers is a full time job...
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#8That's very cool! 1. Is the source available anywhere? I'm curious to see how it works. 2. Is there a way to connect the structure displayed here, to the rendered version in the PDF? To visually display the subcomponents?
It heavily relies on the core part of PDF.js: I've made a fork of the PDF.js project, removed everything not related to the core part, and added an export for low-level primitives [1].
Also, as inspiration, I used the pdf.js.utils [2] project, which almost does the same but in a different form.
Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#9Re: Show HN: PDF Debugger – Inspect Structure of PDF Files
#10When I was trying to improve my resume I added some custom Javascript to the PDF using Adobe Reader and what I learned is even Adobe's product makes it painful. Basically the process was something like this:
1. You add a script that loads at certain sections in the document. Let's say this is the equivalent of document.load.
2. To do this there's a field to add the full script which must be typed up correctly beforehand. Only after its added do you know it works and every syntax error requires you to edit your previous script, delete the script you added, and hope your new version works.
3. There's really no interactive way to work with the scripts. Their 'debugger' has almost no features at all or hints of syntax errors. Even getting a script to run in it requires finding the right combination of key strokes in a 1000+ line document on PDF scripting.
The programming itself though is quite simple. It's just Javascript with a different DOM and security model. You can still do event-based programming and write powerful programs - all running inside a PDF. But it will only run in firefox (using PDF.js I think) and Adobe reader (for the JS support.) I just thought I'd tell you that writing these JS programs in PDFs (1) actually seems to have a lot of unrealized potential and (2) the tooling to do so is terrible. So with better JS support it would be useful.