Hello everyone,

Hope someone can confirm the approach I¹m suggesting or provide a better
alternative. Here are the requirements:

1. Create PDF documents by merging several documents of the following types:
PDF, images (jpg, tiff), text.
2. I don¹t know in advance what type of documents will be merged; could be
all PDFs, all images, all text or any combination of these.
3. For PDFs I must keep the annotations.
4. Each input document will be on its own page(s) in the output PDF.

After reading several posts, it seems like one approach would be to create
the PDF in multiple steps. For instance, if the first input is a jpg, I¹d
use PdfWriter writing to a ByteArrayOutputStream, and as long as the
consecutive input files are all image or text I¹d keep using PdfWriter.
However, If I the next input file is a PDF I would close the partial PDF and
open a new Document; I¹d then use PdfCopy to import the pages from the
partial PDF and add the pages from the input PDF. After that, if the next
file is a text or image, I¹d create a new temporary PDF document for this
image and import it to PdfCopy.

In another scenario, if my first input file is a PDF, I¹d start out by using
PdfCopy and as soon as I encounter a text or image as the next input file,
I¹d create a temporary PDF and the import it.

In most cases the input files to be merged would be of the same type, but
this is not a guarantee, hence the complexity of the problem.

It sounds like a long shot, but I cannot think of a different approach
considering that I¹m a freshman iText user.

Would PdfStamper help me make this process any easier?

I¹ve tried unsuccessfully to add an image directly while using PdfCopy.

Thanks in advance for your help,

David.
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to