Displaying a Document for Testing (Windows)

When testing a new XSL template against XML data, it is useful to see the PDF output without printing it each time. If the code you are writing does not use the preview facilities of the XMLPrintStream class, you will need to look at the PDF output of the XML Server manually.

A simple solution is to run an XML Server on your development machine and configure it to open Adobe Reader to display the PDF data each time you submit a job. This will save you from running to a printer or manually opening PDF files. The configuration is shown in Displaying a Document for Testing (Windows).

Figure 1. Displaying a Document for Testing (Windows)
<XML_SERVER_CONFIG>
  <SERVER_PORT>6789</SERVER_PORT>
  <SERVER_COMMAND>c:/PROGRA~1/Adobe/AcrobatReader/AcroRd32.exe
%d/%f</SERVER_COMMAND>
  <USE_TMP_FILE>true</USE_TMP_FILE>
  <TMP_FILE_ROOT>temp</TMP_FILE_ROOT>
  <TMP_DIRECTORY>c:/xmlsrv/tmp</TMP_DIRECTORY>
  ...
</XML_SERVER_CONFIG>

You cannot include space characters in the path to the server command as Java will interpret these as the end of the command file name and there is no way of escaping them. To avoid the problem, the above configuration file shows how the DOS short name of the directory containing the space character is used: PROGRA~1 instead of Program Files. As the command was not passed to a command interpreter, the choice of / or \ as a path separator character is arbitrary.