Skip to main content
Known Participant
March 15, 2011
Question

how to customize CHM and PDF output

  • March 15, 2011
  • 1 reply
  • 876 views

I can easily generate CHM and PDF using the Generate Output option offered by DITA-FMx, but the output is just standard and I would like to customize it according to the company style. Which files should I work on to modify fonts, colours, indentation, etc, both for CHM and PDF?

This topic has been closed for replies.

1 reply

ScottPrentice
Inspiring
March 15, 2011

For PDF output, you should be using the Generate Book from Map command. This is one of the main reasons to use FrameMaker for DITA .. the high quality PDF output. You'll never achieve the same level of quality through XSL-FO as you do through native Frame. See this video for info on leveraging DITA-FMx features for PDF publishing ..

http://blog.leximation.com/2010/03/pdf-publishing-with-dita-fmx-1-1/

To customize the formatting of any output generated through the DITA Open Toolkit (which is what is used by the Generate Output command), you have to modify the XSL and CSS files in the DITA-OT. The "proper" way to do this is to create an OT plugin that provides you with a custom Ant target that does exactly what you want. You can then deliver this plugin to others on your team who need to generate the same output, and you haven't mucked around with the core OT files. You can also just dive in and tweak the files directly, but when you break something you won't be able to test with the original files without restoring from backups.

You can start by tweaking the CSS files, but if you need to make structural modifications to the way the HTML is generated, you'll need to do some XSL work. Note that setting the @outputclass value on the DITA topic files, passes that value into the corresponding element in the @class attribute of the generated HTML. This is a good way to allow you to control formatting of specific elements.

The best place to go for instructions/info on exactly which files to modify in the OT and how to build a plugin, is the dita-users Yahoo group. This is definitely the list to be on for anything that relates to the DITA-OT.

Scriptorium Publishing has a nice whitepaper on customizing the OT ..

http://store.scriptorium.com/items/books/hacking-the-dita-open-toolkit-detail.htm

Also, the dita.xml.org website has some useful info.

Cheers,

...scott

Participating Frequently
May 12, 2014

Hi Scott,

When you say "This is one of the main reasons to use FrameMaker for DITA .. the high quality PDF output. You'll never achieve the same level of quality through XSL-FO as you do through native Frame." Could you provide some examples? How bad will be my PDF if I decide to customize using XSL-FO? (In case one day we decide to give up FM for example, and use another editor.) I'm wondering if it's just a little worse or really worse. Our docs will be printed so quality is one of my concern, but most of our docs are black and white.

Thanks,

Annette

ScottPrentice
Inspiring
May 12, 2014

HI Annette...

Using XML-FO will likely require that you hire a programmer to develop and maintain the FO stylesheets. FO is not a friendly development language. It is possible to develop FO stylesheets that produce very nice output (PDFs) .. it just takes a long time and may cost a fair amount of money. It really all depends on what you need. You can generate PDF output from the DITA-OT using the default FO stylesheets, and you'll see the "starting point".

FO-generated PDFs to me typically look very "plain" and basic. They can look fine, and if your needs aren't all that great, that may be good enough. My problem even with the basic output is that in order to make any adjustments you'll probably have to pay your FO consultant to make the tweaks. As opposed to Frame, you can open the template and move the header a bit or change the style of some element yourself.

One of the areas that you'll see a bit of problem in FO is large tables. It can be very difficult to get tables to wrap properly and get the formatting set up to look nice.

Note that this isn't an all-or-nothing type of thing. You can use another editor (say Oxygen) for authoring, but still use FM (and DITA-FMx) for publishing. This is the great thing about DITA is that you're not locked to one tool for app stages of the workflow. Use the tool that's right for each step.

Cheers,

…scott