CSS/HTML PDF - Removing front matter leaves artifacts

mdslup
Posts: 121
Joined: Tue Mar 06, 2018 1:34 am

CSS/HTML PDF - Removing front matter leaves artifacts

Post by mdslup » 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?

Costin
Posts: 600
Joined: Mon Dec 05, 2011 6:04 pm

Re: CSS/HTML PDF - Removing front matter leaves artifacts

Post by Costin » Fri Sep 06, 2019 5:01 pm

Hi,

Please note that starting with the version 21, a dedicated transformation parameter was implemented in the DITA Map PDF - based on HTML5 and CSS scenario.
The parameter (called "hide.frontpage.toc.index.glossary") may be enabled to obtain the desired results, removing the front page and TOC without any leading blank pages or bookmarks in the PDF output.
Just edit the transformation scenario, look for the parameter in the "Parameters" tab and set its value to "yes".

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

mdslup
Posts: 121
Joined: Tue Mar 06, 2018 1:34 am

Re: CSS/HTML PDF - Removing front matter leaves artifacts

Post by mdslup » Fri Sep 06, 2019 11:29 pm

Yes! Thanks.

Post Reply