final LogicalPageBox logicalPage,
final int row,
final int col)
throws IOException
{
final PhysicalPageBox page = pageGrid.getPage(row, col);
if (page == null)
{
return;
}
final float width = (float) StrictGeomUtility.toExternalValue(page.getWidth());
final float height = (float) StrictGeomUtility.toExternalValue(page.getHeight());
final float marginLeft = (float) StrictGeomUtility.toExternalValue(page.getImageableX());
final float marginRight = (float) StrictGeomUtility.toExternalValue
(page.getWidth() - page.getImageableWidth() - page.getImageableX());
final float marginTop = (float) StrictGeomUtility.toExternalValue(page.getImageableY());
final float marginBottom = (float) StrictGeomUtility.toExternalValue
(page.getHeight() - page.getImageableHeight() - page.getImageableY());
final AttributeList pageAttributes = new AttributeList();
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "page-x",
pointShortConverter.format(page.getGlobalX()));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "page-y",
pointShortConverter.format(page.getGlobalY()));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "page-width",
pointShortConverter.format(width));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "page-height",
pointShortConverter.format(height));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-top",
pointShortConverter.format(marginTop));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-left",
pointShortConverter.format(marginLeft));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-bottom",
pointShortConverter.format(marginBottom));
pageAttributes.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-right",
pointShortConverter.format(marginRight));
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "physical-page", pageAttributes, XmlWriter.OPEN);
// and now process the box ..
drawArea = new StrictBounds(page.getGlobalX(), page.getGlobalY(),
page.getImageableWidth(), page.getImageableHeight());
processPage(logicalPage);
xmlWriter.writeCloseTag();
}