summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorFabio D'Urso <fabiodurso@hotmail.it>2012-04-24 18:10:15 +0200
committerAlbert Astals Cid <aacid@kde.org>2012-04-26 22:25:25 +0200
commit2ecf3b2e49a4c35e995d25016b810592260edfeb (patch)
tree3df0f5ed378a3162753d545aa8a5fa8d5f044a7e /utils
parentcf7a20adbd15f901d414ce06825459c33eeef3f5 (diff)
Refactoring of XRef table write support (in preparation for XRef stream write support)
- Trailer dictionary creation now lives in its own function "createTrailerDict" (that will be used by XRef stream creation too) - writeXRefTableTrailer (WAS writeTrailer) now takes care of writing the XRef table too (previously it was demanded to the caller)
Diffstat (limited to 'utils')
-rw-r--r--utils/pdfunite.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index 93850a4e..212f89be 100644
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -6,6 +6,7 @@
//
// Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2012 Arseny Solokha <asolokha@gmx.com>
+// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
//
//========================================================================
#include <PDFDoc.h>
@@ -161,13 +162,14 @@ int main (int argc, char *argv[])
objectsCount++;
}
Guint uxrefOffset = outStr->getPos();
- yRef->writeToFile(outStr, gFalse /* do not write unnecessary entries */ );
-
Ref ref;
ref.num = rootNum;
ref.gen = 0;
- PDFDoc::writeTrailer(uxrefOffset, objectsCount, outStr, (GBool) gFalse, 0,
- &ref, yRef, fileName, outStr->getPos());
+ Dict *trailerDict = PDFDoc::createTrailerDict(objectsCount, gFalse, 0, &ref, yRef,
+ fileName, outStr->getPos());
+ PDFDoc::writeXRefTableTrailer(trailerDict, yRef, gFalse /* do not write unnecessary entries */,
+ uxrefOffset, outStr, yRef);
+ delete trailerDict;
outStr->close();
fclose(f);