Home Forums DITA and XMetaL Discussion Script/Macro to generate PDF from ditamap Reply To: Script/Macro to generate PDF from ditamap

Derek Read

Reply to: Script/Macro to generate PDF from ditamap

Yes, you could build a solution yourself using the instructions that come with the DITA Open Toolkit and ANT scripts, etc. This would be applicable if you need to manually install the DITA OT on a server, or have other, perhaps more complex requirements. This is all documented with the DITA OT documentation.

However, it is possible to generate output once via XMetaL Author Enterprise and then have a look at the .bat and associated files that XMetaL Author Enterprise creates to see how it does it.

We have no instructions for working with these files and currently do not plan to document this process, but if you are able to read a DOS .bat file it should be fairly straightforward to figure out.

1. Generate output for the particular deliverable you wish to produce for a particular DITA map. In this example I will assume PDF.
2. When you see the “Output Successful” dialog click the “Open Folder” button to check that the PDF was generated.
3. Leave the instance of Windows Explorer from step 2 open but delete the generated PDF (or the entire contents of that folder) so we can prove it is generated again in the next steps.
4. Shut down XMetaL Author Enterprise to prove you don't need it now.
5. Do not move your map file.
6. Using a new instance of Windows Explorer navigate to the following location (paste into Address bar):
That should take you somewhere similar to the following path:
C:Documents and SettingsLocal SettingsTempXMetaLrenditionslog
7. Run the file called dita-call.bat. A DOS command window should appear while generating output then go away and your PDF should reappear in the output folder (in your other copy of Windows Explorer from step 2).

Beyond this we cannot really provide more help (our Professional Services team or one of our partners might be contracted to set up specific or more advanced configurations). However, the files in that folder, together with the copy of the DITA OT that we install and your source files are all that is required to produce output from now on provided you are doing it on this machine. If you wish to use a different copy of the DITA OT, modify the locations of files, do this on a different machine, etc, then you will need to begin poking around in the .bat files to figure out what's going on there. However, if you continue working with the same map file at the original location you can modify the map or associated topics and the same .bat files should produce updated output (it is really the paths to the map that matters most, but the DITA OT needs to be found as well). You can obviously also modify those values by editing the .bat files directly if you are careful and can figure them out.