From 7e3fe1d70c5d32762151f5d6c1369800ceefbe93 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 14 May 2006 23:00:13 +0000 Subject: Tighten formatting of PDF annotations, making them direct rather than indirect objects and removing some surplus whitespace. This saves 40K in the Halibut manual. [originally from svn r6688] --- bk_pdf.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/bk_pdf.c b/bk_pdf.c index 2697b16..c4a65be 100644 --- a/bk_pdf.c +++ b/bk_pdf.c @@ -422,31 +422,26 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, objtext(opage, "/Annots [\n"); for (xr = page->first_xref; xr; xr = xr->next) { - object *annot; char buf[256]; - annot = new_object(&olist); - objref(opage, annot); - objtext(opage, "\n"); - - objtext(annot, "<<\n/Type /Annot\n/Subtype /Link\n/Rect ["); + objtext(opage, "<lx / FUNITS_PER_PT, xr->by / FUNITS_PER_PT, xr->rx / FUNITS_PER_PT, xr->ty / FUNITS_PER_PT); - objtext(annot, buf); - objtext(annot, "]\n/Border [0 0 0]\n"); + objtext(opage, buf); + objtext(opage, "]/Border[0 0 0]\n"); if (xr->dest.type == PAGE) { - objtext(annot, "/Dest ["); - objref(annot, (object *)xr->dest.page->spare); - objtext(annot, " /XYZ null null null]\n"); + objtext(opage, "/Dest["); + objref(opage, (object *)xr->dest.page->spare); + objtext(opage, "/XYZ null null null]"); } else { - objtext(annot, "/A <<\n/Type /Action\n/S /URI\n/URI "); - pdf_string(objtext, annot, xr->dest.url); - objtext(annot, "\n>>\n"); + objtext(opage, "/A<dest.url); + objtext(opage, ">>"); } - objtext(annot, ">>\n"); + objtext(opage, ">>\n"); } objtext(opage, "]\n"); -- cgit v1.1