News for hackers. Stuff that matters.

desgeeko

Thank you very much!
Correct, PDFSyntax implements everything at the lowest level. You can ignore the HTML visualization and use it as an API to access PDF objects. Why? Because I started a very small tool as a week-end project and I got hooked reading the PDF Specification so it is becoming a general purpose PDF library for Python. I am not familiar with other libraries but I have the impression that mine implements things that are often overlooked in others, like incremental updates.
Yes, I value simplicity and the interactivity offered by basic HTML and CSS is sufficient for my use case :)
Thanks for noticing! You're right, I will fix that very soon.

Show HN: HTML visualization of a PDF file's internal structure

https://github.com/desgeeko/pdfsyntax/blob/main/docs/browse.md

Hi, I've just finished a rebuild of this function and added a lot of new features: info, page index, minimap, inverted index,... I think it may be useful for inspection, debugging or just as a learning resource showcasing the PDF file format. This is a pet project and I would be happy to receive some feedback! Regards

( Read More... | 57 comments | 177 points | on HN )
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

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:So you want to modify the text of a PDF by hand on Monday September 04, 2023 @06:04PM (#37385569)
If you want to continue this journey and learn more about PDF, you can read the anatomy of a file I documented recently: https://pdfsyntax.dev/introduction_pdf_syntax.html

Show HN: I am building a new Python library to read/write PDF files

https://github.com/desgeeko/pdfsyntax

Hi HN! This is my pet project, written from scratch because there is so much to discover and learn in the process. The focus is on simplicity and incremental updates. Progress is slow because I do not have much spare time to work on this, but I would love to hear some feedback. Regards

( Read More... | 121 comments | 2 points | on HN )
Re:Show HN: Browse the internal structure of a PDF file on Sunday July 18, 2021 @02:22PM (#27875159)
When you develop an application reading or writing PDF files, it may be useful to inspect the content of a file in order to understand what is inside and how objects are linked. Especially when dealing with PDF version 1.5 or above when multiple objects can be compressed together into an object stream: opening the raw file in a text editor would not help you. You can find similar tools with a text based interface or with a Java client, but I am not aware of another tool producing HTML for easy navigation in the PDF structure.