Page 1 of 1

questions about DITA Map PDF - based on HTML5 & CSS

Posted: Thu Sep 16, 2021 3:41 pm
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
image.png (209.82 KiB) Viewed 868 times
3. The header of the contents page shows ⅲ, how can I delete it?
 
image.png
image.png (46.67 KiB) Viewed 868 times
Thanks in advance!

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

Posted: Fri Sep 17, 2021 10:36 am
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

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

Posted: Sat Sep 18, 2021 5:24 am
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!

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

Posted: Mon Sep 20, 2021 10:30 am
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