Edit online

Generating PDF from an Integration Server

PDF output can be automatically generated from a Continuous Integration/Continuous Delivery system, such as Jenkins.

To integrate PDF output with the Jenkins CI tool, follow these steps:
  1. Create a Maven project to incorporate Oxygen Publishing Engine.
  2. Go to the root of your Maven project and edit the pom.xml file to include the following fragment:
    <project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                          http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen-oxygen-pdf-css-generator</artifactId>
      <version>1.0</version>
      
      <properties>
        <!-- The path to Oxygen Publishing Engine -->
        <dita-ot-dir>/path/to/oxygen-publishing-engine</dita-ot-dir>
        <!-- The path to the DITA map that you want to process. -->
        <input-file>/path/to/map.ditamap</input-file>
        <!-- The path of the output directory. -->
        <output-dir>/path/to/output/folder</output-dir>
        <!-- The path to the PDF publishing template folder (containing the .opt file). -->
        <publishing-template>/path/to/template/folder</publishing-template>
      </properties>
      
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
              <execution>
                <id>generate-pdf-css</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>${dita-ot-dir}/bin/dita</executable>
                  <arguments>
                    <argument>--format=pdf-css-html5</argument>
                    <argument>--input=${input-file}</argument>
                    <argument>--output=${output-dir}</argument>
                    <argument>-Dpdf.publishing.template=${publishing-template}</argument>
                    <argument>-v</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>
  3. Go to the Jenkins top page and create a new Jenkins job. Configure this job to suit your particular requirements, such as the build frequency and location of the Maven project.