Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WaterMark to PDF #644

Open
bhaskermca opened this issue Feb 3, 2021 · 2 comments
Open

WaterMark to PDF #644

bhaskermca opened this issue Feb 3, 2021 · 2 comments

Comments

@bhaskermca
Copy link

we have a requirement to Add watermark to PDF before approval of the PDF. Once Its approved water mark should not available.

Is there any scope we can add watermark in HTML ( from left-bottom to right-top ) position we are using headers and footers in existing PDFs ( Multiple Page PDF ) and once it approved we have to remove the watermark from the PDF.

Currently I am thinking of using PDFBox overlay functionality for this purpose, But in this we have to add water mark after PDF created. ( we have changes to PDF's multiple times before approval of the final PDF page.

@danfickle
Copy link
Owner

If you don't need opacity support, you can use a fixed position element with a rotate transform.

If you do need opacity support see this example of using a custom object drawer (since we don't support the opacity property):
#472 (comment)

It seems I forgot to add the builder code, but it would look like:

builder.useFont(new File("target/test/visual-tests/Karla-Bold.ttf"), "Karla", 700, FontStyle.NORMAL, true);
builder.useObjectDrawerFactory(new WatermarkDrawerFactory());

@bhaskermca
Copy link
Author

Thank you, can we make watermark text as non selectable? is there any option for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants