summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2006-05-14 23:00:13 +0000
committerBen Harris <bjh21@bjh21.me.uk>2006-05-14 23:00:13 +0000
commit7e3fe1d70c5d32762151f5d6c1369800ceefbe93 (patch)
tree2a97b5bdcb0a8abd4c41197a03dd0411f94d6c50
parent3dd6b022f7874eb5576b6938a4406703908ebb88 (diff)
downloadhalibut-7e3fe1d70c5d32762151f5d6c1369800ceefbe93.zip
halibut-7e3fe1d70c5d32762151f5d6c1369800ceefbe93.tar.gz
halibut-7e3fe1d70c5d32762151f5d6c1369800ceefbe93.tar.bz2
halibut-7e3fe1d70c5d32762151f5d6c1369800ceefbe93.tar.xz
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]
-rw-r--r--bk_pdf.c25
1 files 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, "<</Subtype/Link\n/Rect[");
sprintf(buf, "%g %g %g %g",
xr->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<</S/URI/URI");
+ pdf_string(objtext, opage, xr->dest.url);
+ objtext(opage, ">>");
}
- objtext(annot, ">>\n");
+ objtext(opage, ">>\n");
}
objtext(opage, "]\n");