Pages: 1
Print
Author Topic: Adding colors and modifying headers in PDF output - XMetaL 12 Enterprise Edition  (Read 356 times)
Consigliere
Member

Posts: 3


« on: July 18, 2017, 06:19:19 AM »

Hello,

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:

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 EasyDITA's instructions for it, 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 DITA Users Group on Yahoo 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.


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:
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?

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 <xsl:attribute-set name="region-before". So just copy that from e.g PDF2, and add <xsl:attribute name="background-color">#ffffff</xsl:attribute> 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!
« Last Edit: July 20, 2017, 05:51:57 AM by Consigliere » Logged
Pages: 1
Print
Jump to:  

email us