CSS-based PDF: Don't need the cover and TOC pages

mdslup
Posts: 46

CSS-based PDF: Don't need the cover and TOC pages

Thu Aug 09, 2018 3:26 am

Part of my job is creating procedural documents (between 2-6 pages). These are designed to be printed and used by a technician without access to power or internet.

Oftentimes, the procedure I create is just a single topic file...I don't even need a map.

I notice that the CSS-based PDF transformation scenario applies only to maps. However, forcing something into a map just for the sake of having a map feels wrong. Additionally, the scenario generates a title page and table of contents. I always delete these from my PDF before printing it for a technician. However, doing this causes the pages of my cross-references to be incorrect ("Refer to step 9 on page 3").

Is there a way to SKIP the cover page and TOC?
Costin
Posts: 387

Re: CSS-based PDF: Don't need the cover and TOC pages

Thu Aug 09, 2018 12:13 pm

Hello,

I'll add an improvement request in our internal issue/improvement tracking system so that our developers will analyze the possibility to add a predefined PDF based on CSS transformation also for separate topics, without a DITA Map context.
We will update this thread when / if this functionality will get implemented.

Now for your second problem, regarding the removal of the front page and table of contents from the PDF output.

Which of the two CSS-based transformation scenarios are you using? Is it DITA Map PDF - based on CSS and HTML5 or is it the deprecated DITA Map PDF - based on CSS (WYSIWYG)?

For the first case, you could add some rules in your customization CSS to hide the front page and the TOC from the resulted PDF.
They should look like:

Code: Select all

*[class~="front-page/front-page"] {
    display: none;
}

*[class~="toc/toc"]{
    display: none !important;
}

If it's the deprecate WYSIWYG scenario (without HTML5) that you're using instead, the CSS rules should look like:

Code: Select all

*[class ~= 'map/map'] > map {
    display:none !important;
}
*[class ~= 'map/map'] > front-page{
    display:none !important;
}


Even so however, there would still be a blank page before the document content.
If you expressly need to remove also the blank page, this could also be done but it's a bit complicates as you'll have to use an XSLT template of your own either as an extension inside of a publishing template (for the CSS and HTML5 based scenario), or by modifying the out-of-the-box XSL stylesheets from the oXygen installation (for the WYSIWYG scenario based on CSS only). Modifying the files in the oXygen installation is always discouraged and should be performed with caution, only after you create a backup of them.

For more information on how the template should look and how to use it to remove the blank page left at the beginning of the PDF after removing the front page and table of contents, see this forum thread.

We are currently evaluating the possibility to add a (a couple of) transformation scenario parameter(s) to control the TOC/front-page generation in the future, in order to make this even easier. I just added your vote for it.

I hope this helps.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
mdslup
Posts: 46

Re: CSS-based PDF: Don't need the cover and TOC pages

Mon Aug 13, 2018 11:16 pm

Thanks Costin. I couldn't make the XSL solution work, but I suspect it might be that I'm using the jumping off points wrong. I'll keep working on it.

More importantly, I was at least able to fix my links by resetting the "page" target-counter in my CSS file. I still have to remove the blank page manually (ie, in Adobe), but at least the page numbers are correct.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest