Change PDF output

Here should go questions about transforming XML with XSLT and FOP.
chymical
Posts: 16
Joined: Wed Nov 24, 2010 12:37 pm

Change PDF output

Post by chymical » Wed Nov 24, 2010 3:34 pm

I have just started using the DITA PDF output in Oxygen. I want to know how to make changes to the paragraph styles that appear in the PDF. For example, the Note style is truly awful, with a graphic on the left and then a very large empty space, with the text squashed over on the right. It looks like a two column table in old-fashioned lingo. Can you please point me to where styles and page layout are specified?

Radu
Posts: 6184
Joined: Fri Jul 09, 2004 5:18 pm

Re: Change PDF output

Post by Radu » Wed Nov 24, 2010 4:08 pm

Hi,

Oxygen uses the DITA Open Toolkit to publish DITA to various output formats.
In your case the XSL stylesheet which you will probably have to change is:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/xsl/fo/commons.xsl

Just open it in Oxygen and search for the xsl:template called:
<xsl:template match="*[contains(@class,' topic/note ')]">

Indeed the image and message are cells in a fo:table:
<fo:table xsl:use-attribute-sets="note__table">

Then you can modify the fo styles like for example setting a fixed width on the first column:

<fo:table-column column-number="1" column-width="20px"/>

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

chymical
Posts: 16
Joined: Wed Nov 24, 2010 12:37 pm

Re: Change PDF output

Post by chymical » Wed Nov 24, 2010 5:05 pm

Thanks very much Radu! Is there any kind of guide or document that will allow me to track down these objects easily? I assume that they will be scattered through different xsl files?

Radu
Posts: 6184
Joined: Fri Jul 09, 2004 5:18 pm

Re: Change PDF output

Post by Radu » Wed Nov 24, 2010 5:26 pm

Hi,

Some of the PDF output layout can be tweaked by modifying some configuration files.
Basically there is a folder:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/cfg
in which you should look in detail and which contains values for different parameters.
You can either make modifications directly to those files or (the recommanded way) there is another directory called
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/Customization
which replicates the structure of the configuration folder and in which user customizations can be placed. It also has some readme files in it.

But, as in your case, sometimes you have to make modifications directly in the stylesheets.
The stylesheet templates match the class names of different elements so
my brute force approach is usually to link to the PDF DITA Open Toolkit plugin folder OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo in the Oxygen Project view and then perform a find in files looking for things like topic/note which is the class value of the note element.
You can see the class attribute value for an element by looking in the Oxygen Attributes view when the caret is located inside the element's content.

There is also a book called DITA For Print which comes with lots of PDF customization examples:
https://xmlpress.net/publications/dita/dita-for-print/

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Joseccy
Posts: 4
Joined: Tue May 22, 2018 5:31 am

Re: Change PDF output

Post by Joseccy » Tue May 22, 2018 5:43 am

Hi,

The link (http://www.scriptorium.com/whitepapers/ ... tweaks.pdf) to the document "DITA-PDF-tweaks.pdf" is not valid anymore. Not sure if anyone can share this document or offer the valid link. Thanks a lot.

I am learning DITA and DITA-OT myself and am having headache. :evil:

Radu
Posts: 6184
Joined: Fri Jul 09, 2004 5:18 pm

Re: Change PDF output

Post by Radu » Tue May 22, 2018 7:40 am

Hi Peter,

Thanks for reporting the broken link.
I answered your comment here with a couple of suggestions:

post47431.html#p47431

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply