How do I insert an image as the last page?

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
jmichaels
Posts: 9
Joined: Thu Aug 26, 2021 10:16 pm

How do I insert an image as the last page?

Post by jmichaels »

I have an image with some branding and boilerplate legal. The page is styled, so inserting it is the easiest thing for me. I have this in my css:

Code: Select all

@page back-page {
    background-image:url("resources/images/back-page.png");
    background-position:center;
    background-repeat:no-repeat;
    margin-top:7.5in;
}
Is that right? I can't find anything about the back-page @page rule. DO I have to declare the page first?
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: How do I insert an image as the last page?

Post by julien_lacour »

Hello,

You can't find anything about the back-page @page rule because the page is not declared by default.
But you already started to declare one which I modified a little to obtain the desired result.
Another thing you need to do is to add a rule indicating where this page should be used (at the end of the document in your case):

Code: Select all

@page back-page {
  background-image: url("resources/images/back-page.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;

  @top-right {
    content: none;
  }
  @top-left {
    content: none;
  }
}

*[class ~= "map/map"]:after {
  page: back-page;
  page-break-before: always;
  display: block;
  content: "\2002";
}
Regards,
Julien
Post Reply