[cairo] Information on cairo's missing support for hyperlinks in the PDF backend
gabriel.scherer at gmail.com
Wed Jun 1 17:56:20 UTC 2016
I believe that cairo's lack of support for linking an URI to rendered
objects on the PDF backend has been a long-standing issue among
software projects using Cairo to render PDF files.
This feature has been discussed on the Cairo list or bugtracker several times:
- in 2007, Alp Toker proposed an API with the PDF and XPS backend in mind,
but no actual implementation work appears to have been done
- in 2009, Dan McMahill asked about the feature again
there had been no progress, but Adrian Johnson mentioned that
a 2008 Cairo summit discussion proposed to instead let people add
non-graphic PDF objects directly from a cairo render
It seems that Adrian Johnson started working on this, but I cannot
find this work in today's Cairo, does anyone know what became of it?
- in 2011, 'Pander' submitted a bug report on the Cairo bugtracker
Adrian Johnson indicated in 2015 that there was interest
in having the feature for 1.16. I would warmly welcome any
news on this front.
The question has been asked repeatedly to applications using Cairo as
a backend to render PDFs.
- the 2011 bugreport above comes from a feature request on the Graphviz project
- in 2012 the Weasyprint project was asked for support for links in PDF output;
they initially turned the feature down, then implemented a workaround
as a post-filtering pass
- Inkscape has received user requests for preserving hyperlinks in PDF exports,
and has so far turned them down because of lack of support on Cairo side. See
This bug report was submitted in 2009, and got updates from 6
interested users in
2011, 2012, 2013, and 2014.
Finally someone implemented a post-processing script in Python that
is a fragile hack,
and is hard for users to use (they create a purple rectangle with a
link that the script
finds and replace by a proper link by postprocessing the PDF)
- Firefox had a feature request in 2008 to preserve hyperlinks in
"print to file" output,
with three duplicate requests and regular user interest
More information about the cairo