# PDF output pipeline

The PDF process (formerly known as PDF2) runs the preprocess routine, followed by a series of additional targets. These steps work together to create a merged set of content, convert that to XSL-FO, and then format the FO file to PDF.

The PDF process adds many new Ant targets. During a typical conversion from map to PDF, the following targets are most significant.

- `map2pdf2` creates a merged file by calling a common Java merge module. It then calls `publish.map.pdf` to do the remainder of the work.
- The `publish.map.pdf` target does some initialization, and then calls `transform.topic2pdf` to do the remainder of processing. That target runs all of the following steps.
  - `transform.topic2fo` is used to convert the merged file to an XSL-FO file. This process is composed of several Ant targets.
    - `transform.topic2fo.index` runs a Java process to set up index processing, based on the document language. This step generates the file stage1.xml in the temporary processing directory.
    - `transform.topic2fo.flagging` sets up preprocessing for flagging based on a DITAVAL file. This step generates the file stage1a.xml in the temporary processing directory.
    - `transform.topic2fo.main` does the bulk of the conversion from DITA to XSL-FO. It runs the XSLT based process that creates stage2.fo in the temporary processing directory.
    - `transform.topic2fo.i18n` does additional localization processing on the FO file; it runs a Java process that converts stage2.fo into stage3.fo, followed by an XSLT process that converts stage3.fo into topic.fo.
  - `transform.fo2pdf` converts the topic.fo file into PDF using the available FO processor (Antenna House, XEP, or Apache FOP).
  - `delete.fo2pdf.topic.fo` deletes the topic.fo file, unless otherwise specified by setting an Ant property or command line option.

Parent topic: DITA Open Toolkit Architecture