Tanmay Sharma created PDFBOX-5765:
-------------------------------------
Summary: Not able to add watermark in PDF using Overlay
Key: PDFBOX-5765
URL: https://issues.apache.org/jira/browse/PDFBOX-5765
Project: PDFBox
Issue Type: Bug
Reporter: Tanmay Sharma
I am trying to add watermark to PDF. I am taking following two files as inputs:
# Original PDF file: To which needs to be added.
# Watermark PDF File: It is one page PDF in which only contains watermark.
I am trying to combine those files in overlay to generate new document
containing watermark in it.
{code:java}
PDDocument watermarkDoc = PDDocument.load(new File(".."));
//Assuming your empty document with watermark image in it.
PDDocument realDoc = PDDocument.load(new File("..."));
Overlay overlay = new Overlay();
overlay.setInputPDF(realDoc);
overlay.setDefaultOverlayPDF(watermarkDoc);
PDDocument document = overlay.overlay(new HashMap<Integer, String>());
document.save("...")); {code}
But when I try to open newly generated document in acrobat, though the
watermark is displayed in the file, but Acrobat is not able to detect it. That
is I am not able to perform any operation like update or delete watermark.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]