---
title: How to create a 2up document using AH Formatter
description: How to create a 2up (2 document pages per PDF page) document using Formatter
---

[Antenna House News ](https://www.antennahouse.com/news)

# [How to create a 2up document using AH Formatter](https://www.antennahouse.com/news/2019/02/how-to-create-a-2up-2-document-pages-per-pdf-page-document-using-formatter)

 Written by [Antenna House](https://www.antennahouse.com/news/author/antenna-house) | February 21, 2019

Here's is how you can use a two-pass Formatter method to create a '2up' PDF with [two document pages rendered on one PDF page](https://www.antennahouse.com/hubfs/pdf-2up.zip).

1) Create the document as you normally would (with one document page per PDF page).

ahfcmd -d sample.fo -o sample.pdf -x 4

2) Create a new .fo document ([sample-2up.fo](https://www.antennahouse.com/hubfs/pdf-2up.zip)) that uses the same page dimensions as the original and sets the margin area sizes to 0. A separator between the pages can be created with the axf:column-rule-* and axf:column-gap Formatter extensions. Add the size of the gap to the page width. Ex:

<fo:simple-page-master master-name="simpleExample" page-width="420mm + 3.0pt" page-height="297mm">  
<fo:region-body margin="0mm" column-count="2" axf:column-gap="3.0pt" axf:column-rule-style="solid" axf:column-rule-color="grey" axf:column-rule-width="3.0pt"/>  
</fo:simple-page-master>

3) In the new document embed all of the original pages as an external graphic. Ex:

<fo:flow flow-name="xsl-region-body">  
<fo:block>  
<fo:external-graphic src="sample.pdf#page=1-" />  
</fo:block>  
</fo:flow>

4) Links from the embedded PDF can be preserved using the Formatter import-annotation-types option. You can set this in a Formatter configuration file. Ex:

---- config.xml ----  
<formatter-config>  
<pdf-settings import-annotation-types="all" />  
</formatter-config>  
----

5) Create the new document and make sure the PDF version is the same or greater than the original document. Ex:

ahfcmd -d sample-2up.fo -o sample-2up.pdf -i config.xml -pdfver 1.7 -x 4

[View full post](https://www.antennahouse.com/news/2019/02/how-to-create-a-2up-2-document-pages-per-pdf-page-document-using-formatter)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Antenna House"
  },
  "dateModified" : "2021-08-10T18:32:36.316Z",
  "datePublished" : "2019-02-21T22:04:55Z",
  "headline" : "How to create a 2up document using AH Formatter",
  "image" : {
    "@type" : "ImageObject",
    "height" : 60,
    "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
    "width" : 60
  },
  "mainEntityOfPage" : "https://www.antennahouse.com/news/2019/02/how-to-create-a-2up-2-document-pages-per-pdf-page-document-using-formatter",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Antenna House News"
  }
}
```