Use Adobe Distiller to Print PDFs

Description

WebWorks ePublisher products are installed with an application called GhostScript which is used for imaging and PDF printing processes. Some users don't have Adobe's Distiller (which is used by FrameMaker to create PDFs), so we use GhostScript by default. However, this often causes unexpected and unwanted effects when PDFs are generated with ePublisher output. Some GhostScript-related issues include:

Since Distiller requires print-quality options that differ from GhostScript (and even between Distiller versions), it is not currently practical to implement a Distiller option in the ePublisher UI. However, we have developed a procedure which will allow you to force ePublisher to use Adobe Distiller to print PDFs using the appropriate options. It requires an override to either a Target, Format, or User Format.

We'll add a C# script block to the XSL file responsible for PDF printing and make a call to the function that will print a PDF using the PostScript files generated from your documents. If Distiller is not available on your machine, or if another error occurs, we'll fall back on the default GhostScript printer.


Adding the Script Block

Using methods described in this article, we'll add a block of C# script designed to convert a PostScript file to a PDF using the appropriate print options. Follow these steps:

  1. Perform a Format Override on a file called pdf.xsl, located by default in the ePublisher Pro installation directory here:

    • ePublisher Pro\Formats\Shared\pdf
  2. Open the new copy of pdf.xsl in an XML or text editor, such as NotePad.

  3. At the top, add this line to the list of namespaces referenced by the stylesheet:
    • xmlns:wwdistpdf="urn:WebWorks-Distiller-PDF-Printer"

  4. Add wwdistpdf to the list of exclude-result-prefixes.

  5. At the bottom, above </xsl:stylesheet>, define the script with the code from this text file:

  6. Save pdf.xsl

Calling the Function

Next, modify the XSL to call the new function, passing variables for the PostScript file, the destination PDF, and the Distiller print options.

  1. In the override copy of pdf.xsl, find <xsl:variable name="VarIgnore5">.

  2. Beneath it, replace this line:

    {{{ <xsl:value-of select="wwimaging:PostScriptToPDF($VarFile/@path, wwprojext:GetFormatSetting('pdf-job-settings', 'default'), $VarPDFSplitFile/@path)" />}}} with this block of XSL: {{{ <!-- Try with Distiller -->

    • <!-- --> <xsl:variable name="VarPDFWithDistiller" select="wwdistpdf:FileToPDF($VarFile/@path, $VarPDFSplitFile/@path, wwprojext:GetFormatSetting('pdf-job-settings', 'Standard'))" />

      • <xsl:if test="not($VarPDFWithDistiller)">

        • <!-- Try again --> <xsl:variable name="VarPDFWithDistiller2" select="wwdistpdf:FileToPDF($VarFile/@path, $VarPDFSplitFile/@path, wwprojext:GetFormatSetting('pdf-job-settings', 'Standard'))" /> <xsl:if test="not($VarPDFWithDistiller2)">

          • <!-- Use GhostScript --> <!-- --> <xsl:variable name="VarMsgGS" select="wwlog:Warning('Problem with Distiller; GhostScript used to generate ', $VarPDFSplitFile/@title)" /> <xsl:value-of select="wwimaging:PostScriptToPDF($VarFile/@path, 'default', $VarPDFSplitFile/@path)" />

          </xsl:if>

        </xsl:if>}}}

    Note: Because of the FTI override below, GhostScript will use the "default" option if Distiller fails.

  3. Save and close pdf.xsl.

Changing the Settings

Depending on the version of Distiller you are using, you will have a set of default print settings from which to choose. (Distiller 7.0 offers High Quality, PDFX1a, PDFX3, Press Quality, and Standard). You can determine the default options files available by opening the "Settings" folder in the Distiller application directory (typically C:\Program Files\Adobe\Acrobat X.x\Distillr\Settings). These are the settings you need to know to successfully use Distiller as your ePublisher PDF printer. You'll need to add the applicable options to the appropriate FTI so they are integrated into the PDF options in your project's Format Settings, which are referenced by the XSL call. Follow these steps:

  1. Perform an override on pdf.fti, a file located in the same folder as pdf.xsl:

    • ePublisher Pro\Formats\Shared\pdf
  2. Open the new copy of pdf.fti and make the following changes:

    • Replace the item values for the "pdf-job-settings" class with those you'll use for your version of Distiller.

    • In the <Settings> section, replace default="default" with default="Standard"

  3. Save and close pdf.fti.

Final Steps...

You're almost there. Save and close your ePublisher Pro project, and then reopen it to load the new FTI settings. Confirm the change by opening the Format Settings dialog and checking the PDF job settings for the new values. Choose the desired setting (don't forget to enable PDF generation), and regenerate your output to use Adobe Acrobat Distiller to create your project's PDFs.

Examples

With these handy examples, you don't even have to do any work! Below, you'll find the pdf.xsl and pdf.fti files referenced here, complete with overrides necessary to use Distiller instead of GhostScript for PDF production. Add them to the appropriate override directory, and you're good to go.

References

For more details and advanced options, here's a link to Adobe's Distiller API documentation:



:) :)) :( ;) :\ |) X-( B) Markup

Thx Tony -- My PDFs never quite worked properly, so when time permits I will migrate all to 9.3 and remove the PDF code I added. But your point on making 9.2.2 stationery is well taken.

jjj

Posted by JohnPitt at 2007-09-26 17:44:58

These instructions are blatantly wrong. WRONG WRONG WRONG WRONG WRONG!!! If you follow them you will NOT be able to generate PDFs using Distiller. Instead, the instructions should NOT read "place this block of code between" but REPLACE THIS BLOCK OF CODE WITH THE BLOCK OF CODE SHOWN HERE!

One more example of how Quadralay can't seem to document their own application.

Posted by ms1-2 at 2007-09-26 12:58:04 X

John, we will either post an update to this article for 9.3 formats or make it part of the built-in PDF format in the next patch release or both. For now, here are some options:

  • (1) Try the new PDF generation to see if it meets your needs, however there are still a few FrameMaker symbol fonts not coming through. We are hoping this problem will go away in FrameMaker 8. (2) Create a 9.2.2 stand-alone stationery for use with 9.3, and keep current PDF handling (good option if generating only PDF and you are statisfied with the current PDF link processing).

Posted by TonyMcDow at 2007-09-24 18:02:48

Tony et al,

I made changes to my PDF generation for 9.2 using the previous iteration of this article. The changes were applied to the stationery for 4 separate clients.

I'm about to upgrade each of these stationery sets to 9.3 (and I am moving from using ePP to ePX for generation).

When I diff the various filesets, how should I handle the PDF changes made for 9.2? Ignore them? Delete them?

jjj

Posted by JohnPitt at 2007-09-24 17:13:01

HelpCenter/Tips/UseDistillerForPDF/ePublisher_9.2.2 (last edited 2008-02-13 06:18:22 by localhost)