Hi all,

I'm using XSL-FO and Apache FOP to generate PDF documents from XML documents. I managed to transform the XML into PDF with 1 page per sheet, but I also would like to get PDFs with 2 and 4 pages per sheet. Does anyone have any idea how I can do this? I have looked in the W3Schools tutorials, but I found nothing about it.


I do believe that this is a function of the printer and the drivers associated with the printer.

Excerpt from the Acobat 8 Professional Help Guide:

"Multiple Pages Per Sheet Enables N-up printing, where multiple pages print on the same sheet of paper. If this option is selected, you can also specify settings for Pages Per Sheet, Page Order, Print Page Border, and Auto-Rotate Pages.

Note: N-up printing in Acrobat is independent of the N-up printing features of printer drivers. The Acrobat print settings don’t reflect the N-up settings of the printer drivers. Select N-up printing either in Acrobat or in the printer driver, but not both."

The functionality is called "page scaling" which is a function of Acrobat Reader 7 and up (pdf specs 1.6+). Apache FOP, from when I last checked for 0.95, only supported writing of PDF files based on the pdf 1.4 spec. You can look into a port of Apache FOP called iText (HomePage).


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.