Missing header image on some pages
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Missing header image on some pages
Hi,
Our headers include our company logo in the top right corner of our PDF transformations. For some reason, on some of the pages, the logo is missing from the header. There doesn't appear to be particular pattern for the pages missing the logo, but when it does happen, it seems to be on a page that starts with a new chapter. There are no issues with the maptitle.
The customised CSS used for the headers in the body of the document is below:
Any ideas why this could be occurring and how it can be solved?
Thanks.
Our headers include our company logo in the top right corner of our PDF transformations. For some reason, on some of the pages, the logo is missing from the header. There doesn't appear to be particular pattern for the pages missing the logo, but when it does happen, it seems to be on a page that starts with a new chapter. There are no issues with the maptitle.
The customised CSS used for the headers in the body of the document is below:
Code: Select all
@page :left:right{
padding-top: 4pt;
@top-right {
content: '\A0\A0\A0';
background-image: url('Logo Inverted CMYK resized.png') !important;
background-repeat:no-repeat;
background-position:100% 50%;
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
@top-center {
content: string(maptitle)!important;
color: black;
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
@top-left{
content: " ";
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
}
Thanks.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Missing header image on some pages
Hi dbutch,
Besides the general @page selector that you are already using in the CSS, you should also add the @page chapter:left:right:first selector into your customization CSS and use the same properties on it.
Like:
I tested this on the "flowers" sample DITA Map from the oXygen sample project and the logo is displayed correctly on all of the matched pages.
Regards,
Costin
Besides the general @page selector that you are already using in the CSS, you should also add the @page chapter:left:right:first selector into your customization CSS and use the same properties on it.
Like:
Code: Select all
@page chapter:left:right:first{
padding-top: 4pt;
@top-right {
content: '\A0\A0\A0';
background-image: url('oxygen.jpg') !important;
background-repeat:no-repeat;
background-position:100% 50%;
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
@top-center {
content: string(maptitle)!important;
color: black;
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
@top-left{
content: " ";
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
}
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: Missing header image on some pages
Hi Costin,
Thanks for your response and for highlighting the need to include chapter.
For reference, I ended up with the following CSS which appears to work:
For some reason (they were previously outputting as expected) I then had to also update the page selectors for wide pages to:
and also the TOC/tablelist/figurelist page selectors to:
All appears to be outputting as planned, other than a topic in the frontmatter booklists, which contains some revision details - this has no header or footer at all. Any suggestions how I can apply the same header/footer style to all content within frontmatter?
Many thanks.
Thanks for your response and for highlighting the need to include chapter.
For reference, I ended up with the following CSS which appears to work:
Code: Select all
@page :left:right, chapter:first:left:right {
@top-right{
content: '\A0\A0\A0';
background-image: url('Logo Inverted CMYK resized.png') !important;
background-repeat:no-repeat;
background-position:100% 50%;
border-bottom: 0.75pt solid red;
vertical-align: bottom;
}
Code: Select all
@page wide-page, chapter:left:right
Code: Select all
@page :first:left:right, table-of-contents:first:left:right {
Many thanks.
-
- Posts: 41
- Joined: Wed Aug 14, 2019 9:16 am
Re: Missing header image on some pages
Further to the above, are there any recommended methods to troubleshoot header/footer issues with DITA PDF processing? I have previously used this: https://www.oxygenxml.com/doc/versions/ ... ng_the_css for troubleshooting CSS for general issues, but would like to understand if there is a better method for troubleshooting page related issues.
Thanks.
Thanks.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Missing header image on some pages
Hi,
In order to style the frontmatter / backmatter, you should also add the "matter-page" selector.
The "Debugging the CSS" section you already found is the best reference you should use when you need to identify the right selectors to customize the output. I just want to make you aware that you could find that section also in the more specific DITA-OT CSS Publishing to PDF Plugin User-Guide.
If you use your internet browser's CSS inspector, as advised in the Debugging CSS section, you should be able to see that for the 1st article that immediately follows the TOC (corresponding to the beginning of the Bookmap's front-matter), there is a CSS rule:
From the declarations in that rule, it becomes pretty clear that there is a dedicated named-page (page: matter-page;) that sets the style for the topics in the frontmatter.
Given this, the selector in your customization CSS should become:
@page :left:right, chapter:first:left:right, wide-page, chapter:left:right, table-of-contents:first:left:right, matter-page{
Besides the "Debugging the CSS" section that you are already aware of, there is also the "Default Page Definitions" section in the User-Guide, that mentions all the default dedicated named-pages. It might worth taking a look over it as well, as ti could help you in identifying which page selectors you could use to apply styling through the customization CSS.
I hope this helps.
Regards,
Costin
In order to style the frontmatter / backmatter, you should also add the "matter-page" selector.
The "Debugging the CSS" section you already found is the best reference you should use when you need to identify the right selectors to customize the output. I just want to make you aware that you could find that section also in the more specific DITA-OT CSS Publishing to PDF Plugin User-Guide.
If you use your internet browser's CSS inspector, as advised in the Debugging CSS section, you should be able to see that for the 1st article that immediately follows the TOC (corresponding to the beginning of the Bookmap's front-matter), there is a CSS rule:
Code: Select all
[class~="map/map"] > [class~="topic/topic"]:not([is-chapter]) {
page: matter-page;
page-break-before: always;
}
Given this, the selector in your customization CSS should become:
@page :left:right, chapter:first:left:right, wide-page, chapter:left:right, table-of-contents:first:left:right, matter-page{
Besides the "Debugging the CSS" section that you are already aware of, there is also the "Default Page Definitions" section in the User-Guide, that mentions all the default dedicated named-pages. It might worth taking a look over it as well, as ti could help you in identifying which page selectors you could use to apply styling through the customization CSS.
I hope this helps.
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service