spm.setMarginTop( UnitsOfMeasurement.twipToBest(page.getPgMar().getTop().intValue() ) );
}
if (needAfter) {
// Footer
RegionAfter rAfter = getFactory().createRegionAfter();
rAfter.setRegionName("xsl-region-after-"+appendRegionName);
spm.setRegionAfter(rAfter);
int marginBottomTwips= page.getFooterMargin();
spm.setMarginBottom( UnitsOfMeasurement.twipToBest(marginBottomTwips) );
// Size footer manually
rAfter.setExtent( halfPageHeightPts); // A4 portrait is 297mm high
// Leave room for this region in body margin
rb.setMarginBottom(halfPageHeightPts );
} else {