Hi,
I am creating an application that creates a report using a template page for
each and then positions graphics on each page.
To allow me to use vector based graphics, they are each imported as PDFs:
try (PDPageContentStream contents = new PDPageContentStream(doc, currentPage,
AppendMode.APPEND, true);
PDDocument imageDoc = PDDocument.load(pdfGraph);) {
LayerUtility layerUtility = new LayerUtility(doc);
PDFormXObject form = layerUtility.importPageAsForm(imageDoc, 0);
contents.saveGraphicsState();
Matrix matrix = Matrix.getTranslateInstance(rect.getLowerLeftX(),
rect.getLowerLeftY());
contents.transform(matrix);
contents.drawForm(form);
contents.restoreGraphicsState();
}
Now, this seems to work fine. However, these is one issue ... I would like to
have the background of the imported graphic be transparent. At present it comes
in with a white background.
Is there anyway to set a transparent background?
Thanks for any help
Steve