Not really answering your question but you could consider generating postscript output and then using ghostscript to convert it to pdf. That would let you create and write arbitrary stuff. I think pandoc uses pdflatex to generate a pdf via latex from the internal pandoc representation. Imagemagick also writes to pdf I believe, but it may only convert raster images. With postscript you can generate a vector pdf
Ask HN: Why is the PDF format so inaccessible?
11–20 of 109 posts
Re: Ask HN: Why is the PDF format so inaccessible?
#12Re: Ask HN: Why is the PDF format so inaccessible?
#13Re: Ask HN: Why is the PDF format so inaccessible?
#14Re: Ask HN: Why is the PDF format so inaccessible?
#15Re: Ask HN: Why is the PDF format so inaccessible?
#16The ReportLab APIs mirror the PDF file structure relatively closely.
Don't listen to the people who are nattering on about how PDF is proprietary on purpose. I think that may have been the case in its early years but it hasn't been the case this millennium.
PDF 1.7 (the spec from 02008) and even earlier verions are most often used, as you'll see if you run head -1 *.pdf in a directory with a lot of random PDFs. PDF 2.0 is not important and you may want to intentionally write an earlier version for broader compatibility. The big incompatibility is actually PDF 1.5 to 1.6: 1.6 added compressed object streams, and a lot of readers still don't support those.
______
Re: Ask HN: Why is the PDF format so inaccessible?
#17Couple years ago I needed to generate PDF reports, relatively complicated ones: headers/footers/backgrounds, page numbers, complex tables, jpeg bitmaps, custom vector graphics in diagrams, etc. This one did the job: https://www.nuget.org/packages/iTextSharp-LGPL
Re: Ask HN: Why is the PDF format so inaccessible?
#18Re: Ask HN: Why is the PDF format so inaccessible?
#19I don't think Pandoc knows anything about the PDF format. It can't read it https://github.com/jgm/pandoc/tree/master/src/Text/Pandoc/Re... or write it https://github.com/jgm/pandoc/tree/master/src/Text/Pandoc/Wr.... It uses other tools to do that.