[poppler] poppler/PDFDoc.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Nov 13 03:26:59 PST 2014
poppler/PDFDoc.cc | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
New commits:
commit 07aa6f4030418883d8d45a8dfa3d80d2dadca4e7
Author: Thomas Freitag <Thomas.Freitag at alfa.de>
Date: Thu Nov 13 12:26:25 2014 +0100
write correct size in trailer dict
Bug #86063
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 04237fc..ec8d3df 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -707,7 +707,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
annotsObj.free();
}
yRef->markUnencrypted();
- Guint objectsCount = writePageObjects(outStr, yRef, 0);
+ writePageObjects(outStr, yRef, 0);
yRef->add(rootNum,0,outStr->getPos(),gTrue);
outStr->printf("%d 0 obj\n", rootNum);
@@ -728,7 +728,6 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
catObj.free();
pagesObj.free();
outStr->printf(">>\nendobj\n");
- objectsCount++;
yRef->add(rootNum + 1,0,outStr->getPos(),gTrue);
outStr->printf("%d 0 obj\n", rootNum + 1);
@@ -740,7 +739,6 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
}
outStr->printf(">>\n");
outStr->printf("endobj\n");
- objectsCount++;
yRef->add(rootNum + 2,0,outStr->getPos(),gTrue);
outStr->printf("%d 0 obj\n", rootNum + 2);
@@ -758,14 +756,13 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
value.free();
}
outStr->printf(" >>\nendobj\n");
- objectsCount++;
page.free();
Goffset uxrefOffset = outStr->getPos();
Ref ref;
ref.num = rootNum;
ref.gen = 0;
- Dict *trailerDict = createTrailerDict(objectsCount, gFalse, 0, &ref, getXRef(),
+ Dict *trailerDict = createTrailerDict(rootNum + 3, gFalse, 0, &ref, getXRef(),
name->getCString(), uxrefOffset);
writeXRefTableTrailer(trailerDict, yRef, gFalse /* do not write unnecessary entries */,
uxrefOffset, outStr, getXRef());
More information about the poppler
mailing list