Is the UI tooling that does the visualization a library? I really like the UI format, would love to use this for breaking down and debugging video byte streams too. EDIT: Oh it's actually reasonably simple, great use of CSS! https://github.com/desgeeko/pdfsyntax/blob/main/docs/simple_...
Show HN: HTML visualization of a PDF file's internal structure
21–30 of 60 posts
Re: Show HN: HTML visualization of a PDF file's internal structure
#22I remember there was a similar project on github allows visualize any type of binary data by a given schema. There was an TCP/IP example IIRC.
I haven't had a lot of luck thus far, except ones which allow escaping out of declarative mode over into "and then run this code"
Re: Show HN: HTML visualization of a PDF file's internal structure
#23Wow, I've been doing some PDF parsing at work and this is going to come in SO handy.
It gives you a JSON representation of the PDF data structure. What's nice is that doesn't hide the underlying format but it takes care of a lot of the low level edge cases for you.
Re: Show HN: HTML visualization of a PDF file's internal structure
#24I’ve been shopping for something that does a per-byte description of the content of visual media formats (jpeg, png, avi, mp4, etc). Anyone know of one?
Re: Show HN: HTML visualization of a PDF file's internal structure
#25Damn, this is also convenient for forensics and finding watermarks.
That does sound interesting. Forgive my ignorance, but how could this be used to detect watermarks? Could the same method be used to detect signatures?
Re: Show HN: HTML visualization of a PDF file's internal structure
#26The project was in the end a complete failure and several people were upset at me for not delivering what I was supposed to.
In present day, with the capabilities that are now available with LLMs to extract data from PDFs I 100% would go the route of utilising AI to extract the data they wanted. Back then that did not yet exist.
Re: Show HN: HTML visualization of a PDF file's internal structure
#27If you're interested in manipulating PDFs, I've found QPDF [0] to be a useful tool. Its "QDF mode" lays out the objects in a form where you can directly edit them, and it can automatically fix up the xref table afterwards. It can also convert to and from a JSON format that you can manipulate with your own scripts. [0] https://github.com/qpdf/qpdf , https://qpdf.readthedocs.io/en/stable/
https://qpdf.readthedocs.io/en/stable/json.html
https://github.com/maximoguerrero/PDF-GPT4-JSON
PDF is such a curious format. It's not human-readable, it's not well-structured, it's not small. If it weren't for momentum and the political horse trading that Apple, Adobe and Microsoft were doing when the web went mainstream and freaked them out around 1995, I'm not sure that we'd be using it today. Postscript is better in countless ways, but since it's Turing-complete, it's not really ideal for storing static data, and to my knowledge was never extended to handle binary data well, like for embedded JPEGs. I remember trying to print a 10 MB ps file in the 1990s and it took maybe 20 minutes because the grayscale image was basically represented as a bunch of run-length encoded scan lines.
I would argue that frontend web development has reached a similar fate. It seems odd to use programming language (imperative, no less) to design media that we used to describe declaratively. If I had enjoyed success in my programming career, I would work on a declarative representation of HTML/CSS/Javascript that can represent the intersection of all existing markup across all mainstream browsers. Sort of like a mix between Markdown and CSS flexbox like Xcode's auto layout, but universal. It frankly would probably look like HTML, but with sane defaults/builtins/inheritance, as well as a way define and extend components from the beginning, similarly to how people try to use data attributes. For contrast, React and Vue come at this from the opposite direction. I'm talking about something more like htmx.
Then we could work with that format and transpile to HTML or even React Native and dump 90-99% of the boilerplate and build tooling that we use currently.
Re: Show HN: HTML visualization of a PDF file's internal structure
#28If you're interested in manipulating PDFs, I've found QPDF [0] to be a useful tool. Its "QDF mode" lays out the objects in a form where you can directly edit them, and it can automatically fix up the xref table afterwards. It can also convert to and from a JSON format that you can manipulate with your own scripts. [0] https://github.com/qpdf/qpdf , https://qpdf.readthedocs.io/en/stable/
Re: Show HN: HTML visualization of a PDF file's internal structure
#29Re: Show HN: HTML visualization of a PDF file's internal structure
#30I’ve been shopping for something that does a per-byte description of the content of visual media formats (jpeg, png, avi, mp4, etc). Anyone know of one?
This sounds like the format specification? What are you looking for that is not a document?
The current context for me is I'm exploring various non-steganography approaches to embed metadata in photos. In the past, I've built custom formats to embed streaming data side-by-side: https://github.com/dustinfreeman/kriffer