You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2008/06/03 16:13:28 UTC

svn commit: r662807 - in /xmlgraphics/fop/trunk: src/documentation/content/xdocs/trunk/output.xml src/java/org/apache/fop/render/pcl/PCLGenerator.java src/java/org/apache/fop/render/pcl/PCLRenderer.java status.xml

Author: jeremias
Date: Tue Jun  3 07:13:27 2008
New Revision: 662807

URL: http://svn.apache.org/viewvc?rev=662807&view=rev
Log:
Bugzilla #45115:
Added a PCL-specific extension attribute on simple-page-master for controlling the simplex/duplex mode.
Submitted by: Martin Edge <Martin.Edge.at.asmorphic.net.au>

Modified:
    xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml?rev=662807&r1=662806&r2=662807&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml Tue Jun  3 07:13:27 2008
@@ -422,6 +422,31 @@
           Consult the technical reference for your printer for all available values.
         </p>
       </section>
+      <section id="pcl-duplex-mode">
+        <title>Page Duplex Mode</title>
+        <p>
+          The duplex-mode extension attribute on fo:simple-page-master allows to 
+          select the duplex mode to be used for a particular simple-page-master.
+          Example:
+        </p>
+      <source><![CDATA[
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple" pcl:duplex-mode="0">
+          ...
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+]]></source>
+        <p>
+          Note: the duplex is a positive integer and the value depends on
+          the target printer. Not all PCL printers support duplexing.
+          Usually, 
+          "0" is simplex,
+          "1" is duplex (long-edge binding), 
+          "2" is duplex (short-edge binding).
+
+          Consult the technical reference for your printer for all available values.
+        </p>
+      </section>
     </section>
   </section>
   <section id="afp">

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java?rev=662807&r1=662806&r2=662807&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java Tue Jun  3 07:13:27 2008
@@ -230,6 +230,19 @@
     }
 
     /**
+     * Selects the duplexing mode for the page. 
+     * The parameter is usually printer-specific. 
+     * "0" means Simplex,
+     * "1" means Duplex, Long-Edge Binding,
+     * "2" means Duplex, Short-Edge Binding.
+     * @param selector the integer representing the duplexing mode of the page
+     * @throws IOException In case of an I/O error
+     */
+    public void selectDuplexMode(int selector) throws IOException {
+        writeCommand("&l" + selector + "S");
+    }
+
+    /**
      * Clears the horizontal margins.
      * @throws IOException In case of an I/O error
      */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java?rev=662807&r1=662806&r2=662807&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java Tue Jun  3 07:13:27 2008
@@ -395,9 +395,7 @@
         return MIME_TYPE;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public void renderPage(PageViewport page) throws IOException, FOPException {
         saveGraphicsState();
 
@@ -408,6 +406,13 @@
             gen.selectPaperSource(Integer.parseInt(paperSource));
         }
 
+        // Is Page duplex?
+        String pageDuplex = page.getForeignAttributeValue(
+                new QName(PCLElementMapping.NAMESPACE, null, "duplex-mode"));
+        if (pageDuplex != null) {
+            gen.selectDuplexMode(Integer.parseInt(pageDuplex));
+        }
+
         //Page size
         final long pagewidth = Math.round(page.getViewArea().getWidth());
         final long pageheight = Math.round(page.getViewArea().getHeight());

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=662807&r1=662806&r2=662807&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Tue Jun  3 07:13:27 2008
@@ -57,6 +57,10 @@
       <action context="Renderers" dev="AC" importance="high" type="add">
         Added SVG support for AFP (GOCA).
       </action -->
+      <action context="Renderers" dev="JM" type="add" fixes-bug="45115" due-to="Martin Edge">
+        Added a PCL-specific extension attribute on simple-page-master for controlling 
+        the simplex/duplex mode.
+      </action>
       <action context="Code" dev="AD" type="fix" fixes-bug="45097">
         Corrected white-space-treatment for situations where an inline-node is the first/last
         child node of an fo:block, without preceding/following text.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org