Revision: 175
http://openpcl.svn.sourceforge.net/openpcl/?rev=175&view=rev
Author: documentsystems
Date: 2007-09-25 16:41:08 -0700 (Tue, 25 Sep 2007)
Log Message:
-----------
Howard Hoagland. Added set and get IsDuplex, and 3 ints for the possible values. Previously, all duplex cmds were being stripped out and not put back in one time at the top of the PCL bytes. Now, it strips out all duplex PCL cmds, then if the use picks Duplex=Yes on the print options dialog, then put in one duplex On command at the top of the PCL bytes. Then when printing for duplex Windows Print, and duplex was in the PCL bytes, set the print request attribute for duplex, which causes duplex to happen. For PCL Direct, the duplex bytes in the PCL causes the printer to go into duplex mode.
Modified Paths:
--------------
openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java
Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java
===================================================================
--- openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java 2007-09-25 23:36:34 UTC (rev 174)
+++ openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java 2007-09-25 23:41:08 UTC (rev 175)
@@ -33,6 +33,12 @@
// When a Page Size command is found in the Pcl, this is set to the found Page Size.
protected int mCurrentPaperSize = sDefaultPaperSize;
+ // Duplex on/off
+ public static final int sDuplexOff = 0;
+ public static final int sDuplexOnLongEdge = 1;
+ public static final int sDuplexOnShortEdge = 2;
+ protected int mDuplexMode = sDuplexOff;
+
/** Constructor */
public PriPageSettings() {
super();
@@ -45,6 +51,7 @@
mCurrentPaperSize = sDefaultPaperSize;
setLineSpacing(6);
setTopMarginAdjustment(3);
+ setDuplexMode(sDuplexOff);
}
/** When the user is done with this rendering session, then free up memory */
@@ -105,22 +112,46 @@
public void setPaperSize(int pPaperSize) {
mCurrentPaperSize = pPaperSize;
}
+
+ /** Set the duplex mode.<br>
+ * @param pDuplexMode
+ * 0 is Duplex off (Simplex)
+ * 1 is Duplex on long edge of paper
+ * 2 is Duplex on short edge of paper
+ */
+ public void setDuplexMode(int pDuplexMode) {
+ mDuplexMode = pDuplexMode;
+ }
/** set PrintPattern
* @param pPattern
*/
public void setPrintPattern(int pPattern) { mPrintPatternMode = pPattern; }
- /** get LinesPerInch */
+ /** get Lines Per Inch */
public float getLinesPerInch() { return mLinesPerInch; }
- /** get NumPixelsPerLine */
+ /** get Num Pixels Per Line */
public int getNumPixelsPerLine() { return (int)(sPrintDotsPerInch / mLinesPerInch); }
- /** get TopMarginPixelOffset */
+ /** get Top Margin Pixel Offset */
public int getTopMarginPixelOffset() { return mTopMarginPixelOffset; }
- /** get LeftMarginPixelOffset */
+ /** get Left Margin Pixel Offset */
public int getLeftMarginPixelOffset() { return mLeftMarginPixelOffset; }
- /** get PrintPatternMode */
+ /** get Print Pattern Mode */
public int getPrintPatternMode() { return mPrintPatternMode; }
- /** get mCurrentPaperSize */
+ /** get Current Paper Size */
public int getCurrentPaperSize() { return mCurrentPaperSize; }
+ /** get Duplex Mode number */
+ public int getDuplexMode() { return mDuplexMode; }
+
+ /**
+ * Returns true if the duplex command was in the PCL bytes. ESC & l # S
+ * @return boolean
+ */
+ public boolean getIsDuplexMode() {
+ if (mDuplexMode == sDuplexOnLongEdge || mDuplexMode == sDuplexOnShortEdge) {
+ return true;
+ } else {
+ return false;
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|