cvs commit: xml-fop/src/org/apache/fop/render/pcl PCLRenderer.java PCLStream.java

2003-02-25 Thread jeremias
jeremias2003/02/25 06:57:53

  Modified:src/org/apache/fop/render/pcl Tag: fop-0_20_2-maintain
PCLRenderer.java PCLStream.java
  Log:
  Switched to long licence
  Cleanup of tab characters where necessary
  Cleanup of unused imports where necessary
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.13.2.8  +51 -10xml-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.7
  retrieving revision 1.13.2.8
  diff -u -r1.13.2.7 -r1.13.2.8
  --- PCLRenderer.java  26 Nov 2002 18:15:18 -  1.13.2.7
  +++ PCLRenderer.java  25 Feb 2003 14:57:53 -  1.13.2.8
  @@ -1,15 +1,57 @@
   /*
* $Id$
  - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * 
  + *The Apache Software License, Version 1.1
  + * 
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *this list of conditions and the following disclaimer in the documentation
  + *and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *include the following acknowledgment: "This product includes software
  + *developed by the Apache Software Foundation (http://www.apache.org/)."
  + *Alternately, this acknowledgment may appear in the software itself, if
  + *and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *endorse or promote products derived from this software without prior
  + *written permission. For written permission, please contact
  + *[EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *"Apache" appear in their name, without prior written permission of the
  + *Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * 
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see .
  + */ 
   package org.apache.fop.render.pcl;
   
   // FOP
   import org.apache.fop.render.PrintRenderer;
  -import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.properties.*;
   import org.apache.fop.datatypes.*;
   import org.apache.fop.pdf.PDFPathPaint;
  @@ -17,12 +59,11 @@
   import org.apache.fop.layout.*;
   import org.apache.fop.layout.inline.*;
   import org.apache.fop.image.*;
  -
   import org.apache.fop.svg.SVGArea;
  +
   import org.w3c.dom.svg.SVGSVGElement;
   import org.w3c.dom.svg.SVGDocument;
   
  -
   // Java
   import java.io.IOException;
   import java.io.OutputStream;
  @@ -333,7 +374,7 @@
   // Transfer graphics data
   for (iy = 0; iy < ih; iy++) {
   ib = 0;
  -// int   padding = iw % 8;
  +// int padding = iw % 8;
   // if ( padding != 0 )
   // padding = 8 - padding;
   // padding = 0;
  
  
  
  1.4.2.1   +49 -6   

cvs commit: xml-fop/src/org/apache/fop/render/pcl PCLRenderer.java

2002-11-26 Thread chrisg
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  ChangesPath
  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 -  1.10.2.31
  +++ CHANGES   26 Nov 2002 18:15:18 -  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 -13xml-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 -   1.13.2.6
  +++ PCLRenderer.java  26 Nov 2002 18:15:18 -  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]




cvs commit: xml-fop/src/org/apache/fop/render/pcl PCLRenderer.java

2001-10-12 Thread artw

artw01/10/12 14:36:45

  Modified:src/org/apache/fop/render/pcl PCLRenderer.java
  Log:
  Correct border printing problem.
  
  Revision  ChangesPath
  1.13  +11 -6 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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PCLRenderer.java  2001/09/11 10:04:25 1.12
  +++ PCLRenderer.java  2001/10/12 21:36:45 1.13
  @@ -1,5 +1,5 @@
   /*
  - * $Id: PCLRenderer.java,v 1.12 2001/09/11 10:04:25 keiron Exp $
  + * $Id: PCLRenderer.java,v 1.13 2001/10/12 21:36:45 artw Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -166,14 +166,16 @@
* @param stroke the stroke color/gradient
*/
   protected void addRect(int x, int y, int w, int h, PDFPathPaint stroke) {
  -if (h < 0)
  -h *= -1;
  +//if (h < 0)
  +//h *= -1;
   
  -if (h < 720 || w < 720) {
  +if ((h >= 0 && h < 720) || (h < 0 && h > -720) || w < 720) {
   if (w < 720)
   w = 720;
  -if (h < 720)
  +if (h > 0 && h < 720)
   h = 720;
  +else if (h < 0 && h > -720)
  +h = -720;
   addRect(x, y, w, h, stroke, stroke);
   } else {
   addRect(x, y, w, 720, stroke, stroke);
  @@ -198,7 +200,10 @@
   if ((w == 0) || (h == 0))
   return;
   if (h < 0)
  -h *= -1;
  +h *= -1;
  +else
  +y += h;
  +
   
   PDFColor sc = (PDFColor)stroke;
   PDFColor fc = (PDFColor)fill;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]