Issue with @top-right formatting on @page :first - Chemistry 24

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
axhxu
Posts: 45
Joined: Thu Aug 27, 2015 9:28 pm

Issue with @top-right formatting on @page :first - Chemistry 24

Post by axhxu »

I am trying to customize the header of the first page of a pdf document.

Code: Select all

 /*TITLE PAGE */
@page :first{
    /*Header */
   @top-left{
        content:oxy_xpath('//*[contains(@class, "front-page/front-page")]/*/*[contains(@class, "topic/othermeta")][@name="bulletinservice"][1]/@content');
        border-bottom: 2px solid grey;
        vertical-align: bottom;
        color:black;
        font-weight:900;
        font-size:12pt;
        background-image: url("img/agfalogo_bulletin.gif");
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position:left center;
    }
    @top-center{
        content:" ";
        border-bottom: 2px solid grey;
        vertical-align: bottom;
    }
    @top-right{
        content:oxy_xpath('//*[contains(@class, "front-page/front-page")]/*/*[contains(@class, "topic/othermeta")][@name="productname"][1]/@content') "\A" oxy_xpath('//*[contains(@class, "front-page/front-page")]/*/*[contains(@class, "topic/othermeta")][@name="releasenumber"][1]/@content');
        border-bottom: 2px solid grey;
        vertical-align: bottom;
        color:black;
        font-weight:900;
        font-size:12pt;
    }
    ....
}
But the top right header is always displayed blank.

I can move the code in the top right to the top-center and it works, so I dont think it is a coding issue. The top-left header works.

I have the same code also being applied the the @page :right, :left. and it works.
julien_lacour
Posts: 350
Joined: Wed Oct 16, 2019 3:47 pm

Re: Issue with @top-right formatting on @page :first - Chemistry 24

Post by julien_lacour »

Hello,

You need to override the default rules in order to make the content appear:

Code: Select all

/*TITLE PAGE */
@page front-page:first, table-of-contents:left:right:first, matter-page:left:right:first, chapter:left:right:first, index:first {
  /*Header */
  @top-left {
    content: oxy_xpath('//*[contains(@class, "front-page/front-page")]//*[contains(@class, "topic/othermeta")][@name="bulletinservice"][1]/@content');
    border-bottom: 2px solid grey;
    vertical-align: bottom;
    color: black;
    font-weight: 900;
    font-size: 12pt;
    background-image: url("img/agfalogo_bulletin.gif");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: left center;
  }
  @top-center {
    content: " ";
    border-bottom: 2px solid grey;
    vertical-align: bottom;
  }
  @top-right {
    content: oxy_xpath('//*[contains(@class, "front-page/front-page")]//*[contains(@class, "topic/othermeta")][@name="productname"][1]/@content') "\A"
    oxy_xpath('//*[contains(@class, "front-page/front-page")]//*[contains(@class, "topic/othermeta")][@name="releasenumber"][1]/@content');
    border-bottom: 2px solid grey;
    vertical-align: bottom;
    color: black;
    font-weight: 900;
    font-size: 12pt;
  }
}
You can find more information in the Default Page Definitions topic from our user-guide.

Regards,
Julien
axhxu
Posts: 45
Joined: Thu Aug 27, 2015 9:28 pm

Re: Issue with @top-right formatting on @page :first - Chemistry 24

Post by axhxu »

Thanks that worked.
Post Reply