You love PDF. You hate making it.

ScriptoriumTech / DITA, Tools7 Comments

by David Kelly

The DITA Open Toolkit uses FOP to create PDFs directly from XSL-FO.  There are many PDF features that XSL-FO and FOP cannot provide during this conversion—configuring PDF security features, for instance, and using EPS graphics. While attempting to provide better graphics for a customer, we realized that FOP can also transform XSL-FO to Postscript, and from there a second step could use Adobe Acrobat Distiller to create PDFs. Initial results are in, and like the Ronco Cap Snaffler, “It really, really works!” (In fact, it probably works better than the redoubtable Cap Snaffler itself.)

Using an FO-to-Postscript-to-PDF chain makes a lot of sense for creating PDFs. The ability to incorporate EPS files into PDFs makes it worthwhile by itself. But it also opens possibilities for fine-tuning PDFs. The Postscript-to-PDF phase invites the addition of a reference to a Distiller job option file. Using this arrangement, you could create different kinds of PDFs in a single workflow. Variations could include different page sizes, different optimizations (screen and print), and different security settings. I’m getting all Shamwow just thinking about it.

Adding Acrobat Distiller to the workflow also suggests the possibility of adding post-Distiller tools into the mix. It would be interesting to explore the ability to enable commenting by using a command-line based tool such as CAM::PDF or perform additional PDF configuration tweaking with a programming resource like PDF::API2 . It would also be interesting to see whether any of the MicroType TimeSaver/Assistants could be grafted into the workflow. I’m just blue-skying here.

The reference to the Ronco Cap Snaffler made me think of other inventions that could slice, dice, and automate PDF configurations. What could be more appropriate than the slapchop? How can you not think of the DITA Open Toolkit when you hear “You love salad.You hate making it.”?

I’d be interesting in hearing other possibilities you might think of for pre- and post-Distiller PDF functions that could be spliced into the Open Toolkit.

About the Author


7 Comments on “You love PDF. You hate making it.”

  1. Thanks for the blog – it has given me one of those a penny-dropping moments when you think, “WOW, why didn’t I think of that?”.

    If Dita-OT is the Slapchop, then NitroPDF is the Graty. I’m in the process of julienning the 1100-page first edition of my monolithic book into plain-text, bacterium-free content modules that will become DITA topics for merging into the second edition.

    p.s. I watched the video and immediately went to eBay and bought a Slapchop. Is Vince related to you? 😉

  2. In “real life” I don’t think I could sell water in the desert. If I am related to Vince, I don’t want to think about it.

    Let me know how the NitroPDF works. Now that the can of worms has been opened, I’m looking for all the best worms.

    I did want to mention – going through the postscript-to-PDF method, you lose links and bookmarks. But for plain text, which it sounds like you are interested in doing, this method does have its advantages.

  3. Re NitroPDF: I suggest you just download their trial and put it through its paces. For me, it does what I thought I absolutely needed Acrobat Pro for (and did need, before I discovered NitroPDF).

    Because I’m working with a hotchpotch of content in many divers formats and creating PDF (amongst other) output in even more divers ways, I’ve always needed the SonarBookends plug-in, which only works with Acro Pro. It hotlinks indexes and TOCs. NitroPDF simply does it, out of the box, and without the extra workarounds needed with Sonar Bookends.

    I don’t think I’ve exhausted all the possibilities of Nitro yet. It keeps handing me new ways to use and re-use content of PDFs for which I don’t have the source — and even for those for which I do. HelpAndManual, for example, does what it does quite well, but it is a whole lot easier to work with its PDF output than with its strange, proprietary XML source.

    Nitro’s plain-text conversion beats any other tools I’ve used – genuinely “plain” output, encoded in UTF-8, with completely correct differentiation of soft and hard line breaks: You get real paragraphs! For RTF output, you have multiple choices according to your need (or not) to preserve layout.

    For me, it’s not really an “aside” from your topic. That penny-drop suddenly made obvious some possibilities in my toolset for solving some things that have been bugging me as awkward problems. I’m far from solving everything yet, but every flash of inspiration helps.

  4. I don’t think it’s an aside, either. I appreciate your willingness to share your experience. That’s a big part of why we have this blog – the technical side of publishing is complex, and the more information we share, the better we hope it will be for everyone. And now you’ve made me interested in checking out NitroPDF, so – Thanks!

  5. Hi David

    You write “going through the postscript-to-PDF method, you lose links and bookmarks.”

    Are X-refs and bookmarks lost during creation of the postscript file?

    We have been using postscript files to create PDFs with a another production setup and DTD, and have no problem with X-refs and bookmarks. So I assume that the problem is because of the way DITA OT creats postscripts, right?

    Søren Weimann

  6. I believe the links and bookmarks are omitted during the FO-to-PS phase by Apache FOP. The links and bookmarks do appear in the FO itself. I’d be interested to hear how are you creating your postscript files. Possibly I missed something when I did the conversion.

Leave a Reply

Your email address will not be published. Required fields are marked *