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

Allow a watermark image to be specified #727

Closed
mojavelinux opened this issue Jan 8, 2017 · 5 comments
Closed

Allow a watermark image to be specified #727

mojavelinux opened this issue Jan 8, 2017 · 5 comments
Assignees
Milestone

Comments

@mojavelinux
Copy link
Member

A watermark image goes above the text, whereas a background image goes below the text. We could either introduce a dedicated setting for specifying a watermark, or we could add an option to the background image. However, since there's a chance the design will call for both, the separate option is probably the right approach.

@mojavelinux
Copy link
Member Author

The tricky part is that Prawn does not provide a hook when leaving a page. But we can simply iterate all the pages at the end and apply the watermark as a stamp.

The proposed name for the property is page-foreground-image. (I'm also open to page-watermark-image).

The image will be applied on every page except for imported pages, which includes the title page. The reason we don't touch imported pages is that it can cause the PDF to become corrupt.

@mojavelinux mojavelinux modified the milestones: v1.5.0, 1.5.0.beta.6 Sep 18, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 18, 2019
@mojavelinux
Copy link
Member Author

Before we merge, which attribute do we like better?

  • page-foreground-image
  • page-watermark-image

I'm leaning towards the first since it's a) parallel with "background" and b) might not always be a watermark.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 18, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 18, 2019
@mojavelinux
Copy link
Member Author

Watermark is pretty poorly defined (and its meaning been distorted). So I think we should stick with page-foreground-image.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 19, 2019
…e using the page-foreground-image attribute or theme key
@BrianEmberling
Copy link

page-foreground-image and :page-foreground-image: seem to work for me, but I cannot get [opacity=50%] to work with either form (using .png or .svg image). The final .pdf always renders the watermark with 100% opacity blocking all text behind it. Any hint how to get this to work?

@mojavelinux
Copy link
Member Author

Asciidoctor PDF doesn't apply opacity to the image. The opacity has to be in the image itself.

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

No branches or pull requests

2 participants