CSS/HTML PDF - Removing front matter leaves artifacts
Posted: Fri Sep 06, 2019 4:27 am
Oxygen 21.1 2019061404
I want to create PDFs that begin with the content immediately, without any front matter. So I want to remove the cover page and Table of Contents.
Starting with a duplicate of the PDF HTML5&CSS scenario. I use a publishing template to connect a blank CSS file to it. I generate the PDF, and it looks like exactly like the default scenario...makes sense, because the CSS is blank.
Now, I want to remove the cover page. So I add this rule:
*[class~="front-page/front-page"] {
display: none !important;
}
When I generate the content, the cover page is gone as expected. But there is still a problem: The PDF bookmark of the cover page remains...even though the first page of the generated PDF is the TOC:
https://i.imgur.com/6SvTNqz.jpg
Now, I want to remove the table of contents. So I add this rule:
*[class~="toc/toc"]{
display: none !important;
}
Now, there are 3 problems:
1. The PDF bookmark of the cover page is still there (see previous image).
2. The first page (which used to have the table of contents) is blank: https://i.imgur.com/YiE7zhu.jpg
3. The PDF bookmark that contained the TOC is still present, although it is blank: https://i.imgur.com/mcREEtR.jpg
Any suggestions?
I want to create PDFs that begin with the content immediately, without any front matter. So I want to remove the cover page and Table of Contents.
Starting with a duplicate of the PDF HTML5&CSS scenario. I use a publishing template to connect a blank CSS file to it. I generate the PDF, and it looks like exactly like the default scenario...makes sense, because the CSS is blank.
Now, I want to remove the cover page. So I add this rule:
*[class~="front-page/front-page"] {
display: none !important;
}
When I generate the content, the cover page is gone as expected. But there is still a problem: The PDF bookmark of the cover page remains...even though the first page of the generated PDF is the TOC:
https://i.imgur.com/6SvTNqz.jpg
Now, I want to remove the table of contents. So I add this rule:
*[class~="toc/toc"]{
display: none !important;
}
Now, there are 3 problems:
1. The PDF bookmark of the cover page is still there (see previous image).
2. The first page (which used to have the table of contents) is blank: https://i.imgur.com/YiE7zhu.jpg
3. The PDF bookmark that contained the TOC is still present, although it is blank: https://i.imgur.com/mcREEtR.jpg
Any suggestions?