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

Background Image in Header #356

Closed
abradshaw opened this issue Nov 12, 2015 · 7 comments
Closed

Background Image in Header #356

abradshaw opened this issue Nov 12, 2015 · 7 comments
Assignees
Milestone

Comments

@abradshaw
Copy link

Id like to request the ability to place an image in the header of pages. Maybe even a different ones for left/right pages

@DavidGamba
Copy link
Contributor

Haven't tried it on the header, but it works on the footer:

footer:
   height: 0.5in
   border_color: #000000
   recto: # odd pages
      content:
         left: '{page-number}'
         center: '©2015 {company} v{docversion}, {docdate}'
         right: 'image:common/logo.png[width=150]'
   verso: # even pages
      content:
         left: 'image:common/logo.png[width=150]'
         center: '©2015 {company} v{docversion}, {docdate}'
         right: '{page-number}'

Just make sure your imagesdir and base_dir is set.

@abradshaw
Copy link
Author

Thanks David, you are right that does work and is even documented here https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#running-header-footer

I described my issue wrong, what I actually want is to be able to place a background image across the whole width of the header and place text on top of it

So I guess my issue should read "Background Image in Header" [just edited it to say that]

Thanks for the info though

@abradshaw abradshaw changed the title Image in Header Background Image in Header Nov 13, 2015
@mojavelinux
Copy link
Member

This certainly seems like a reasonable request. We should probably support a background image or background color.

@mojavelinux mojavelinux added this to the v1.5.1 milestone Mar 20, 2016
@mojavelinux
Copy link
Member

As it turns out, background color is already supported. We just need support for a background image then.

@mojavelinux mojavelinux modified the milestones: v1.5.1, 1.5.0.beta.6 Sep 18, 2019
@mojavelinux mojavelinux modified the milestones: 1.5.0.beta.6, v1.5.0 Oct 6, 2019
@mojavelinux mojavelinux self-assigned this Dec 27, 2019
@mojavelinux
Copy link
Member

Currently, if a background color is specified, it will span the width of the page. Should we use this same behavior for a background image?

The fit attribute can be used in this context to adjust the size of the image. However, if the background bleeds outside the bounds of the running content, it will not be cropped. I don't know how to work around this. So you'll need to size your images accordingly.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Dec 27, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Dec 30, 2019
@mojavelinux mojavelinux modified the milestones: v1.5.0, v1.5.0.rc.1 Jan 1, 2020
@abradshaw
Copy link
Author

Many thanks @mojavelinux

@mojavelinux
Copy link
Member

You're welcome!

Keep an eye out for #994 in 2.0.0, which will slightly change how this works. Once that's merged, you'll be able to control whether the background image spans the width of the page or the content column.

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

3 participants