PDF output generation problem

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
rgmetap
Posts: 12
Location: Pune , India

PDF output generation problem

Thu Dec 15, 2016 10:24 am

Hi ,

I am trying to generate PDF output through my own plugin , but unable to view my output instead of getting successful build. I am new in creating output in PDF. I am running my code on default dita-ot , then it is showing the output PDF. So where am I missing .

build.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<project>
    <import file="build_pdf2w_template.xml"/>
</project>



build_pdf2w_template.xml:-

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<project name="org.dita.pdf2w" default="dita2pdf2w" basedir=".">

   <property name="transtype" location="C:\Program Files\dita-ot-2.4"/>
 
   
    <target name="dita2pdf2w"  description="build PDF" depends="pdf"/>
   
        <target name="pdf" description="build PDF">
        <ant antfile="C:\Program Files\dita-ot-2.4\plugins\org.dita.pdf2w\build_pdf2w_template.xml">
            <property name="args.input" value="D:\AutoDOSE-Demo\AutoDOSE_Precision_Detergent_Dispenser.ditamap"/>
            <property name="args.gen.task.lbl" value="YES"/>   
            <property name="args.rellinks" value="nofamily"/>   
            <property name="output.dir" value="C:\"/>
            <property name="transtype" value="pdf"/>
        </ant>
    </target>
   
</project>


plugin.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<plugin id="org.dita.pdf2w">
    <require plugin="org.dita.pdf2w"/>
    <feature extension="dita.conductor.transtype.check" value="pdf2w"/>
    <feature extension="dita.transtype.print" value="pdf2w"/>
   
    <feature extension="dita.conductor.target.relative" file="build.xml"/>
</plugin>


integrator.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<project name="org.dita.pdf2w">
    <target name="dita2pdf2w.init">
        <property name="customization.dir" location="${dita.plugin.org.dita.pdf2w.dir}/cfg"/>
    </target>
    <target name="dita2pdf2w" depends="dita2pdf2w.init , dita2pdf2w"/>
</project>
Rohit Ghosh
Jr. Software Developer
Radu
Posts: 5582

Re: PDF output generation problem

Thu Dec 15, 2016 10:28 am

Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rgmetap
Posts: 12
Location: Pune , India

Re: PDF output generation problem

Thu Dec 15, 2016 10:45 am

Thank You Sir ,

Sir I had made few changes on my build_pdf2w_template file. Still not working.
Rohit Ghosh
Jr. Software Developer
Radu
Posts: 5582

Re: PDF output generation problem

Thu Dec 15, 2016 10:56 am

Hi,

I had made few changes on my build_pdf2w_template file. Still not working.


This does not give me enough details to help you. Have you tried using Jarno Elovirta's PDF plugin generator (I gave the link on my Stackoverflow answer) to generate the PDF plugin? You can compare the generated plugin with yours.
Do you integrate your plugin in the DITA Open Toolkit after you make changes to it?
In the build.xml in the target you can also add ANT <echo> elements to output messages that you can use for debug.
In the Oxygen Preferences->DITA page you can choose to always show the ANT console output and see if your messages are emitted.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rgmetap
Posts: 12
Location: Pune , India

Re: PDF output generation problem

Thu Dec 15, 2016 12:59 pm

Hi Sir,

I refer Jarno Elovirta's PDF plugin generator that you had mentioned and i did changes removing build and build template xml. I compared with my plugin with Jarno's created plugins and it is as follows


integrator.xml:-

Code: Select all

<?xml version='1.0' encoding='utf-8'?>

<project name="org.dita.pdf2w">
<target name="dita2pdf.init">
<property location="${dita.plugin.org.dita.pdf2w.dir}/cfg" name="customization.dir" />
<property name="pdf2.i18n.skip" value="true" />
<property location="${dita.plugin.org.dita.pdf2w.dir}/xsl/fo/topic2fo.xsl" name="args.xsl.pdf" />
<property name="args.chapter.layout" value="MINITOC" />
<property name="args.bookmark.style" value="COLLAPSED" />
<property name="args.fo.include.rellinks" value="none" />
</target><target depends="dita2pdf.init, dita2pdf2" name="dita2pdf" />
</project>


plugin.xml:-

<?xml version="1.0" encoding="UTF-8"?>

<plugin id="org.dita.pdf2w">
<require plugin="org.dita.pdf2"/>
<feature extension="dita.conductor.transtype.check" value="pdf"/>
<feature extension="dita.transtype.print" value="pdf2"/>
<feature extension="dita.conductor.target.relative" file="integrator.xml"/>
</plugin>

I am integrating on dita-ot batch file , it is successful . When I am running output code (c:\Program Files\dita-ot-2.4\plugins\org.dita.pdf2w>ant -Dargs.input=D:\AutoCOM-Demo\AutoCOM.ditamap -Doutput.dir=C:\ -Dtranstype=pdf it is throwing this error:-


Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\jre1.8.0_111\lib\tools.jar
Buildfile: build.xml does not exist!
Build failed
Rohit Ghosh
Jr. Software Developer
Radu
Posts: 5582

Re: PDF output generation problem

Thu Dec 15, 2016 1:11 pm

Hi,

The "pdf" and "pdf2" transtypes are base transtypes so your plugin needs to define its own transtype.
So the plugin.xml needs to declare the transtype something like:

Code: Select all

<feature extension="dita.transtype.print" value="pdf2w"/>


then your integrator.xml would also change the name of the main target according to the transtype "pdf2w":

Code: Select all

<target depends="dita2pdf.init, dita2pdf2" name="dita2pdf2w" />


Then about this remark:

When I am running output code (c:\Program Files\dita-ot-2.4\plugins\org.dita.pdf2w>ant -Dargs.input=D:\AutoCOM-Demo\AutoCOM.ditamap -Doutput.dir=C:\ -Dtranstype=pdf


The transtype must be "-Dtranstype=pdf2w".
And the ant transformation should be run in the folder c:\Program Files\dita-ot-2.4 and not in the folder where the plugin's contents are located.

There is a simpler way to run the output generation using the "dita" command in the DITA OT folder:

http://www.dita-ot.org/dev/getting-started/first-build-using-dita-command.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rgmetap
Posts: 12
Location: Pune , India

Re: PDF output generation problem

Thu Dec 15, 2016 2:04 pm

Hi Sir,

I am not using Oxygen right now. So I am not finding any build/ant file in Jarno's plugin creation. So where do I have to include the ant command for input/output path ?

I have to follow this ?http://www.dita-ot.org/2.3/user-guide/creating-an-ant-build-script.html

Then my entire integrator will be changed?
Rohit Ghosh
Jr. Software Developer
Radu
Posts: 5582

Re: PDF output generation problem

Fri Dec 16, 2016 1:11 pm

Hi,

Jarno's plugin generator generates a ZIP file.
You can integrate the zipped plugin in the existing DITA OT by following these instructions:

http://www.dita-ot.org/dev/dev_ref/plugins-installing.html

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

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest