Hi Lucy,

Overlay is for adding something like a watermark to each page in an existing 
document.
To draw existing PDF pages onto a new page, follow our SuperimposePage example.

-- John

> On 11 Feb 2015, at 14:11, Vorpahl,Lucinda <[email protected]> wrote:
> 
> I am hoping someone can help me.
> 
> I have a list of PDDocuments that I want to combine and draw onto 1 
> PDDocument.
> I was able to do this by converting the individual documents to images then 
> drawing the image on the new document but I lost image quality.
> I was looking at the Overlay option but I'm getting the following error:
>       "java.lang.UnsupportedOperationException: Layout pages with COSArray 
> currently not supported."
> 
> I also tried this but nothing was happening.
> 
>       PDPageContentStream contentStream;
>         PDDocument document = new PDDocument();
>         PDPage page = new PDPage();
>         document.addPage(page);
>         AffineTransform transform;
> for (PDDocument pdDocument : pdfDocList) {
>            LayerUtility layerUtility = new LayerUtility(document);
>            PDXObjectForm mountable = 
> layerUtility.importPageAsForm(pdDocument, 0);
>            mountable.getPDStream().addCompression();
>            contentStream = new PDPageContentStream(document, page);
>            contentStream.appendRawCommands("q\n".getBytes("ISO-8859-1"));
> 
>            transform = new AffineTransform();
>            transform.translate(18.0f, 18.0f);
>            contentStream.drawXObject(mountable, transform);
> 
>            contentStream.appendRawCommands("Q\n".getBytes("ISO-8859-1"));
>            contentStream.close();
>       pdDocument.close();
> }
> 
> Any help would be appreciated.
> 
> 
> Thanks,
> Lucy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

Reply via email to