Earlier quoted context omitted.
I've always found it amusing from a "bootstrapping" perspective that the PDF spec is itself a PDF. That said, if you're only writing and not reading existing ones, it's as straightforward or as complex as you want to make it. I wrote a little program many years ago to convert plaintext to PDF in <1kLoC of C --- and its output was actually often many times smaller than what the commercial PDF-generators do, because I…
Please make your code available on github!
Ask HN: Why is the PDF format so inaccessible?
81–90 of 109 posts
Re: Ask HN: Why is the PDF format so inaccessible?
#82The PDF spec is officially available here: http://www.adobe.com/go/pdfreference There’s also this book which provides a good introduction and overview and is useful for understanding how the format works (although the PDF reference itself is pretty decent too, as far as specs go): https://www.oreilly.com/library/view/developing-with-pdf/978... (You can find a PDF copy if you look around.) EDIT: There’s also https://w…
The spec is pretty amazing and very readable, for anyone wondering if they should look into it. My top tip for understanding PDFs is to take one that you have a decompress it then open with a text editor. mutool clean -d in.pdf out.pdf What you'll find is very approachable for a developer. It's a tree of nodes of different types. Some are dictionaries, some are streams of other data. All of them are documented in the…
Re: Ask HN: Why is the PDF format so inaccessible?
#83As for libraries, it seems PDFKit is the dominant one. https://github.com/foliojs/pdfkit As to why it’s so inaccessible…because Adobe created this monstrosity to do just about everything. Text, fonts, vector graphics, raster graphics, forms, color spaces, JavaScript, encryption, signatures, 3D artwork, video, audio, Flash, and probably more. It’s bonkers as to what it can possibly include, and it was developed during…
Re: Ask HN: Why is the PDF format so inaccessible?
#84Earlier quoted context omitted.
You can embed flash in PDF?!?
We recently had a ticket from a user where an uploaded PDF wouldn't load in browser (Chrome). Turns out the PDF had embedded Flash content. I was blown away that in 2022 some application somewhere was still embedding Flash in their PDFs.
Re: Ask HN: Why is the PDF format so inaccessible?
#85The PDF spec is officially available here: http://www.adobe.com/go/pdfreference There’s also this book which provides a good introduction and overview and is useful for understanding how the format works (although the PDF reference itself is pretty decent too, as far as specs go): https://www.oreilly.com/library/view/developing-with-pdf/978... (You can find a PDF copy if you look around.) EDIT: There’s also https://w…
It's certainly true that there are a lot of PDF renderers out there with subtle incompatibilities (and bugs), and also a lot of PDF files with subtle nonconformances. However, that doesn't seem like a good reason to not write a new PDF generator! Instead, write a conformant one. Better, write one that not only conforms, but also isn't affected by any of the bugs in popular PDF renderers, by testing against all of the…
Hard to automate, Windows, macOS and Linux versions have differences
> Foxit
No Linux version, even harder automation than Adobe's
Re: Ask HN: Why is the PDF format so inaccessible?
#86I think it's the same as ms-office, they make a format, and they are the only ones that make the software to use the files in that format, it's funny, because adobe reader is very bad, and they ended up "giving it up", now ISO handles the spec, as for generating PDFs, maybe check libreoffice? or some other software that creates PDFs with the source available
Re: Ask HN: Why is the PDF format so inaccessible?
#87The PDF spec is officially available here: http://www.adobe.com/go/pdfreference There’s also this book which provides a good introduction and overview and is useful for understanding how the format works (although the PDF reference itself is pretty decent too, as far as specs go): https://www.oreilly.com/library/view/developing-with-pdf/978... (You can find a PDF copy if you look around.) EDIT: There’s also https://w…
We have that with websites too. Sometimes it is even hard to spot an error like a missing tag because browsers just assume (often correctly) that it was missing in the first place. But yes, probably also a reason nobody wants to write new browser engines.
Re: Ask HN: Why is the PDF format so inaccessible?
#88As for libraries, it seems PDFKit is the dominant one. https://github.com/foliojs/pdfkit As to why it’s so inaccessible…because Adobe created this monstrosity to do just about everything. Text, fonts, vector graphics, raster graphics, forms, color spaces, JavaScript, encryption, signatures, 3D artwork, video, audio, Flash, and probably more. It’s bonkers as to what it can possibly include, and it was developed during…
When you put it like that, sounds like there's a log4j somewhere in there, easily.
Re: Ask HN: Why is the PDF format so inaccessible?
#89The PDF spec is officially available here: http://www.adobe.com/go/pdfreference There’s also this book which provides a good introduction and overview and is useful for understanding how the format works (although the PDF reference itself is pretty decent too, as far as specs go): https://www.oreilly.com/library/view/developing-with-pdf/978... (You can find a PDF copy if you look around.) EDIT: There’s also https://w…
Thank you for the books and the suggestions. I understand the warnings since I did not really provide any information on my project in the post. Essentially, I am writing a batteries included language to act as a replacement for LaTeX (or at the moment, a small subset of it). I cannot use any existing library since they do not work for my own PL and I do not want to go through PostScript -> PDF since the reason I sta…