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

Watermarks #27

Open
ohartl opened this issue Dec 20, 2018 · 11 comments
Open

Watermarks #27

ohartl opened this issue Dec 20, 2018 · 11 comments
Labels
enhancement New feature or request pdf-engines

Comments

@ohartl
Copy link

ohartl commented Dec 20, 2018

Expected Behavior

Ability to overlay the .pdf with a watermark per page on the same position.

Context

I don't know this is something that should be part of the project as something like that could be done with other tools, but I'd like to suggest this and have an opinion from the maintainers.

Thanks for the nice tool!

@gulien
Copy link
Collaborator

gulien commented Dec 21, 2018

This is a cool option to add in my opinion 😄

@gulien gulien added the enhancement New feature or request label Dec 21, 2018
@gulien
Copy link
Collaborator

gulien commented Dec 21, 2018

So, after looking at possible solutions:

  • pdfcpu: does not work great (watermarks are sometimes hidden by the content)
  • bimg: I've failed to install the required dependency libvips (there is a discussion about it here)

Do you know a better tool for the job?

@ohartl
Copy link
Author

ohartl commented Dec 23, 2018

No sorry I don't know any libraries in go for that purpose.

@skys215
Copy link

skys215 commented Sep 28, 2020

I tried to convert a docx with a watermark(50% of opacity) to pdf, but the watermark shows over the pdf content, it doesn't show under the content with transparency.

@gulien
Copy link
Collaborator

gulien commented Sep 28, 2020

Hello @skys215

I think it is a LibreOffice limitation. If you try to convert your docx with LibreOffice, you will obtain the same result.

@skys215
Copy link

skys215 commented Sep 28, 2020

Ok, let me have a try.

@skys215
Copy link

skys215 commented Sep 28, 2020

Yeah, it's LibreOffice's limitation.

@nvelychenko
Copy link

I found such library written in go maybe it can help https://github.com/ajaxray/markpdf

@gulien
Copy link
Collaborator

gulien commented Jan 18, 2022

@nvelychenko looks great but its license might conflict with some Gotenberg usage alas..

@Mistes974
Copy link

If you are using an html template to generate your pdf, here is a working solution:

body {
    position: relative;
}

body:before {
    content: 'Draft';
    position: fixed;
    inset: 0;
    font-size: 180px;
    font-weight: bold;
    display: grid;
    justify-content: center;
    align-content: center;
    opacity: 0.1;
    transform: rotate(-45deg);
}

@simontol
Copy link

We adopted pdftk for pdf watermarking. AFAIK is the faster option out there.
Hope it will get integrated in gotenberg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pdf-engines
Projects
None yet
Development

No branches or pull requests

6 participants