questions about DITA Map PDF - based on HTML5 & CSS

Post here questions and problems related to editing and publishing DITA content.
alison
Posts: 15
Joined: Thu Sep 16, 2021 6:05 am

questions about DITA Map PDF - based on HTML5 & CSS

Post by alison »

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
3. The header of the contents page shows ⅲ, how can I delete it?
 
image.png
Thanks in advance!
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 681
Joined: Wed Oct 16, 2019 3:47 pm

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

Post by julien_lacour »

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: 15
Joined: Thu Sep 16, 2021 6:05 am

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

Post by alison »

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: 681
Joined: Wed Oct 16, 2019 3:47 pm

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

Post by julien_lacour »

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