chrisg 2002/11/26 10:15:19
Modified: . Tag: fop-0_20_2-maintain CHANGES
src/org/apache/fop/render/pcl Tag: fop-0_20_2-maintain
PCLRenderer.java
Log:
Added autoselecting portrait/landscape on PCL Renderer (see bug #6638)
Submitted by: [EMAIL PROTECTED] (Vicente Salvador)
Revision Changes Path
No revision
No revision
1.10.2.32 +2 -0 xml-fop/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/xml-fop/CHANGES,v
retrieving revision 1.10.2.31
retrieving revision 1.10.2.32
diff -u -r1.10.2.31 -r1.10.2.32
--- CHANGES 25 Nov 2002 17:01:47 -0000 1.10.2.31
+++ CHANGES 26 Nov 2002 18:15:18 -0000 1.10.2.32
@@ -1,6 +1,8 @@
==============================================================================
Done since 0.20.4 release
+- Added autoselecting portrait/landscape on PCL Renderer (see bug #6638)
+ Submitted by: [EMAIL PROTECTED] (Vicente Salvador)
- Improved AWT Font-measuring/rendering (see bug #14657)
Submitted by: Ralph LaChance <[EMAIL PROTECTED]>
- Updated examples/fo files to remove all errors and warnings during build
No revision
No revision
1.13.2.7 +14 -13 xml-fop/src/org/apache/fop/render/pcl/PCLRenderer.java
Index: PCLRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/pcl/PCLRenderer.java,v
retrieving revision 1.13.2.6
retrieving revision 1.13.2.7
diff -u -r1.13.2.6 -r1.13.2.7
--- PCLRenderer.java 8 Nov 2002 10:25:28 -0000 1.13.2.6
+++ PCLRenderer.java 26 Nov 2002 18:15:18 -0000 1.13.2.7
@@ -48,8 +48,7 @@
public int curdiv = 0;
private int divisions = -1;
public int paperheight = -1; // Paper height in decipoints?
- public int orientation =
- -1; // -1=default/unknown, 0=portrait, 1=landscape.
+ public int orientation = 0; // 0=default/portrait, 1=landscape.
public int topmargin = -1; // Top margin in decipoints?
public int leftmargin = -1; // Left margin in decipoints?
private int fullmargin = 0;
@@ -677,6 +676,18 @@
System.out.println("PCLRenderer.renderPage() page.Height() = "
+ page.getHeight());
+ // FIXME: Set orientation. We made this assumption. It's not always correct
but we need a
+ // method to generate landscape pages
+ if (page.getHeight() < page.getWidth()) {
+ orientation = 1;
+ }
+ currentStream.add("\033&l" + orientation + "O");
+ if (orientation == 1 || orientation == 3) {
+ xoffset = -144;
+ } else {
+ xoffset = -180;
+ }
+
if (paperheight > 0 && divisions == -1)
divisions = paperheight / (page.getHeight() / 100);
@@ -749,16 +760,6 @@
throws IOException {
log.info("rendering areas to PCL");
currentStream = new PCLStream(outputStream);
-
- // Set orientation.
- if (orientation > -1)
- currentStream.add("\033&l" + orientation + "O");
- else
- currentStream.add("\033&l0O");
- if (orientation == 1 || orientation == 3)
- xoffset = -144;
- else
- xoffset = -180;
// Reset the margins.
currentStream.add("\033" + "9\033&l0E");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]