<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Add new PDFWriter class for writing PDF with printing options"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=71213#c19">Comment # 19</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Add new PDFWriter class for writing PDF with printing options"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=71213">bug 71213</a>
              from <span class="vcard"><a class="email" href="mailto:ajohnson@redneon.com" title="Adrian Johnson <ajohnson@redneon.com>"> <span class="fn">Adrian Johnson</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=71213#c18">comment #18</a>)
<span class="quote">>   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();
>     }</span >

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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>