Leonard Rosenthol wrote:
Sure it does. iText will copy over any font that is used when it places the pages...

Be that as it may, when using the idiom in the example I referenced in my e-mail, it ain't doin' it.


I would love to know what I'm doing wrong.

Here's a code excerpt. Note that I'm using a PdfWriter, not a PdfCopy. When I try to use PdfCopy, I *still* get the font missing error, with the added bonus of not being able to combine two PDF pages into the same page in the new PDF.

PdfReader mainReader = ...
PdfReader keyFactsReader = ...

/* create a document that will be the composite PDF */
Document document = new Document(mainReader.getPageSize(1));
PdfWriter writer = new PdfCopy(document,
                             new FileOutputStream(combinedPdf));
document.open();
for (int i = 1; i <= mainReader.getNumberOfPages(); i++) {
    document.newPage();
    PdfContentByte cb = writer.getDirectContent();
    PdfImportedPage p = writer.getImportedPage(mainReader, i);
    cb.addTemplate(p, 0, 0);
    if (i == 2) {
        PdfImportedPage kfp = writer.getImportedPage(keyFactsReader, 1);
        cb.addTemplate(kfp, 0, 0);
    }
}
document.close();

For the non-believers among you, I have uploaded the faulty PDF, along with its sources, to the following URLs:

        http://www.galbraiths.org/itext/source1.pdf
        http://www.galbraiths.org/itext/source2.pdf
        http://www.galbraiths.org/itext/composite.pdf

Thanks for any help.

Ben



Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:[EMAIL PROTECTED]>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-629-3700 (voice)





------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to