Diff for Tips for debugging PDF2 plugin PDF issues

Sun, 2007-11-25 07:46 by Bruce EsrigSat, 2012-06-16 10:08 by jelovirt

Tags: Plugins

Changes to Body
Line 1Line 1
-
<strong>Keeping the generated FO file</strong><br />
+
<p>
  +
Note: this page is out-of-date, see [[http://dita-ot.sourceforge.net/latest/]] for current documentation. 
  +
</p>
  +
<p>
  +
&#160;
  +
</p>
  +
<h1><strong>Keeping the generated FO file</strong></h1>
 
<br />
 
<br />
 
One of the most important things to do to debug the PDF generated by the PDF2 plugin (also known as the Idiom PDF plugin) is to look at the FO file the plugin generates.   The plugin, by default, deletes all intermediate files, though, so you need to modify the plugin to save those files.<br />
 
One of the most important things to do to debug the PDF generated by the PDF2 plugin (also known as the Idiom PDF plugin) is to look at the FO file the plugin generates.   The plugin, by default, deletes all intermediate files, though, so you need to modify the plugin to save those files.<br />
 
<br />
 
<br />
-
To stop the plugin from deleting the FO file:<br />
+
To stop the plugin from deleting the FO file:
-
<br />
+
<p>
  +
&#160;
  +
</p>
 
<ol>
 
<ol>
 
<li>Open demo\fo\build.xml in a n editor.</li>
 
<li>Open demo\fo\build.xml in a n editor.</li>
Line 12Line 20
 
<li>Change that target to look like the following:<br />
 
<li>Change that target to look like the following:<br />
 
<br />
 
<br />
-
            &lt;antcall target=&quot;transform.fo2pdf&quot;&gt;<br />
+
&lt;antcall target=&quot;transform.fo2pdf&quot;&gt;<br />
-
                 &lt;param name=&quot;inputFile&quot; value=&quot;${dita.map.output.dir}/topic.fo&quot;/&gt;<br />
+
&lt;param name=&quot;inputFile&quot; value=&quot;${dita.map.output.dir}/topic.fo&quot;/&gt;<br />
-
                 &lt;param name=&quot;outputFile&quot; value=&quot;${outputFile}&quot;/&gt;<br />
+
&lt;param name=&quot;outputFile&quot; value=&quot;${outputFile}&quot;/&gt;<br />
-
                 &lt;param name=&quot;xep.failOnError&quot; value=&quot;${xep.failOnError}&quot;/&gt;<br />
+
&lt;param name=&quot;xep.failOnError&quot; value=&quot;${xep.failOnError}&quot;/&gt;<br />
-
             &lt;/antcall&gt;<br />
+
&lt;/antcall&gt;<br />
-
<br />
+
-
      &lt;!-- Keep the fo around for debugging purposes --&gt;<br />
+
-
      &lt;!--<br />
+
-
             &lt;delete&gt;<br />
+
-
                &lt;fileset dir=&quot;${buildDir}&quot; includes=&quot;stage?.*&quot;/&gt;<br />
+
-
               &lt;fileset dir=&quot;${dita.map.output.dir}&quot; includes=&quot;topic.fo&quot;/&gt;<br />
+
-
             &lt;/delete&gt;<br />
+
-
      --&gt;<br />
+
 
<br />
 
<br />
-
         &lt;/target&gt;<br />
+
&lt;!-- Keep the fo around for debugging purposes --&gt;<br />
  +
&lt;!--<br />
  +
&lt;delete&gt;<br />
  +
&lt;fileset dir=&quot;${buildDir}&quot; includes=&quot;stage?.*&quot;/&gt;<br />
  +
&lt;fileset dir=&quot;${dita.map.output.dir}&quot; includes=&quot;topic.fo&quot;/&gt;<br />
  +
&lt;/delete&gt;<br />
  +
--&gt;<br />
 
<br />
 
<br />
  +
&lt;/target&gt;<br />
 
</li>
 
</li>
 
</ol>
 
</ol>
Current revision:

Tips for debugging PDF2 plugin PDF issues

Note: this page is out-of-date, see http://dita-ot.sourceforge.net/latest/ for current documentation. 

 

Keeping the generated FO file


One of the most important things to do to debug the PDF generated by the PDF2 plugin (also known as the Idiom PDF plugin) is to look at the FO file the plugin generates.   The plugin, by default, deletes all intermediate files, though, so you need to modify the plugin to save those files.

To stop the plugin from deleting the FO file:

 

  1. Open demo\fo\build.xml in a n editor.
  2. Search for the line

    <antcall target="transform.fo2pdf">

  3. Change that target to look like the following:

    <antcall target="transform.fo2pdf">
    <param name="inputFile" value="${dita.map.output.dir}/topic.fo"/>
    <param name="outputFile" value="${outputFile}"/>
    <param name="xep.failOnError" value="${xep.failOnError}"/>
    </antcall>

    <!-- Keep the fo around for debugging purposes -->
    <!--
    <delete>
    <fileset dir="${buildDir}" includes="stage?.*"/>
    <fileset dir="${dita.map.output.dir}" includes="topic.fo"/>
    </delete>
    -->

    </target>
Now when you generate the PDF, you'll also get a file called "topic.fo".  That file is the one that RenderX xep uses to generate the PDF.  You can run xep manually to build the PDF from this file.

Usually issues can be diagnosed by looking at the FO to see what is really getting put into it, as opposed to what you think is getting put into it.

But, if that's not the case, then you tweak the FO until it generates the PDF you want, then you fix the XSLT to generate the FO you want.

-- Contributed by Steve Anderson (steveo@member.fsf.org)
XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I