[cairo] BUG: PDF page links
Knut Petersen
knupero at gmail.com
Fri Jul 23 08:37:33 UTC 2021
Hi everybody!
I use this C++ code to generate page hyperlinks with the pdf backend:
for (auto &cr : Cairo_output.contexts) // loop over a set pf crs
{
cairo_tag_begin (cr, CAIRO_TAG_LINK, attr.c_str ());
cairo_tag_end (cr, CAIRO_TAG_LINK);
}
debug_output (_f ("page-link %s", attr.c_str ()));
All the following attribute strings passed to cairo_tag_begin should be ok:
page-link rect=[ 245.195312 482.759313 101.537008 -9.776040 ] page=2 pos=[0.0 0.0]
page-link rect=[ 246.871094 50.185095 101.537008 -9.776040 ] page=1 pos=[0.0 0.0]
page-link rect=[ 246.871094 64.380407 101.537008 -9.776040 ] page=3 pos=[0.0 0.0]
page-link rect=[ 246.871094 50.341345 101.537008 -9.776040 ] page=2 pos=[0.0 0.0]
But in reality cairo_tag_* fails if 'page' is a forward reference. While processing page 2 it is possible to generate a link to page 1, but a link to page 3 fails.
Tested with: cairo 1.16.0, git master.
Knut
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20210723/6769d7b7/attachment.htm>
More information about the cairo
mailing list