Listing 1. Describing the desired page layout for the FO processor
try {
output.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
output.write("<fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">\n");
output.write(" <fo:layout-master-set>\n");
output.write(" <fo:simple-page-master master-name=\"sample\" \n");
output.write(" page-height=\"" + pageHeight + "mm\"\n");
output.write(" page-width=\"" + pageWidth + "mm\"\n");
output.write(" margin-left=\"25mm\"\n");
output.write(" margin-right=\"25mm\"\n");
output.write(" margin-top=\"" + headerHeight + "mm\"\n");
output.write(" margin-bottom=\"" + footerHeight + "mm\">\n");
output.write(" <fo:region-body margin-top=\"0mm\"\n");
output.write(" margin-bottom=\"0mm\" />\n");
output.write(" <fo:region-before extent=\"3cm\" />\n");
output.write(" <fo:region-after extent=\"1.5cm\" />\n");
output.write(" </fo:simple-page-master>\n");
output.write(" </fo:layout-master-set>\n");
output.write(" <fo:page-sequence master-name=\"sample\">\n");
output.write(" <fo:flow flow-name=\"xsl-region-body\">\n");
} catch ( java.io.IOException ioe ) {
System.out.println("Error writing to output file.");
System.exit( -1 );
}
|
