/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
attrib.setTwips(RtfPage.PAGE_WIDTH, pagemaster.getPageWidth());
attrib.setTwips(RtfPage.PAGE_HEIGHT, pagemaster.getPageHeight());
+ Object widthRaw = attrib.getValue(RtfPage.PAGE_WIDTH);
+ Object heightRaw = attrib.getValue(RtfPage.PAGE_HEIGHT);
+ if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
+ && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) {
+ attrib.set(RtfPage.LANDSCAPE);
+ }
+
Length pageTop = pagemaster.getCommonMarginBlock().marginTop;
Length pageBottom = pagemaster.getCommonMarginBlock().marginBottom;
Length pageLeft = pagemaster.getCommonMarginBlock().marginLeft;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/** constant for page height */
public static final String PAGE_HEIGHT = "paperh";
+ /** constant for landscape format */
+ public static final String LANDSCAPE = "landscape";
+
/** constant for top margin */
public static final String MARGIN_TOP = "margt";
/** constant for bottom margin */
/** String array of RtfPage attributes */
public static final String[] PAGE_ATTR = new String[]{
- PAGE_WIDTH, PAGE_HEIGHT, MARGIN_TOP, MARGIN_BOTTOM,
+ PAGE_WIDTH, PAGE_HEIGHT, LANDSCAPE, MARGIN_TOP, MARGIN_BOTTOM,
MARGIN_LEFT, MARGIN_RIGHT, HEADERY, FOOTERY
};
attrib = attrs;
}
- /**
- * RtfPage writes the attributes the attributes contained in the string
- * PAGE_ATTR, if not null
- * @throws IOException for I/O problems
- */
- protected void writeRtfContent() throws IOException {
+ /**
+ * RtfPage writes the attributes the attributes contained in the string
+ * PAGE_ATTR, if not null
+ * @throws IOException for I/O problems
+ */
+ protected void writeRtfContent() throws IOException {
writeAttributes(attrib, PAGE_ATTR);
if (attrib != null) {
if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
&& ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) {
- writeControlWord("landscape");
+ writeControlWord(LANDSCAPE);
}
}
}
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="JM" type="fix">
+ The RTF output now properly generates the "\landscape" flag for documents in
+ landscape orientation.
+ </action>
<action context="Code" dev="JM" type="fix">
Following a clarification by the XSL FO SG, space traits are only set on the
first and last area generated by an FO, and not on every area anymore.