PDF links are not added on empty pages
PDF links are ignored on empty pages.
For example, this document should have a link but doesn't:
#include <cairo.h>
#include <cairo-pdf.h>
int main(void) {
cairo_surface_t *surface;
cairo_t *cr;
surface = cairo_pdf_surface_create("pdffile.pdf", 320, 320);
cr = cairo_create(surface);
cairo_tag_begin(cr, CAIRO_TAG_LINK, "rect=[30 30 100 100] uri='https://cairographics.org'");
cairo_tag_end(cr, CAIRO_TAG_LINK);
cairo_show_page(cr);
cairo_surface_destroy(surface);
cairo_destroy(cr);
return 0;
}
Drawing something (a rectangle for eexample) makes the link appear:
cairo_set_source_rgb(cr, 0.1, 0, 0);
cairo_rectangle(cr, 30, 30, 100, 100);
cairo_stroke(cr);