27

PDFs are inescapable, what surprises me is the lack of open-source tools available for interacting with them via some sort of API. One example which sticks in my mind was when I was using .NET to parse some PDFs and my program threw a TrialLimitMet error because I hadn't purchased a key to use in the Nuget package I was using. I've since struggled to find well maintained and extensive packages for NodeJS and Python.

I noticed that the PDF specification, from ISO, costs a non-trivial amount of money for someone just interested, which leds me to believe it might be restricting the number of open-source developers.

Before researching, it was my belief that Adobe owned the PDF filetype, I know see that that may not be entirely true but they may

Is there a reason that this sort of, IMO unhealthy, ecosystem exists?

13
  • 16
    Any standard publication from the ISO costs a non-trivial amount of money, that's not in any way specific to the PDF standard. The standard workaround is to find a PDF of the last draft version immediately before standardization, because that will be free yet identical in content with the real deal.
    – TooTea
    Nov 12 at 14:30
  • 1
    If you are seeking toolchain for producing PDFs, learn a bit about (La)TeX. You can prepare input for the LaTeX in your program and just make PDF from it. Since it is extensible and plain-text-based (but uses weird syntax), you can create nearly anything you want, including configuration of stuff like page rotation, table of contents etc. • Preparing input for LaTeX is sometimes not easy, but I use it for producing reports or printable forms etc. from a program. It is slower than direct creation, but quite easy to set up.
    – jiwopene
    Nov 12 at 14:46
  • 1
    Complex specification means time and effort, especially for that you do not need yourself. In other words, why didn't you just write what you need yourself? Nov 12 at 18:06
  • 8
    ...and this is why people give-up writing efficient software and just bundle a 100MB webkithtmltopdf.exe build in their application and people wonder why software is so slow and RAM hungry today.
    – Dai
    Nov 12 at 19:33
  • 2
    The PDF specs published by Adobe, up to 1.7 (ISO 32000-1:2008) are freely available on opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/index.html They have been available for free for a long time, and before that you could just buy the book from Addison-Wesley
    – jcaron
    Nov 14 at 17:36

2 Answers 2

43

PDFs are really complicated, but also have significant value – precisely because they are so ubiquitous. PDFs are the format for exchanging documents that shouldn't be edited (like invoices), the format for distributing layouted content like print-ready files, and with PDF/A the format for long-term electronic archiving.

While Adobe has tons of extensions and special features in some PDF variants, those are rarely used. The worst PDFs I had to deal with used embedded macros to dynamically generated additional pages and QR codes based on form input, or embedded multimedia into the page. That is not normal. Many people don't even use Adobe software for viewing PDFs, so anything more fancy than basic forms is not going to work reliably.

There is an open source ecosystem for dealing with PDFs. Tools like PdfTeX and Cairo can be used for PDF creation, Poppler for PDF parsing and rendering, Ghostscript for rasterization, iText for creation and manipulation. I'm not sure if LibreOffice has a custom PDF backend.

But, many of these use copyleft licensing (AGPL or GPL). Some of these use a dual-licensing scheme, where users can pay for a proprietary license if they don't want copyleft licensing terms. And commercial users do pay, because a good PDF API is so valuable.

The incentives of all involved actors are (mis-)aligned such that a permissively licensed Open Source PDF library ecosystem is unlikely to spring up:

  • PDF is a complex format, so that there's a high barrier to entry in this “market”. Development costs for a “good enough” PDF library are high. The cost of the specifications is only a small aspect, compared to the time investment.
  • Commercially motivated Open Source authors will have to run the numbers: is it cheaper to pay for development of a new PDF library, or is it cheaper to pay for a proprietary license for an existing library? Hint: PDF API vendors like iText know this and can price accordingly. This problem could be avoided by a large consortium (effectively crowd-funding creation of a new API), but so far no one has organized this.
  • Philosophically motivated Open Source authors are probably entirely happy with copyleft-licensed libraries. While there is also a community of people that strongly prefer permissive Open Source licenses over copyleft licenses (greetings to the OpenBSD crowd), PDF manipulation is neither an integral part of computing nor that terribly exciting to motivate some individuals to start and complete this kind of project.
1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – MadHatter
    Nov 15 at 9:49
1

A few years back I had as a task to find a simple way to customize customer on demand reports.

Using Perl, I coded a general parser that recognized standard tags in all of the reports and allowed for positioning, whereby files with the report ID, the customer and department allowed for search and replace within the report. The ability to either have a text or image banner, or a company logo was added. there were also a bunch of other features that I begin to forget.

Long story short, Perl had over 150 routines for PDF production that were in general fully functional, documented and free available from CPAN. In the end everything I was looking to do could be achieved rather quickly with what was available for Perl.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 15 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.