Automatic assignment of name to a PDF

16 views
Skip to first unread message

U M

unread,
May 20, 2021, 12:50:20 PMMay 20
to DITA-OT Users
Hello,

By default, the name given to a PDF is the name of the bookmap; alternatively, there is the output.File ant script one can use as part of the transformation scenario settings. 

I was wondering if there was also a way to add some code to the build file to automatically assign a name to a PDF.

The build file contains the     <property name="output.file" value="${dita.output.dir}${file.separator}toctree.js"/> snippet.  

Is there a way variables can be added to this property that would select the value of a variable, for example:

<xsl:variable name="pdfname" >
    <xsl:value-of select="translate(normalize-space($map/*[contains(@class, ' bookmap/booktitle ')]/*[contains(@class,' bookmap/mainbooktitle ')][1]),' ','_')"/>
  </xsl:variable>

I've tried <property name="output.file" value="${pdfname}toctree.js"/> but that doesn't work.

Any help would be much appreciated.

Ute




Toshihiko Makita

unread,
May 21, 2021, 9:49:04 AMMay 21
to DITA-OT Users
Hi Ute,

I'm always use the following scenario:

  1. After DITA-OT "preprocess" add one XSLT task that inputs bookmap and output any XML file that contains your information (in this case, PDF file name).
  2. Apply ant "xmlproperty" to the output file and obtain the needed property from output XML file hierarchy.
    http://ant.apache.org/manual/Tasks/xmlproperty.html
  3. Use the generated property in your build such as generating PDF file.
Hope this helps your development.

Regards,

-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 --------------------------------------------------*/ 

2021年5月21日金曜日 1:50:20 UTC+9 U M:

U M

unread,
May 25, 2021, 7:18:53 AMMay 25
to DITA-OT Users
Thank you for this information, Toshihiko - I will give that a try.
Reply all
Reply to author
Forward
0 new messages