From 0a6c1ff777aa23c7a5654b313b639e66600883b9 Mon Sep 17 00:00:00 2001 From: Thomas Freitag Date: Wed, 7 May 2014 21:54:46 +0200 Subject: Only add annotations of the current page when splitting Bug #77549 --- utils/pdfunite.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc index 5f67c0ef..b53e4977 100644 --- a/utils/pdfunite.cc +++ b/utils/pdfunite.cc @@ -4,7 +4,7 @@ // // This file is licensed under the GPLv2 or later // -// Copyright (C) 2011-2013 Thomas Freitag +// Copyright (C) 2011-2014 Thomas Freitag // Copyright (C) 2012 Arseny Solokha // Copyright (C) 2012 Fabio D'Urso // Copyright (C) 2012 Albert Astals Cid @@ -12,6 +12,7 @@ // Copyright (C) 2013 Hib Eris // //======================================================================== + #include #include #include "parseargs.h" @@ -129,6 +130,12 @@ int main (int argc, char *argv[]) pages.push_back(page); offsets.push_back(numOffset); docs[i]->markPageObjects(pageDict, yRef, countRef, numOffset); + Object annotsObj; + pageDict->lookupNF("Annots", &annotsObj); + if (!annotsObj.isNull()) { + docs[i]->markAnnotations(&annotsObj, yRef, countRef, numOffset, refPage->num, refPage->num); + annotsObj.free(); + } } objectsCount += docs[i]->writePageObjects(outStr, yRef, numOffset, gTrue); numOffset = yRef->getNumObjects() + 1; -- cgit v1.2.3