Live data from Hacker News

Ask HN: Why is the PDF format so inaccessible?

news.ycombinator.com

51–60 of 109 posts

Re: Ask HN: Why is the PDF format so inaccessible?

#51
post #23

Make use of TeX and Friends source code for handling PDF symbols, then it is much easier to check different implementations. For example, TikZ/PGF package has both PS and PDF implementations of the same graphical objects. So you can see how PDF literals or PS specials come into object stream. Also it is really not that cryptic but very much laborious, hence many people rely on classical tools to generate PDF instead…

Thank you. I will look into Tikz source code.

Re: Ask HN: Why is the PDF format so inaccessible?

#52
post #32

The 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…

That’s fine, and I actually applaud avoiding complex dependencies like LaTeX/PostScript. Using a good PDF library might still make sense for your use case, as they generally provide enough low-level support. In particular for handling the COS object system, which you really don’t want to do by hand if you can avoid it. Or you can at least start with using a library to get familiar with the higher-level PDF peculiarities, and only switch to fully hand-written output later when and if you find that necessary.

Re: Ask HN: Why is the PDF format so inaccessible?

#53
post #33

As 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…

You can embed flash in PDF?!?

Re: Ask HN: Why is the PDF format so inaccessible?

#54
post #52

Earlier quoted context omitted.

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…

That’s fine, and I actually applaud avoiding complex dependencies like LaTeX/PostScript. Using a good PDF library might still make sense for your use case, as they generally provide enough low-level support. In particular for handling the COS object system, which you really don’t want to do by hand if you can avoid it. Or you can at least start with using a library to get familiar with the higher-level PDF peculiarit…

Ok! I will look into those libraries. Thanks a lot.

Re: Ask HN: Why is the PDF format so inaccessible?

#55
post #33

As 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…

You can embed flash in PDF?!?

In the good old days you could embed executable code in a PDF. Interactive flash games. Java applets.

Sanity has prevailed and a lot of that just doesn’t work anymore, but IIRC Adobe wanted PDF to be “the” file interchange format.

Re: Ask HN: Why is the PDF format so inaccessible?

#56
post #24

Earlier quoted context omitted.

The PDF specification, hosted by Adobe, free for you to download… (pay attention, this is a big PDF) https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/p... Adobe specifically negotiated to make this freely available. From the document: This document you are now reading is a copy of the ISO 32000-1 standard. By agreement with ISO, Adobe Systems is allowed to offer this version of the ISO standard as a free PD…

Thank you. I'll take a look at the older specs. I assumed that the 2.0 version would be the one with the best print quality and I should target that.

It’s probably worth spending a few minutes looking into PDF/A, which is a subset of PDF designed for archival. While it might not be a perfect fit for your needs (though it almost certainly is), being ISO standardised it might be a good source of documentation.

https://en.m.wikipedia.org/wiki/PDF/A

Re: Ask HN: Why is the PDF format so inaccessible?

#57
My previous startup worked with parsing PDFs, trying to apply NLP to the texts within PDFs - extracting titles, paragraphs, tables, bullet points etc. Oh my that was a nightmare. Sure we were doing difficult things, so that made us unique, but it was a slog. Working with different dimensions, pages upside down, sentences spanning across multiple pages etc etc.

I've also recently worked on a small tool called scholars.io [1] where I had to work with PDFs. I wasn't doing anything like parsing, but I just used existing PDF tools and libraries, which were much more pleasant, but still working on top of PDF is a challenge.

[1] - https://scholars.io (a tool to read & review reearch papers together with colleagues)

Re: Ask HN: Why is the PDF format so inaccessible?

#59
post #44

It's old, proprietary, modeled after the PostScript printer control language, from an era before XML, and never had the intention of being open.

> It's old, proprietary, modeled after the PostScript printer control language, from an era before XML, and never had the intention of being open. I have the impression you have no direct contact, experience, or first-hand knowledge with PDF. If age mattered (which it doesn't) then PDF's latest update was published on 2020, which is far fresher than XML's spec. Nevertheless, it's absurd to compare a document format w…

> If age mattered (which it doesn't) then PDF's latest update was published on 2020, which is far fresher than XML's spec.

Standards are dragged down by their oldest version, not the newest.

EDIT: Sorry, that was a nice punchline but didn't actually explain very well. My point is that unless they actually start over, which almost never happens, newer versions tend to just be more layers of stuff to deal with. It's not just a "who has the most recent revision date", but "who has the least 'interesting' historical baggage baked into the spec".

Re: Ask HN: Why is the PDF format so inaccessible?

#60
post #44

Earlier quoted context omitted.

> It's old, proprietary, modeled after the PostScript printer control language, from an era before XML, and never had the intention of being open. I have the impression you have no direct contact, experience, or first-hand knowledge with PDF. If age mattered (which it doesn't) then PDF's latest update was published on 2020, which is far fresher than XML's spec. Nevertheless, it's absurd to compare a document format w…

> If age mattered (which it doesn't) then PDF's latest update was published on 2020, which is far fresher than XML's spec. Standards are dragged down by their oldest version, not the newest. EDIT: Sorry, that was a nice punchline but didn't actually explain very well. My point is that unless they actually start over, which almost never happens, newer versions tend to just be more layers of stuff to deal with. It's no…

> Standards are dragged down by their oldest version, not the newest.

Not really, specially if you keep in mind that newer standards have erratas and newer versions, like PDF 2.0, deprecate features.

Post reply on HN