questions about DITA Map PDF - based on HTML5 & CSS

alison
Posts: 6
Joined: Thu Sep 16, 2021 6:05 am

questions about DITA Map PDF - based on HTML5 & CSS

Post by alison » Thu Sep 16, 2021 3:41 pm

Hi There:

I have some questions about DITA Map PDF - based on HTML5 & CSS.

1. When publishing a PDF document, can I set some topics to display on a separate page instead of following the text on the previous page?
2. When publishing a PDF document, there was an extra line at the end of the content. When I watch the Webinar, I notice that the same problem. May I know should I solve this problem?
image.png
image.png (209.82 KiB) Viewed 185 times
3. The header of the contents page shows ⅲ, how can I delete it?
 
image.png
image.png (46.67 KiB) Viewed 185 times
Thanks in advance!

julien_lacour
Posts: 205
Joined: Wed Oct 16, 2019 3:47 pm

Re: questions about DITA Map PDF - based on HTML5 & CSS

Post by julien_lacour » Fri Sep 17, 2021 10:36 am

Hello,
  1. Sure, you just need to add the attribute @outputclass="page-break-before" on the concerned topics. You can find more information here.
  2. This is not a problem, the "Index" topic is automatically generated when your DITA documents contain <indexterm> elements. If you want to hide it, simply add the following rules to your custom CSS style-sheet

    Code: Select all

    *[class ~= "map/topicref"][is-index],
    *[class ~= "index/groups"] {
      display: none;
      bookmark-level: 0;
    }
    
  3. You can remove the page number by altering the @page table-of-contents rules, like this:

    Code: Select all

    @page table-of-contents:left {
      @top-left {
        content: string(toc-header);
      }
    }
    @page table-of-contents:right {
      @top-right {
        content: string(toc-header);
      }
    }
    
    If you want to customize it differently, you will find more information here.
Regards,
Julien

alison
Posts: 6
Joined: Thu Sep 16, 2021 6:05 am

Re: questions about DITA Map PDF - based on HTML5 & CSS

Post by alison » Sat Sep 18, 2021 5:24 am

Hi Julien,

Thank you very much for your suggestion, it is very useful to me!

Now I have solved question 2 and question 3.

For question 1, It would be great if you can get further suggestions.
I want to force a page break for a specific topic, in the link you provided I got some suggestions, that is to mark the topic with an @outputclass attribute, as shown below:
<topic outputclass="page-break-before" ... >

I would like to know whether it is directly input the above code into the CSS file? Or if possible, could you suggest me the complete calling code?

Thanks in advance!

julien_lacour
Posts: 205
Joined: Wed Oct 16, 2019 3:47 pm

Re: questions about DITA Map PDF - based on HTML5 & CSS

Post by julien_lacour » Mon Sep 20, 2021 10:30 am

Hello,

When a DITA topic has the @outputclass="page-break-before" attribute set, it automatically triggers new CSS rules in the default style-sheets, you don't need to add anything else in your customization. This is the advantage of this method, they work only based on an attribute value.

Regards,
Julien

Post Reply