From e4d36ce68e0467ac4702f717386934a44970f4e5 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 19 Mar 2014 19:04:50 +0000 Subject: Add routine to clean pdf content streams for pages. New routine to filter the content streams for pages, xobjects, type3 charprocs, patterns etc. The filtered streams are guaranteed to be properly matched with q/Q's, and to not have changed the top level ctm. Additionally we remove (some) repeated settings of colors etc. This filtering can be extended to be smarter later. The idea of this is to both repair after editing, and to leave the streams in a form that can be easily appended to. This is preparatory to work on Bates numbering and Watermarking. Currently the streams produced are uncompressed. --- source/pdf/pdf-annot.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/pdf/pdf-annot.c') diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index e9702125..1fcbbcf4 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -66,6 +66,8 @@ pdf_parse_link_dest(pdf_document *doc, fz_link_kind kind, pdf_obj *dest) ld.ld.gotor.dest = NULL; dest = resolve_dest(doc, dest, kind); + if (dest == NULL) + fz_throw(doc->ctx, FZ_ERROR_GENERIC, "Undefined link_dest"); if (pdf_is_name(dest)) { -- cgit v1.2.3