<datatype>Length</datatype>
<default>1.0pt</default>
</property>
-
+
<!-- Properties for Dynamic Effects Formatting Objects -->
<property>
<inherited>false</inherited>
<datatype>Length</datatype>
<auto-ok/>
- <default>11in</default>
+ <default>auto</default>
</property>
<property>
<name>page-position</name>
<inherited>false</inherited>
<datatype>Length</datatype>
<auto-ok/>
- <default>8in</default>
+ <default>auto</default>
</property>
<property>
<name>precedence</name>
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.PageMaster;
-import org.apache.fop.layout.RegionArea;
import org.apache.fop.layout.BodyRegionArea;
import org.apache.fop.layout.MarginProps;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.Length;
import java.util.HashMap;
import java.util.Iterator;
* ¶6.4.12</a>
*/
public class SimplePageMaster extends FObj {
+ // Fallback values for "auto" page size: 8x11in
+ private final static int FALLBACK_PAGE_HEIGHT = 792000;
+ private final static int FALLBACK_PAGE_WIDTH = 576000;
public static class Maker extends FObj.Maker {
public FObj make(FObj parent,
}
protected void end() {
- int pageWidth =
- this.properties.get("page-width").getLength().mvalue();
- int pageHeight =
- this.properties.get("page-height").getLength().mvalue();
+ Length pageWidthLen = this.properties.get("page-width").getLength();
+ int pageWidth = pageWidthLen.isAuto() ? FALLBACK_PAGE_WIDTH : pageWidthLen.mvalue();
+ Length pageHeightLen = this.properties.get("page-height").getLength();
+ int pageHeight = pageHeightLen.isAuto() ? FALLBACK_PAGE_HEIGHT : pageHeightLen.mvalue();
// this.properties.get("reference-orientation");
// this.properties.get("writing-mode");