[cairo] Clickable links in PDF? Metadata?

David Kastrup dak at gnu.org
Sat Jul 4 00:56:55 PDT 2015

Andreas Lobinger <lobingera at gmail.com> writes:

> Hello colleague,
> i'm not fully aware of the cairo development and do not have insight
> into roadmap or feature planning, so the following might need
> correction.
> Cairo is clearly targeted at rendering - quality and consitently over
> all output media - not at document management. The features your are
> asking for are part of the pdf document structure and metadata and i'd
> not expect this to be handled by Cairo. I have some background in
> processing and creating pdf - i wrote once SW to change something in
> the pdf structure - like updating the MediaBox, collecting pages from
> 1-page document into 1 document etc. and from that time i'd recommend
> (for your use case) to look for another library to support the
> document structure. pdflib lite e.g. comes to my mind. The pdf rending
> model is quite straight forward (exc. color managment), the major part
> in a pdf document is the document structure.

Well, the deal basically is that our whole path/fill/graphics setup
corresponds to the model of Cairo (not much of a surprise since our main
output is PostScript, obviously more than just a source of inspiration
for Cairo, and we use Ghostscript for converting to bitmap formats, to
PDF, and others).  And there are applications centered around music
display and editing which would benefit very much from _not_ going
through Ghostscript.

Also using ps2pdf means that no resolution-dependent PDF rendering
decisions can be done (GhostScript switches on strokeadjust for
resolutions below 150dpi, but ps2pdf assumes a resolution of something
like 4800dpi or so).

Now PostScript is not much more than a glorified rendering language.
It's pretty close to Cairo in that respect.  Nevertheless there are
commands interpreted by Ghostscript for the sake of implementing ps2pdf
(in the form of just rendering through the DEVICE=pdfwrite device) that
manage to get clickable links in and document metadata.  It's a crutch,
but it's a working crutch that means that Ghostscript can be used for
producing functional PDF including those pieces not germane to the
PostScript language.

Similar crutches would make sense in Cairo in my opinion, because Cairo
is already doing 99% of the job we need done, and we need to produce a
lot more than just PDF on our backends, and Cairo can pitch in a lot

And it's not like LilyPond is alone with such needs.  So the main
question is where to attach those crutches so that they can be
considered generally available in two years or so.

David Kastrup

More information about the cairo mailing list