[Poppler-bugs] [Bug 71213] Add new PDFWriter class for writing PDF with printing options

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 25 12:56:42 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=71213

--- Comment #19 from Adrian Johnson <ajohnson at redneon.com> ---
(In reply to comment #18)
>   for (int i = 0; i < (int)pages.size(); i++) {
>-    pageNum = pages[i];
>+    pageNum = pages[i]->getNum();
>+    doc = pages[i]->getDoc();
>     if (pageSet == ALL ||
>         (pageSet == ODD && outputPageNum % 2 == 1) ||
>         (pageSet == EVEN && outputPageNum % 2 == 0)) {
>       Object pageObj;
>       Ref *refPage = doc->getCatalog()->getPageRef(pageNum);
>       doc->getXRef()->fetch(refPage->num, refPage->gen, &pageObj);
>-      markPageObjects(pageObj.getDict(), numberUp > 1 ? gFalse : gTrue);
>+      markPageObjects(doc, pageObj.getDict(), numberUp > 1 ? gFalse : gTrue);
>       if (fontEmbedRequired)
>-        replaceNonEmbeddedFonts(pageObj.getDict(), &pageObj, *refPage);
>+        replaceNonEmbeddedFonts(doc, pageObj.getDict(), &pageObj, *refPage);
>       pageObj.free();
>     }

I don't see how this works. The objects from each document will be mixed
together and overwrite each other. All pages from each document need to be
marked and written separately with an offset applied to the object numbering of
each document to prevent the object numbers from clashing.

I have already updated my patches to include multiple documents but am still
reworking the font embedding patch. I wanted to get it all working before
reposting but I'll go ahead and post what I already have working.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20131125/791a6f62/attachment.html>


More information about the Poppler-bugs mailing list