Live data from Hacker News

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

github.com

41–50 of 126 posts

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

#41

Earlier quoted context omitted.

PDF has always seemed to be a janky Adobe product. Should a modern, open version of PDF be created knowing that how it evolved from the original concept in 1991? Shouldn't we at some point say, we need to start over and created PDF2?

That would be XPS https://en.m.wikipedia.org/wiki/Open_XML_Paper_Specification

Anything related to XML is arguably even worse.

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

#42
post #38

Earlier quoted context omitted.

My current company uses ML to parse PDF invoices and identify fraud. I have no idea how the devs manage this black magic wizardry because they also spend time contributing to infra code before they hired more people like me on board. If anyone wants a great startup idea, look to solving a problem involving parsing PDFs en masse. Maybe something in legal tech. That market is absolutely ripe for disruption.

Droit does similar things.

That is awesome! Can “cross border” do things like process GDPR compliance regulations or is that not the intended use case?

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

#43

Earlier quoted context omitted.

Despite the thousands of pages of ISO 32000, the reality is that the format is not defined. Acrobat tolerates unfathomably malformed PDF files generated by old software that predates the opening-up of the standard when people were reverse-engineering it. There’s always some utterly insane file that Acrobat opens just fine and now you get to play the game of figuring out how Acrobat repaired it. Plus all the fun of th…

JPEG 2000 (dead) Not sure what you mean by "dead", but tons of book scans, particularly those at archive.org, are PDFs of entirely JPEG2000 images.

Believe it or not, but digital cinema projection is done with jpeg 2000 https://en.wikipedia.org/wiki/Digital_cinema

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

#45
post #32
post #30

I desperately need to be able to display .SVG files with gradients on .PDFs, but no library currently exist in python as far as I know. I would be willing to help make this happen, but I do not know much about the PDF format.

It's actually not so bad: it's mostly ASCII, even though some parts of it really need to be treated as binary. If you open up a simple/old PDF in your favorite text editor, you can begin to grok the basic structures quite easy. One trick for getting started: PDFs are read from the bottom. The first thing that is read is actually an offset pointing back to the xref table, at the end of the file. Then, the xref table i…

If you look for "pdf inspector" apps, there's also lots of those that will let you poke around the parsed tree.

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

#48

Earlier quoted context omitted.

Despite the thousands of pages of ISO 32000, the reality is that the format is not defined. Acrobat tolerates unfathomably malformed PDF files generated by old software that predates the opening-up of the standard when people were reverse-engineering it. There’s always some utterly insane file that Acrobat opens just fine and now you get to play the game of figuring out how Acrobat repaired it. Plus all the fun of th…

JPEG 2000 (dead) Not sure what you mean by "dead", but tons of book scans, particularly those at archive.org, are PDFs of entirely JPEG2000 images.

I mean dead as in the fact that it’s used somewhere is noteworthy.

I’d love for JPEG XL to replace such uses!

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

#49
post #43

Earlier quoted context omitted.

JPEG 2000 (dead) Not sure what you mean by "dead", but tons of book scans, particularly those at archive.org, are PDFs of entirely JPEG2000 images.

Believe it or not, but digital cinema projection is done with jpeg 2000 https://en.wikipedia.org/wiki/Digital_cinema

That’s wild!

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

#50

Good luck, I once started to scratch the same itch to learn this file format, several years later I think I got about 30% of the way through! More open source PDF code is good. If you can find a version of iText RUPS application from somewhere on the internet it's a useful tool for viewing the syntax / structure.

> find a version of iText RUPS application from somewhere on the internet

You mean this, right? https://github.com/itext/i7j-rups#readme

Post reply on HN