Publishing PageSeeder data to print, the Web or both

Task export-pdf

This task can be used to convert a portable or processed PSML document to PDF according to rules in the PDF Export config.

To use this Ant extension standalone outside PageSeeder you can download the pso-pdf-ant-x.jar and pso-pdf-core-x.jar files from bintray .


Minimal definition:

<export-pdf src="[source]" />

 Full definition:

<export-pdf src="[source]"
  <config file="[config file]"
          name="[document type]"
          priority="[priority number]"/>
  <configs folder="[config folder]"
           priority="[priority number]"/>


@srcPath to the .psml source file to process.Yes
@destPath to the destination file. If unspecified, the default value is the name and location of the source with .pdf extension.No

The directory holding temporary files such as the concatenated configs files and XSL-FO scripts. The default is:

@debugIf "true" an fo.xml file will be created under the working folder.No



Defines a config file which will override rules in the default config file. There maybe be multiple <config> elements.

@filePath to a configuration file.Yes
@nameUse default to apply the rules to all, or else specify the name of a PSML document type. Default value is "default".No
@priorityThe priority number for the rules in this config file. When there are multiple files, higher priority will override lower. Default value is "1".No


Defines a set of config files which will override rules in the default config file. There maybe be multiple <configs> elements. Any config files with the following path will be read [config folder]/[document type]/pdf-export-config.xml

@folderPath to a configuration folder.Yes
@priorityThe priority number for the rules in these config files. When there are multiple files higher priority will override lower. Default value is "1".No


Invoking in Ant

This task is included by default in the PageSeeder publisher so <taskdef/>  is only required when using it outside the publisher.

<project ... xmlns:psp="antlib:org.pageseeder.pdf.ant">

  <!-- only required for standalone -->
  <taskdef uri="antlib:org.pageseeder.pdf.ant" 

  <target ... >
    <!-- Invoke Task -->
    <psp:export-pdf src="test.psml" dest="result.pdf"/>

Using a namespace is not required, but it is a good mechanism to know the origin of the task. The recommended namespace is 'psp'.


Because it is designed to work as a standalone process, no connection to PageSeeder is required. However, when run in the context of a PageSeeder export, use the Task export and Task process to download the source PSML file.

How does it work?

This Ant task will:

Load the config files.

Create XSL-FO according to the rules in the config files and the default config.

Use Apache FOP to generate the PDF output from the XSL-FO.

Created on , last edited on