DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Adding colors and modifying headers in PDF output – XMetaL 12 Enterprise Edition

  • Consigliere

    Adding colors and modifying headers in PDF output – XMetaL 12 Enterprise Edition

    Participants 1
    Replies 0
    Last Activity 5 years, 6 months ago


    I've once again ran into a problem while trying to modify my PDF output. We're trying to modify the PDF output in order to make it stand out and really look like our documentation. So our company standards have very strict guidelines for headers, which I'm trying to figure out how to reach:

    -The headers need to have two parts, with their proportions being 2:1
    -The header parts need to be different shades of blue
    -The header parts need to have different text: the upper part has the document's title, the lower part has the chapter title, topic title, and so on
    -The text needs to be centered, as opposed to being near the edges

    So my question is: Is this even possible? I know that simply adding a background color, one way or another, should be possible, but dividing headers into two parts sounds difficult. Here's a very crude and basic mock-up of the header style that's expected from me: [img]http://i.imgur.com/OM9xiAj.png[/img]

    [s]For the background color problem, I've brainstormed a few solutions. The most obvious one would be modifying the files and adding a value for the background color, as if I was trying to change the font color or something. I tried googling it, and I ran into [url=http://documentation.easydita.com/original/more-resources/publishing-configurations/dita-open-toolkit-pdf-output-customization/build-a-plugin/easydita-pdf-customizations/adding-a-custom-header-and-footer/adding-a-header/adding-a-background-color/]EasyDITA's instructions for it[/url], which I couldn't get working. I must have made a critical mistake somewhere, since even XMetaL was giving me error messages upon trying to output the file.

    After this, I tried thinking outside of the box, which led me to looking into adding a background image. Lo and behold, someone on the [url=https://groups.yahoo.com/neo/groups/dita-users/conversations/topics/40792]DITA Users Group on Yahoo[/url] had actually treaded these steps before me. But again, I couldn't get the output to work. I am guessing it's because I was referring to a wrong file location, or perhaps even editing the wrong files.[/s]

    I know that both of these should be possible, as Jarno Elovirta's PDF Plugin Generator supports background color for practically everything BUT headers/footers. As for background images, even Leigh White's DITA for Print talks about adding an image to the header, so clearly it must be possible.

    So to sum up:
    [s]1.) How should I go about adding the background color? I feel that even if it's not possible to divide the header into two like that, I still need to at least add the color to make it look a bit better. Am I just trying to re-invent the wheel by considering the background image solution? [/s]

    2.) Is there any way to divide the header information into two like that? “Subheaders” or any concrete divisions aside, even just having the text on different lines would be enough, because then I could just align the text with the background image should worst come to worst.

    EDIT: I managed to find out how to change the background color of headers, so that's a non-problem. If anyone else was wondering, it's defined in cfg/fo/attrs/layout-masters-attr.xsl. If you're using the PDF Plugin Generator, then you'll need to add in the variable #ffffff inside it and bob's your uncle.

    My second problem still stands, however. This only solved the color part, I still need to figure out how to divide the header contents into two lines. Any pointers would be appreciated!


  • You must be logged in to reply to this topic.

Lost Your Password?