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

Setting page-background-image before a page break (<<<)? #1882

Closed
rben01 opened this issue Feb 27, 2021 · 2 comments
Closed

Setting page-background-image before a page break (<<<)? #1882

rben01 opened this issue Feb 27, 2021 · 2 comments

Comments

@rben01
Copy link

rben01 commented Feb 27, 2021

I'm wondering if it's possible to choose a different page-background-image attribute for each page of a PDF. Similarly to how [.landscape] can be applied before a page break, I'm wondering if it's possible to set :page-background-image: before a page break (or even anywhere in the document) so that either all subsequent pages use that background image, or so that all pages use that background image until the next manual page break (I'm not sure which behavior is preferable).

Something like this

= Document Title
:page-background-image: image:default_bg.png[]

// This uses default_bg.png
== Section 1
Text

:page-background-image: image:alt_bg.png[]
<<<

// This uses alt_bg.png
== Section 2
Text
@rben01
Copy link
Author

rben01 commented Feb 28, 2021

On second thought it might be best to add background-image as a general role attribute and then set the role on the page break, like so:

theme.yml

role:
  alt-bg-img:
     background-image: image:alt_bg.png[]

text.adoc

[.alt-bg-img]
<<<

Of course, setting this role on something other than a page break should have no effect.

@mojavelinux
Copy link
Member

I consider this to be mostly a duplicate of #1739. I'd prefer to consolidate the issues. (Despite the fact that possible solutions have been proposed in that issue, this still remains a very difficult feature to implement due to how the converter / PDF generator works).

Although we're considering supporting roles in this converter, I don't think roles are appropriate for setting the background image of the page since it is too specific of a need.

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