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 vh...@apache.org on 2008/07/24 11:37:16 UTC

svn commit: r679326 [25/33] - in /xmlgraphics/fop/trunk: examples/embedding/java/embedding/ examples/embedding/java/embedding/events/ examples/embedding/java/embedding/intermediate/ examples/embedding/java/embedding/model/ examples/embedding/java/embed...

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRenderer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRenderer.java Thu Jul 24 02:35:34 2008
@@ -121,7 +121,7 @@
  * Renderer that renders areas to PDF.
  */
 public class PDFRenderer extends AbstractPathOrientedRenderer {
-    
+
     /**
      * The mime type for pdf
      */
@@ -129,7 +129,7 @@
 
     /** Normal PDF resolution (72dpi) */
     public static final int NORMAL_PDF_RESOLUTION = 72;
-    
+
     /** PDF encryption parameter: all parameters as object, datatype: PDFEncryptionParams */
     public static final String ENCRYPTION_PARAMS = "encryption-params";
     /** PDF encryption parameter: user password, datatype: String */
@@ -158,7 +158,7 @@
 
     /** Controls whether comments are written to the PDF stream. */
     protected static final boolean WRITE_COMMENTS = true;
-    
+
     /**
      * the PDF Document being created
      */
@@ -166,10 +166,10 @@
 
     /** the PDF/A mode (Default: disabled) */
     protected PDFAMode pdfAMode = PDFAMode.DISABLED;
-    
+
     /** the PDF/X mode (Default: disabled) */
     protected PDFXMode pdfXMode = PDFXMode.DISABLED;
-    
+
     /**
      * Map of pages using the PageViewport as the key
      * this is used for prepared pages that cannot be immediately
@@ -245,10 +245,10 @@
     protected PDFICCBasedColorSpace sRGBColorSpace;
     /** controls whether the sRGB color space should be installed */
     protected boolean disableSRGBColorSpace = false;
-    
+
     /** Optional URI to an output profile to be used. */
-    protected String outputProfileURI; 
-    
+    protected String outputProfileURI;
+
     /** drawing state */
     protected PDFState currentState = null;
 
@@ -262,7 +262,7 @@
 
     /** Image handler registry */
     private PDFImageHandlerRegistry imageHandlerRegistry = new PDFImageHandlerRegistry();
-    
+
     /**
      * create the PDF renderer
      */
@@ -278,13 +278,13 @@
             throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
         }
     }
-    
+
     /**
      * {@inheritDoc}
      */
     public void setUserAgent(FOUserAgent agent) {
         super.setUserAgent(agent);
-        PDFEncryptionParams params 
+        PDFEncryptionParams params
                 = (PDFEncryptionParams)agent.getRendererOptions().get(ENCRYPTION_PARAMS);
         if (params != null) {
             this.encryptionParams = params; //overwrite if available
@@ -380,7 +380,7 @@
         }
         if (pdfXMode != PDFXMode.DISABLED) {
             log.debug(pdfXMode + " is active.");
-            log.warn("Note: " + pdfXMode 
+            log.warn("Note: " + pdfXMode
                     + " support is work-in-progress and not fully implemented, yet!");
             addPDFXOutputIntent();
         }
@@ -388,7 +388,7 @@
             log.debug("PDF/A is active. Conformance Level: " + pdfAMode);
             addPDFA1OutputIntent();
         }
-        
+
     }
 
     private void addsRGBColorSpace() throws IOException {
@@ -408,7 +408,7 @@
             this.sRGBColorSpace = PDFICCBasedColorSpace.setupsRGBAsDefaultRGBColorSpace(pdfDoc);
         }
     }
-    
+
     private void addDefaultOutputProfile() throws IOException {
         if (this.outputProfile != null) {
             return;
@@ -437,7 +437,7 @@
             outputProfile = sRGBColorSpace.getICCStream();
         }
     }
-    
+
     /**
      * Adds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces
      * are used (which is true if we use DeviceRGB to represent sRGB colors).
@@ -445,7 +445,7 @@
      */
     private void addPDFA1OutputIntent() throws IOException {
         addDefaultOutputProfile();
-        
+
         String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
         PDFOutputIntent outputIntent = pdfDoc.getFactory().makeOutputIntent();
         outputIntent.setSubtype(PDFOutputIntent.GTS_PDFA1);
@@ -462,7 +462,7 @@
      */
     private void addPDFXOutputIntent() throws IOException {
         addDefaultOutputProfile();
-        
+
         String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
         int deviceClass = this.outputProfile.getICCProfile().getProfileClass();
         if (deviceClass != ICC_Profile.CLASS_OUTPUT) {
@@ -626,7 +626,7 @@
         return new PDFGraphics2DAdapter(this);
     }
 
-    /** 
+    /**
      * writes out a comment.
      * @param text text for the comment
      */
@@ -737,7 +737,7 @@
             page.getPageIndex());
         pageReferences.put(page.getKey(), currentPage.referencePDF());
         pvReferences.put(page.getKey(), page);
-        
+
         //Produce page labels
         PDFPageLabels pageLabels = this.pdfDoc.getRoot().getPageLabels();
         if (pageLabels == null) {
@@ -745,14 +745,14 @@
             pageLabels = this.pdfDoc.getFactory().makePageLabels();
             this.pdfDoc.getRoot().setPageLabels(pageLabels);
         }
-        PDFNumsArray nums = pageLabels.getNums(); 
+        PDFNumsArray nums = pageLabels.getNums();
         PDFDictionary dict = new PDFDictionary(nums);
         dict.put("P", page.getPageNumberString());
         //TODO If the sequence of generated page numbers were inspected, this could be
         //expressed in a more space-efficient way
         nums.put(page.getPageIndex(), dict);
     }
-    
+
     /**
      * This method creates a pdf stream for the current page
      * uses it as the contents of a new page. The page is written
@@ -788,7 +788,7 @@
                 pageHeight / 1000f);
         currentState.concatenate(basicPageTransform);
         currentStream.add(CTMHelper.toPDFString(basicPageTransform, false) + " cm\n");
-        
+
         super.renderPage(page);
 
         this.pdfDoc.registerObject(currentStream);
@@ -810,9 +810,9 @@
                 new AffineTransform(CTMHelper.toPDFArray(ctm)));
 
         if (clippingRect != null) {
-            clipRect((float)clippingRect.getX() / 1000f, 
-                    (float)clippingRect.getY() / 1000f, 
-                    (float)clippingRect.getWidth() / 1000f, 
+            clipRect((float)clippingRect.getX() / 1000f,
+                    (float)clippingRect.getY() / 1000f,
+                    (float)clippingRect.getWidth() / 1000f,
                     (float)clippingRect.getHeight() / 1000f);
         }
         // multiply with current CTM
@@ -831,7 +831,7 @@
             currentStream.add(CTMHelper.toPDFString(at, false) + " cm\n");
         }
     }
-    
+
     /**
      * Formats a float value (normally coordinates) as Strings.
      * @param value the value
@@ -840,9 +840,9 @@
     protected static String format(float value) {
         return PDFNumber.doubleOut(value);
     }
-    
+
     /** {@inheritDoc} */
-    protected void drawBorderLine(float x1, float y1, float x2, float y2, 
+    protected void drawBorderLine(float x1, float y1, float x2, float y2,
             boolean horz, boolean startOrBefore, int style, Color col) {
         float w = x2 - x1;
         float h = y2 - y1;
@@ -852,7 +852,7 @@
             return;
         }
         switch (style) {
-            case Constants.EN_DASHED: 
+            case Constants.EN_DASHED:
                 setColor(col, false, null);
                 if (horz) {
                     float unit = Math.abs(2 * h);
@@ -864,7 +864,7 @@
                     currentStream.add("[" + format(unit) + "] 0 d ");
                     currentStream.add(format(h) + " w\n");
                     float ym = y1 + (h / 2);
-                    currentStream.add(format(x1) + " " + format(ym) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym) + " m "
                             + format(x2) + " " + format(ym) + " l S\n");
                 } else {
                     float unit = Math.abs(2 * w);
@@ -876,7 +876,7 @@
                     currentStream.add("[" + format(unit) + "] 0 d ");
                     currentStream.add(format(w) + " w\n");
                     float xm = x1 + (w / 2);
-                    currentStream.add(format(xm) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm) + " " + format(y1) + " m "
                             + format(xm) + " " + format(y2) + " l S\n");
                 }
                 break;
@@ -893,7 +893,7 @@
                     currentStream.add("[0 " + format(unit) + "] 0 d ");
                     currentStream.add(format(h) + " w\n");
                     float ym = y1 + (h / 2);
-                    currentStream.add(format(x1) + " " + format(ym) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym) + " m "
                             + format(x2) + " " + format(ym) + " l S\n");
                 } else {
                     float unit = Math.abs(2 * w);
@@ -905,7 +905,7 @@
                     currentStream.add("[0 " + format(unit) + " ] 0 d ");
                     currentStream.add(format(w) + " w\n");
                     float xm = x1 + (w / 2);
-                    currentStream.add(format(xm) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm) + " " + format(y1) + " m "
                             + format(xm) + " " + format(y2) + " l S\n");
                 }
                 break;
@@ -917,18 +917,18 @@
                     currentStream.add(format(h3) + " w\n");
                     float ym1 = y1 + (h3 / 2);
                     float ym2 = ym1 + h3 + h3;
-                    currentStream.add(format(x1) + " " + format(ym1) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym1) + " m "
                             + format(x2) + " " + format(ym1) + " l S\n");
-                    currentStream.add(format(x1) + " " + format(ym2) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym2) + " m "
                             + format(x2) + " " + format(ym2) + " l S\n");
                 } else {
                     float w3 = w / 3;
                     currentStream.add(format(w3) + " w\n");
                     float xm1 = x1 + (w3 / 2);
                     float xm2 = xm1 + w3 + w3;
-                    currentStream.add(format(xm1) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm1) + " " + format(y1) + " m "
                             + format(xm1) + " " + format(y2) + " l S\n");
-                    currentStream.add(format(xm2) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm2) + " " + format(y1) + " m "
                             + format(xm2) + " " + format(y2) + " l S\n");
                 }
                 break;
@@ -944,13 +944,13 @@
                     currentStream.add(format(h3) + " w\n");
                     float ym1 = y1 + (h3 / 2);
                     setColor(uppercol, false, null);
-                    currentStream.add(format(x1) + " " + format(ym1) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym1) + " m "
                             + format(x2) + " " + format(ym1) + " l S\n");
                     setColor(col, false, null);
-                    currentStream.add(format(x1) + " " + format(ym1 + h3) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
                                         + format(x2) + " " + format(ym1 + h3) + " l S\n");
                     setColor(lowercol, false, null);
-                    currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
                                         + format(x2) + " " + format(ym1 + h3 + h3) + " l S\n");
                 } else {
                     Color leftcol = lightenColor(col, -colFactor);
@@ -959,13 +959,13 @@
                     currentStream.add(format(w3) + " w\n");
                     float xm1 = x1 + (w3 / 2);
                     setColor(leftcol, false, null);
-                    currentStream.add(format(xm1) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm1) + " " + format(y1) + " m "
                             + format(xm1) + " " + format(y2) + " l S\n");
                     setColor(col, false, null);
-                    currentStream.add(format(xm1 + w3) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
                                         + format(xm1 + w3) + " " + format(y2) + " l S\n");
                     setColor(rightcol, false, null);
-                    currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
                                         + format(xm1 + w3 + w3) + " " + format(y2) + " l S\n");
                 }
                 break;
@@ -981,14 +981,14 @@
                     currentStream.add(format(h) + " w\n");
                     float ym1 = y1 + (h / 2);
                     setColor(c, false, null);
-                    currentStream.add(format(x1) + " " + format(ym1) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym1) + " m "
                             + format(x2) + " " + format(ym1) + " l S\n");
                 } else {
                     c = lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
                     currentStream.add(format(w) + " w\n");
                     float xm1 = x1 + (w / 2);
                     setColor(c, false, null);
-                    currentStream.add(format(xm1) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm1) + " " + format(y1) + " m "
                             + format(xm1) + " " + format(y2) + " l S\n");
                 }
                 break;
@@ -1001,17 +1001,17 @@
                 if (horz) {
                     currentStream.add(format(h) + " w\n");
                     float ym = y1 + (h / 2);
-                    currentStream.add(format(x1) + " " + format(ym) + " m " 
+                    currentStream.add(format(x1) + " " + format(ym) + " m "
                             + format(x2) + " " + format(ym) + " l S\n");
                 } else {
                     currentStream.add(format(w) + " w\n");
                     float xm = x1 + (w / 2);
-                    currentStream.add(format(xm) + " " + format(y1) + " m " 
+                    currentStream.add(format(xm) + " " + format(y1) + " m "
                             + format(xm) + " " + format(y2) + " l S\n");
                 }
         }
     }
-    
+
     /**
      * Sets the current line width in points.
      * @param width line width in points
@@ -1022,10 +1022,10 @@
             currentStream.add(format(width) + " w\n");
         }
     }
-    
+
     /** {@inheritDoc} */
     protected void clipRect(float x, float y, float width, float height) {
-        currentStream.add(format(x) + " " + format(y) + " " 
+        currentStream.add(format(x) + " " + format(y) + " "
                 + format(width) + " " + format(height) + " re ");
         clip();
     }
@@ -1039,42 +1039,42 @@
     }
 
     /**
-     * Moves the current point to (x, y), omitting any connecting line segment. 
+     * Moves the current point to (x, y), omitting any connecting line segment.
      * @param x x coordinate
      * @param y y coordinate
      */
     protected void moveTo(float x, float y) {
         currentStream.add(format(x) + " " + format(y) + " m ");
     }
-    
+
     /**
-     * Appends a straight line segment from the current point to (x, y). The 
-     * new current point is (x, y). 
+     * Appends a straight line segment from the current point to (x, y). The
+     * new current point is (x, y).
      * @param x x coordinate
      * @param y y coordinate
      */
     protected void lineTo(float x, float y) {
         currentStream.add(format(x) + " " + format(y) + " l ");
     }
-    
+
     /**
-     * Closes the current subpath by appending a straight line segment from 
+     * Closes the current subpath by appending a straight line segment from
      * the current point to the starting point of the subpath.
      */
     protected void closePath() {
         currentStream.add("h ");
     }
 
-    /** 
-     * {@inheritDoc} 
+    /**
+     * {@inheritDoc}
      */
     protected void fillRect(float x, float y, float w, float h) {
         if (w != 0 && h != 0) {
-            currentStream.add(format(x) + " " + format(y) + " " 
+            currentStream.add(format(x) + " " + format(y) + " "
                     + format(w) + " " + format(h) + " re f\n");
         }
     }
-    
+
     /**
      * Draw a line.
      *
@@ -1130,7 +1130,7 @@
     }
 
     /**
-     * Returns area's id if it is the first area in the document with that id 
+     * Returns area's id if it is the first area in the document with that id
      * (i.e. if the area qualifies as a link target).
      * Otherwise, or if the area has no id, null is returned.
      *
@@ -1215,7 +1215,7 @@
      * @param pdfPageRef the PDF page reference string
      * @param relativeIPP the *relative* IP position in millipoints
      * @param relativeBPP the *relative* BP position in millipoints
-     * @param tf the transformation to apply once the relative positions have been 
+     * @param tf the transformation to apply once the relative positions have been
      *           converted to points
      */
     protected void saveAbsolutePosition(String id, String pdfPageRef,
@@ -1257,13 +1257,13 @@
      * @param relativeBPP the *relative* BP position in millipoints
      */
     protected void saveAbsolutePosition(String id, int relativeIPP, int relativeBPP) {
-        saveAbsolutePosition(id, currentPageRef, 
+        saveAbsolutePosition(id, currentPageRef,
                              relativeIPP, relativeBPP, currentState.getTransform());
     }
 
     /**
-     * If the given block area is a possible link target, its id + absolute position will 
-     * be saved. The saved position is only correct if this function is called at the very 
+     * If the given block area is a possible link target, its id + absolute position will
+     * be saved. The saved position is only correct if this function is called at the very
      * start of renderBlock!
      *
      * @param block the block area in question
@@ -1391,7 +1391,7 @@
         // warn if link trait found but not allowed, else create link
         if (linkTraitFound) {
             if (!annotsAllowed) {
-                log.warn("Skipping annotation for a link due to PDF profile: " 
+                log.warn("Skipping annotation for a link due to PDF profile: "
                          + pdfDoc.getProfile());
             } else if (action != null) {
                 PDFLink pdfLink = factory.makeLink(ipRect, action);
@@ -1407,23 +1407,23 @@
         }
         return tf;
     }
-    
+
     /** {@inheritDoc} */
     public void renderText(TextArea text) {
         renderInlineAreaBackAndBorders(text);
         Color ct = (Color) text.getTrait(Trait.COLOR);
         updateColor(ct, true);
-        
+
         beginTextObject();
 
         String fontName = getInternalFontNameForArea(text);
         int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
-        
+
         // This assumes that *all* CIDFonts use a /ToUnicode mapping
         Typeface tf = getTypeface(fontName);
-        
+
         textutil.updateTf(fontName, size / 1000f, tf.isMultiByte());
-        
+
 
         // word.getOffset() = only height of text itself
         // currentBlockIPPosition: 0 for beginning of line; nonzero
@@ -1436,7 +1436,7 @@
         super.renderText(text);
 
         textutil.writeTJ();
-        
+
         renderTextDecoration(tf, size, text, bl, rx);
     }
 
@@ -1445,7 +1445,7 @@
         Font font = getFontFromArea(word.getParentArea());
         String s = word.getWord();
 
-        escapeText(s, word.getLetterAdjustArray(), 
+        escapeText(s, word.getLetterAdjustArray(),
                 font, (AbstractTextArea)word.getParentArea());
 
         super.renderWord(word);
@@ -1455,7 +1455,7 @@
     public void renderSpace(SpaceArea space) {
         Font font = getFontFromArea(space.getParentArea());
         String s = space.getSpace();
-        
+
         AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
         escapeText(s, null, font, textArea);
 
@@ -1484,7 +1484,7 @@
                            Font font, AbstractTextArea parentArea) {
         escapeText(s, 0, s.length(), letterAdjust, font, parentArea);
     }
-    
+
     /**
      * Escapes text according to PDF rules.
      * @param s Text to escape
@@ -1506,7 +1506,7 @@
         }
 
         int l = s.length();
-        
+
         for (int i = start; i < end; i++) {
             char orgChar = s.charAt(i);
             char ch;
@@ -1552,7 +1552,7 @@
     /**
      * Establishes a new foreground or fill color. In contrast to updateColor
      * this method does not check the PDFState for optimization possibilities.
-     * @param col the color to apply 
+     * @param col the color to apply
      * @param fill true to set the fill color, false for the foreground color
      * @param pdf StringBuffer to write the PDF code to, if null, the code is
      *     written to the current stream.
@@ -1566,7 +1566,7 @@
             currentStream.add(color.getColorSpaceOut(fill));
         }
     }
-    
+
     /**
      * Establishes a new foreground or fill color.
      * @param col the color to apply (null skips this operation)
@@ -1594,7 +1594,7 @@
     protected void updateColor(Color col, boolean fill) {
         updateColor(col, fill, null);
     }
-    
+
     /** {@inheritDoc} */
     public void renderImage(Image image, Rectangle2D pos) {
         endTextObject();
@@ -1607,7 +1607,7 @@
         endTextObject();
         putImage(url, pos, foreignAttributes);
     }
-    
+
     /**
      * Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
      * @param uri URL of the bitmap
@@ -1617,7 +1617,7 @@
     protected void putImage(String uri, Rectangle2D pos) {
         putImage(uri, pos, null);
     }
-    
+
     /**
      * Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
      * @param uri URL of the bitmap
@@ -1649,11 +1649,11 @@
         try {
             ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
             info = manager.getImageInfo(uri, sessionContext);
-            
+
             Map hints = ImageUtil.getDefaultHints(sessionContext);
             org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                         info, imageHandlerRegistry.getSupportedFlavors(), hints, sessionContext);
-            
+
             //First check for a dynamically registered handler
             PDFImageHandler handler = imageHandlerRegistry.getHandler(img.getClass());
             if (handler != null) {
@@ -1710,13 +1710,13 @@
         currentStream.add(format(w) + " 0 0 "
                           + format(-h) + " "
                           + format(currentIPPosition / 1000f + x) + " "
-                          + format(currentBPPosition / 1000f + h + y) 
+                          + format(currentBPPosition / 1000f + h + y)
                           + " cm\n" + xobj.getName() + " Do\n");
         restoreGraphicsState();
     }
 
     /** {@inheritDoc} */
-    protected RendererContext createRendererContext(int x, int y, int width, int height, 
+    protected RendererContext createRendererContext(int x, int y, int width, int height,
             Map foreignAttributes) {
         RendererContext context = super.createRendererContext(
                 x, y, width, height, foreignAttributes);
@@ -1747,7 +1747,7 @@
         int style = area.getRuleStyle();
         float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
         float starty = (currentBPPosition + area.getOffset()) / 1000f;
-        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart() 
+        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
                         + area.getIPD()) / 1000f;
         float ruleThickness = area.getRuleThickness() / 1000f;
         Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1756,7 +1756,7 @@
             case EN_SOLID:
             case EN_DASHED:
             case EN_DOUBLE:
-                drawBorderLine(startx, starty, endx, starty + ruleThickness, 
+                drawBorderLine(startx, starty, endx, starty + ruleThickness,
                         true, true, style, col);
                 break;
             case EN_DOTTED:
@@ -1764,7 +1764,7 @@
                 //This displaces the dots to the right by half a dot's width
                 //TODO There's room for improvement here
                 currentStream.add("1 0 0 1 " + format(ruleThickness / 2) + " 0 cm\n");
-                drawBorderLine(startx, starty, endx, starty + ruleThickness, 
+                drawBorderLine(startx, starty, endx, starty + ruleThickness,
                         true, true, style, col);
                 break;
             case EN_GROOVE:
@@ -1809,7 +1809,7 @@
     public String getMimeType() {
         return MIME_TYPE;
     }
-    
+
     /**
      * Sets the PDF/A mode for the PDF renderer.
      * @param mode the PDF/A mode
@@ -1823,7 +1823,7 @@
      * @param mode the PDF/X mode
      */
     public void setXMode(PDFXMode mode) {
-        this.pdfXMode = mode;        
+        this.pdfXMode = mode;
     }
 
     /**
@@ -1844,7 +1844,7 @@
 
     /**
      * Sets the encryption parameters used by the PDF renderer.
-     * @param encryptionParams the encryption parameters 
+     * @param encryptionParams the encryption parameters
      */
     public void setEncryptionParams(PDFEncryptionParams encryptionParams) {
         this.encryptionParams = encryptionParams;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@
 import org.apache.fop.util.LogUtil;
 
 /**
- * PDF renderer configurator 
+ * PDF renderer configurator
  */
 public class PDFRendererConfigurator extends PrintRendererConfigurator {
 
@@ -68,9 +68,9 @@
             } catch (ConfigurationException e) {
                 LogUtil.handleException(log, e, false);
             }
-    
+
             super.configure(renderer);
-    
+
             String s = cfg.getChild(PDFRenderer.PDF_A_MODE, true).getValue(null);
             if (s != null) {
                 pdfRenderer.setAMode(PDFAMode.valueOf(s));
@@ -137,7 +137,7 @@
      * @return Map the newly built filter map
      * @throws ConfigurationException if a filter list is defined twice
      */
-    public static Map buildFilterMapFromConfiguration(Configuration cfg) 
+    public static Map buildFilterMapFromConfiguration(Configuration cfg)
                 throws ConfigurationException {
         Map filterMap = new java.util.HashMap();
         Configuration[] filterLists = cfg.getChildren("filterList");
@@ -150,11 +150,11 @@
                 String name = filt[j].getValue();
                 filterList.add(name);
             }
-            
+
             if (type == null) {
                 type = PDFFilterList.DEFAULT_FILTER;
             }
-    
+
             if (!filterList.isEmpty() && log.isDebugEnabled()) {
                 StringBuffer debug = new StringBuffer("Adding PDF filter");
                 if (filterList.size() != 1) {
@@ -169,13 +169,13 @@
                 }
                 log.debug(debug.toString());
             }
-            
+
             if (filterMap.get(type) != null) {
-                throw new ConfigurationException("A filterList of type '" 
+                throw new ConfigurationException("A filterList of type '"
                     + type + "' has already been defined");
             }
             filterMap.put(type, filterList);
         }
-        return filterMap;                
+        return filterMap;
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java Thu Jul 24 02:35:34 2008
@@ -49,5 +49,5 @@
 
     /** The current pdf font size. */
     String PDF_FONT_SIZE = "fontSize";
-    
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@
 public class PDFRendererMaker extends AbstractRendererMaker {
 
     private static final String[] MIMES = new String[] {MimeConstants.MIME_PDF};
-    
+
     /** {@inheritDoc} */
     public Renderer makeRenderer(FOUserAgent userAgent) {
         return new PDFRenderer();
@@ -41,7 +41,7 @@
     public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
         return new PDFRendererConfigurator(userAgent);
     }
-    
+
     /** {@inheritDoc} */
     public boolean needsOutputStream() {
         return true;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -62,7 +62,7 @@
  * It renders SVG to the PDF document using the PDFGraphics2D.
  * The properties from the PDF renderer are subject to change.
  */
-public class PDFSVGHandler extends AbstractGenericSVGHandler 
+public class PDFSVGHandler extends AbstractGenericSVGHandler
             implements PDFRendererContextConstants {
 
     /** logging instance */
@@ -92,7 +92,7 @@
         pdfi.cfg = (Configuration)context.getProperty(HANDLER_CONFIGURATION);
         Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
         QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
-        if (foreign != null 
+        if (foreign != null
                 && "bitmap".equalsIgnoreCase((String)foreign.get(qName))) {
             pdfi.paintAsBitmap = true;
         }
@@ -155,12 +155,12 @@
         int xOffset = pdfInfo.currentXPosition;
         int yOffset = pdfInfo.currentYPosition;
 
-        FOUserAgent userAgent = context.getUserAgent(); 
+        FOUserAgent userAgent = context.getUserAgent();
         final float deviceResolution = userAgent.getTargetResolution();
         if (log.isDebugEnabled()) {
             log.debug("Generating SVG at " + deviceResolution + "dpi.");
         }
-        
+
         final float uaResolution = userAgent.getSourceResolution();
         SVGUserAgent ua = new SVGUserAgent(userAgent, new AffineTransform());
 
@@ -168,22 +168,22 @@
         double s = uaResolution / deviceResolution;
         AffineTransform resolutionScaling = new AffineTransform();
         resolutionScaling.scale(s, s);
-        
+
         GVTBuilder builder = new GVTBuilder();
-        
+
         //Controls whether text painted by Batik is generated using text or path operations
         boolean strokeText = false;
         Configuration cfg = pdfInfo.cfg;
         if (cfg != null) {
             strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
         }
-        
-        BridgeContext ctx = new PDFBridgeContext(ua, 
+
+        BridgeContext ctx = new PDFBridgeContext(ua,
                 (strokeText ? null : pdfInfo.fi),
                 userAgent.getFactory().getImageManager(),
                 userAgent.getImageSessionContext(),
                 new AffineTransform());
-        
+
         GraphicsNode root;
         try {
             root = builder.build(ctx, doc);
@@ -210,7 +210,7 @@
         AffineTransform imageTransform = new AffineTransform();
         imageTransform.concatenate(scaling);
         imageTransform.concatenate(resolutionScaling);
-        
+
         /*
          * Clip to the svg area.
          * Note: To have the svg overlay (under) a text area then use
@@ -231,27 +231,27 @@
         if (pdfInfo.pdfContext == null) {
             pdfInfo.pdfContext = pdfInfo.pdfPage;
         }
-        PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi, 
+        PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
                 pdfInfo.pdfDoc,
                 pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
                 pdfInfo.currentFontName, pdfInfo.currentFontSize);
         graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
 
         if (!resolutionScaling.isIdentity()) {
-            pdfInfo.currentStream.add("%resolution scaling for " + uaResolution 
+            pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
                         + " -> " + deviceResolution + "\n");
             pdfInfo.currentStream.add(
                     CTMHelper.toPDFString(resolutionScaling, false) + " cm\n");
             graphics.scale(1 / s, 1 / s);
         }
-        
+
         pdfInfo.currentStream.add("%SVG start\n");
 
         //Save state and update coordinate system for the SVG image
         pdfInfo.pdfState.push();
         pdfInfo.pdfState.concatenate(imageTransform);
 
-        //Now that we have the complete transformation matrix for the image, we can update the 
+        //Now that we have the complete transformation matrix for the image, we can update the
         //transformation matrix for the AElementBridge.
         PDFAElementBridge aBridge = (PDFAElementBridge)ctx.getBridge(
                 SVGDOMImplementation.SVG_NAMESPACE_URI, SVGConstants.SVG_A_TAG);
@@ -271,7 +271,7 @@
         renderer.restoreGraphicsState();
         pdfInfo.currentStream.add("%SVG end\n");
     }
-    
+
     /** {@inheritDoc} */
     public boolean supportsRenderer(Renderer renderer) {
         return (renderer instanceof PDFRenderer);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PageableRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PageableRenderer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PageableRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PageableRenderer.java Thu Jul 24 02:35:34 2008
@@ -57,8 +57,8 @@
      * datatype: a positive Integer
      */
     public static final String END_PAGE = "end-page";
-    
-    
+
+
     /** first valid page number (1-based) */
     protected int startNumber = 0;
     /** last valid page number (1-based) */
@@ -68,17 +68,17 @@
     protected PagesMode mode = PagesMode.ALL;
 
     private PageFilter pageFilter;
-    
+
     /**
      * Creates a new PageableRenderer.
      */
     public PageableRenderer() {
     }
-    
+
     /** {@inheritDoc} */
     public void setUserAgent(FOUserAgent agent) {
         super.setUserAgent(agent);
-        
+
         Map rendererOptions = agent.getRendererOptions();
         processOptions(rendererOptions);
         this.pageFilter = new DefaultPageFilter();
@@ -97,7 +97,7 @@
                         + " must be an 'all', 'even', 'odd' or a PagesMode instance.");
             }
         }
-        
+
         o = rendererOptions.get(PageableRenderer.START_PAGE);
         if (o != null) {
             this.startNumber = getPositiveInteger(o);
@@ -132,7 +132,7 @@
                     "Value must be a positive integer");
         }
     }
-    
+
     /** {@inheritDoc} */
     public void stopRenderer() throws IOException {
         super.stopRenderer();
@@ -149,13 +149,13 @@
             super.rememberPage(pageViewport);
         }
     }
-    
+
     private interface PageFilter {
         boolean isValid(PageViewport page);
     }
 
     private class DefaultPageFilter implements PageFilter {
-        
+
         public boolean isValid(PageViewport page) {
             int pageNum = page.getPageIndex() + 1;
             assert pageNum >= 0;
@@ -171,7 +171,7 @@
             return true;
         }
     }
-    
+
     /** {@inheritDoc} */
     public PageFormat getPageFormat(int pageIndex)
             throws IndexOutOfBoundsException {
@@ -179,15 +179,15 @@
             if (pageIndex >= getNumberOfPages()) {
                 return null;
             }
-    
+
             PageFormat pageFormat = new PageFormat();
-    
+
             Paper paper = new Paper();
-    
+
             Rectangle2D dim = getPageViewport(pageIndex).getViewArea();
             double width = dim.getWidth();
             double height = dim.getHeight();
-    
+
             // if the width is greater than the height assume landscape mode
             // and swap the width and height values in the paper format
             if (width > height) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PagesMode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PagesMode.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PagesMode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PagesMode.java Thu Jul 24 02:35:34 2008
@@ -28,7 +28,7 @@
     public static final PagesMode EVEN = new PagesMode("even");
     /** the odd pages mode */
     public static final PagesMode ODD = new PagesMode("odd");
-    
+
     private String name;
 
     /**
@@ -43,7 +43,7 @@
     public String getName() {
         return this.name;
     }
-    
+
     /**
      * Returns a PagesMode instance by name.
      * @param name the name of the pages mode
@@ -60,10 +60,10 @@
             throw new IllegalArgumentException("Invalid value for PagesMode: " + name);
         }
     }
-    
+
     /** {@inheritDoc} */
     public String toString() {
         return "PagesMode:" + name;
     }
-    
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRenderer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRenderer.java Thu Jul 24 02:35:34 2008
@@ -39,14 +39,14 @@
      * datatype: java.awt.print.PrinterJob
      */
     public static final String PRINTER_JOB = "printerjob";
-  
+
     /**
      * Printing parameter: the number of copies of the document to be printed,
      * datatype: a positive Integer
      */
     public static final String COPIES = "copies";
-    
-    
+
+
     private int copies = 1;
 
     private PrinterJob printerJob;
@@ -57,7 +57,7 @@
      */
     public PrintRenderer() {
     }
-    
+
     /**
      * Creates a new PrintRenderer and allows you to pass in a specific PrinterJob instance
      * that this renderer should work with.
@@ -69,7 +69,7 @@
         this.printerJob = printerJob;
         printerJob.setPageable(this);
     }
-    
+
     private void initializePrinterJob() {
         if (this.printerJob == null) {
             printerJob = PrinterJob.getPrinterJob();
@@ -88,9 +88,9 @@
     /** {@inheritDoc} */
     public void setUserAgent(FOUserAgent agent) {
         super.setUserAgent(agent);
-        
+
         Map rendererOptions = agent.getRendererOptions();
-        
+
         Object printerJobO = rendererOptions.get(PrintRenderer.PRINTER_JOB);
         if (printerJobO != null) {
             if (!(printerJobO instanceof PrinterJob)) {
@@ -118,7 +118,7 @@
     public int getEndNumber() {
         return endNumber;
     }
-    
+
     /**
      * Sets the number of the last page to be printed.
      * @param end The ending page number
@@ -126,12 +126,12 @@
     public void setEndPage(int end) {
         this.endNumber = end;
     }
-    
+
     /** @return the starting page number */
     public int getStartPage() {
         return startNumber;
     }
-    
+
     /**
      * Sets the number of the first page to be printed.
      * @param start The starting page number
@@ -139,7 +139,7 @@
     public void setStartPage(int start) {
         this.startNumber = start;
     }
-    
+
     /** {@inheritDoc} */
     public void stopRenderer() throws IOException {
         super.stopRenderer();

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRendererMaker.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRendererMaker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/print/PrintRendererMaker.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@
 public class PrintRendererMaker extends AbstractRendererMaker {
 
     private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_PRINT};
-    
+
     /**{@inheritDoc} */
     public Renderer makeRenderer(FOUserAgent userAgent) {
         return new PrintRenderer();

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/EPSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/EPSTranscoder.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/EPSTranscoder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/EPSTranscoder.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
  */
 
 /* $Id$ */
- 
+
 package org.apache.fop.render.ps;
 
 import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@
  * ImageEncoder implementation for CCITT encoded images.
  */
 public class ImageEncoderCCITTFax implements ImageEncoder {
-    
+
     private final ImageRawCCITTFax ccitt;
 
     /**
@@ -66,7 +66,7 @@
             throw new IllegalStateException(
                     "Invalid compression scheme: " + compression);
         }
-        
+
         return dict.toString() + " /CCITTFaxDecode";
     }
 }
\ No newline at end of file

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSEventProducer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSEventProducer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSEventProducer.java Thu Jul 24 02:35:34 2008
@@ -31,7 +31,7 @@
 
     /** Provider class for the event producer. */
     class Provider {
-        
+
         /**
          * Returns an event producer.
          * @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@
         public EventModel createEventModel() {
             return loadModel(getClass(), "event-model.xml");
         }
-        
+
     }
-    
+
     /**
      * A PostScript dictionary could not be parsed.
      * @param source the event source
@@ -61,5 +61,5 @@
      * @event.severity ERROR
      */
     void postscriptDictionaryParseError(Object source, String content, Exception e);
-    
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSFontUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSFontUtils.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSFontUtils.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSFontUtils.java Thu Jul 24 02:35:34 2008
@@ -55,7 +55,7 @@
 
     /** logging instance */
     protected static Log log = LogFactory.getLog(PSFontUtils.class);
-    
+
     /**
      * Generates the PostScript code for the font dictionary.
      * @param gen PostScript generator to use for output
@@ -63,11 +63,11 @@
      * @return a Map of PSResource instances representing all defined fonts (key: font key)
      * @throws IOException in case of an I/O problem
      */
-    public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo) 
+    public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo)
                 throws IOException {
         return writeFontDict(gen, fontInfo, fontInfo.getFonts());
     }
-    
+
     /**
      * Generates the PostScript code for the font dictionary.
      * @param gen PostScript generator to use for output
@@ -76,7 +76,7 @@
      * @return a Map of PSResource instances representing all defined fonts (key: font key)
      * @throws IOException in case of an I/O problem
      */
-    public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts) 
+    public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts)
                 throws IOException {
         gen.commentln("%FOPBeginFontDict");
 
@@ -88,7 +88,7 @@
             PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getFontName());
             fontResources.put(key, fontRes);
             embedFont(gen, tf, fontRes);
-            
+
             if (tf instanceof SingleByteFont) {
                 SingleByteFont sbf = (SingleByteFont)tf;
                 for (int i = 0, c = sbf.getAdditionalEncodingCount(); i < c; i++) {
@@ -108,12 +108,12 @@
 
     private static void reencodeFonts(PSGenerator gen, Map fonts) throws IOException {
         ResourceTracker tracker = gen.getResourceTracker();
-        
+
         if (!tracker.isResourceSupplied(WINANSI_ENCODING_RESOURCE)) {
             defineWinAnsiEncoding(gen);
         }
         gen.commentln("%FOPBeginFontReencode");
-        
+
         //Rewrite font encodings
         Iterator iter = fonts.keySet().iterator();
         while (iter.hasNext()) {
@@ -133,7 +133,7 @@
                 //ignore (no encoding redefinition)
             } else {
                 if (tf instanceof Base14Font) {
-                    //Our Base 14 fonts don't use the default encoding 
+                    //Our Base 14 fonts don't use the default encoding
                     redefineFontEncoding(gen, tf.getFontName(), tf.getEncodingName());
                 }
             }
@@ -149,7 +149,7 @@
         if (tf == null) {
             //This is to avoid an NPE if a malconfigured font is in the configuration but not
             //used in the document. If it were used, we wouldn't get this far.
-            String fallbackKey = fontInfo.getInternalFontKey(Font.DEFAULT_FONT); 
+            String fallbackKey = fontInfo.getInternalFontKey(Font.DEFAULT_FONT);
             tf = (Typeface)fonts.get(fallbackKey);
         }
         return tf;
@@ -162,7 +162,7 @@
      * @param fontRes the PSResource associated with the font
      * @throws IOException In case of an I/O error
      */
-    public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes) 
+    public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes)
                 throws IOException {
         boolean embeddedFont = false;
         if (FontType.TYPE1 == tf.getFontType()) {
@@ -171,7 +171,7 @@
                 if (isEmbeddable(cf)) {
                     InputStream in = getInputStreamOnFont(gen, cf);
                     if (in != null) {
-                        gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE, 
+                        gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE,
                                 fontRes);
                         embedType1Font(gen, in);
                         gen.writeDSCComment(DSCConstants.END_RESOURCE);
@@ -193,8 +193,8 @@
     private static boolean isEmbeddable(CustomFont font) {
         return font.isEmbeddable();
     }
-    
-    private static InputStream getInputStreamOnFont(PSGenerator gen, CustomFont font) 
+
+    private static InputStream getInputStreamOnFont(PSGenerator gen, CustomFont font)
                 throws IOException {
         if (isEmbeddable(font)) {
             Source source = font.getEmbedFileSource();
@@ -239,7 +239,7 @@
      * @param fonts the set of fonts to work with
      * @return a Map of PSResource instances representing all defined fonts (key: font key)
      */
-    public static Map determineSuppliedFonts(ResourceTracker resTracker, 
+    public static Map determineSuppliedFonts(ResourceTracker resTracker,
             FontInfo fontInfo, Map fonts) {
         Map fontResources = new java.util.HashMap();
         Iterator iter = fonts.keySet().iterator();
@@ -337,5 +337,5 @@
         gen.getResourceTracker().registerSuppliedResource(res);
         return res;
     }
-    
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
  */
 
 /* $Id$ */
- 
+
 package org.apache.fop.render.ps;
 
 import java.awt.Dimension;
@@ -46,7 +46,7 @@
     public PSGraphics2DAdapter(PSRenderer renderer) {
         this(renderer.gen, true);
     }
-    
+
     /**
      * Constructor for use without a PSRenderer instance.
      * @param gen the PostScript generator
@@ -56,16 +56,16 @@
         this.gen = gen;
         this.clip = clip;
     }
-    
+
     /** {@inheritDoc} */
-    public void paintImage(Graphics2DImagePainter painter, 
+    public void paintImage(Graphics2DImagePainter painter,
             RendererContext context,
             int x, int y, int width, int height) throws IOException {
         float fwidth = width / 1000f;
         float fheight = height / 1000f;
         float fx = x / 1000f;
         float fy = y / 1000f;
-        
+
         // get the 'width' and 'height' attributes of the SVG document
         Dimension dim = painter.getImageSize();
         float imw = (float)dim.getWidth() / 1000f;
@@ -82,7 +82,7 @@
             gen.defineRect(fx, fy, fwidth, fheight);
             gen.writeln("clip");
         }
-        
+
         // transform so that the coordinates (0,0) is from the top left
         // and positive is down and to the right. (0,0) is where the
         // viewBox puts it.

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageFormResource.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageFormResource.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageFormResource.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageFormResource.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@
 public class PSImageFormResource extends PSResource {
 
     private String uri;
-    
+
     /**
      * Create a new Form Resource.
      * @param id An ID for the form
@@ -37,7 +37,7 @@
     public PSImageFormResource(int id, String uri) {
         this("FOPForm:" + Integer.toString(id), uri);
     }
-    
+
     /**
     /**
      * Create a new Form Resource.
@@ -48,7 +48,7 @@
         super(PSResource.TYPE_FORM, name);
         this.uri = uri;
     }
-    
+
     /**
      * Returns the image URI.
      * @return the image URI
@@ -56,5 +56,5 @@
     public String getImageURI() {
         return this.uri;
     }
-    
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageUtils.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageUtils.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageUtils.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
  */
 
 /* $Id$ */
- 
+
 package org.apache.fop.render.ps;
 
 /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -121,7 +121,7 @@
  * <br>
  * This renderer inserts FOP-specific comments into the PostScript stream which
  * may help certain users to do certain types of post-processing of the output.
- * These comments all start with "%FOP". 
+ * These comments all start with "%FOP".
  *
  * @author <a href="mailto:fop-dev@xmlgraphics.apache.org">Apache FOP Development Team</a>
  * @version $Id$
@@ -150,7 +150,7 @@
     private OutputStream outputStream;
     /** the temporary file in case of two-pass processing */
     private File tempFile;
-    
+
     /** The PostScript generator used to output the PostScript */
     protected PSGenerator gen;
     /** Determines whether the PS file is generated in two passes to minimize file size */
@@ -181,13 +181,13 @@
 
     /** Is used to determine the document's bounding box */
     private Rectangle2D documentBoundingBox;
-    
+
     /** This is a collection holding all document header comments */
     private Collection headerComments;
 
     /** This is a collection holding all document footer comments */
     private Collection footerComments;
-    
+
     /** {@inheritDoc} */
     public void setUserAgent(FOUserAgent agent) {
         super.setUserAgent(agent);
@@ -215,7 +215,7 @@
             throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
         }
     }
-    
+
     private int intValueOf(Object obj) {
         if (obj instanceof Integer) {
             return ((Integer)obj).intValue();
@@ -225,11 +225,11 @@
             throw new IllegalArgumentException("Integer or String with a number expected.");
         }
     }
-    
+
     /**
      * Sets the landscape mode for this renderer.
      * @param value false will normally generate a "pseudo-portrait" page, true will rotate
-     *              a "wider-than-long" page by 90 degrees. 
+     *              a "wider-than-long" page by 90 degrees.
      */
     public void setAutoRotateLandscape(boolean value) {
         this.autoRotateLandscape = value;
@@ -251,7 +251,7 @@
             throw new IllegalArgumentException("Only language levels 2 or 3 are allowed/supported");
         }
     }
-    
+
     /**
      * Return the PostScript language level that the renderer produces.
      * @return the language level
@@ -259,12 +259,12 @@
     public int getLanguageLevel() {
         return this.languageLevel;
     }
-    
+
     /**
      * Sets the resource optimization mode. If set to true, the renderer does two passes to
      * only embed the necessary resources in the PostScript file. This is slower, but produces
      * smaller files.
-     * @param value true to enable the resource optimization 
+     * @param value true to enable the resource optimization
      */
     public void setOptimizeResources(boolean value) {
         this.twoPassGeneration = value;
@@ -335,7 +335,7 @@
     protected void clip() {
         writeln("clip newpath");
     }
-    
+
     /** {@inheritDoc} */
     protected void clipRect(float x, float y, float width, float height) {
         try {
@@ -350,27 +350,27 @@
     protected void moveTo(float x, float y) {
         writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " M");
     }
-    
+
     /**
-     * Moves the current point by (x, y) relative to the current position, 
-     * omitting any connecting line segment. 
+     * Moves the current point by (x, y) relative to the current position,
+     * omitting any connecting line segment.
      * @param x x coordinate
      * @param y y coordinate
      */
     protected void rmoveTo(float x, float y) {
         writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " RM");
     }
-    
+
     /** {@inheritDoc} */
     protected void lineTo(float x, float y) {
         writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " lineto");
     }
-    
+
     /** {@inheritDoc} */
     protected void closePath() {
         writeln("cp");
     }
-    
+
     /** {@inheritDoc} */
     protected void fillRect(float x, float y, float width, float height) {
         if (width != 0 && height != 0) {
@@ -400,7 +400,7 @@
     protected boolean isImageInlined(String uri) {
         return !isOptimizeResources() || uri == null || "".equals(uri);
     }
-    
+
     /**
      * Indicates whether an image should be inlined or added as a PostScript form.
      * @param info the ImageInfo object of the image
@@ -410,7 +410,7 @@
         if (isImageInlined(info.getOriginalURI())) {
             return true;
         }
-        
+
         if (!isOptimizeResources()) {
             throw new IllegalStateException("Must not get here if form support is enabled");
         }
@@ -423,7 +423,7 @@
                     info, inlineFlavors);
         ImageProviderPipeline inlineChoice = manager.choosePipeline(inlineCandidates);
         ImageFlavor inlineFlavor = (inlineChoice != null ? inlineChoice.getTargetFlavor() : null);
-        
+
         //Investigate choice for form mode
         ImageFlavor[] formFlavors = getFormFlavors();
         ImageProviderPipeline[] formCandidates
@@ -431,11 +431,11 @@
                     info, formFlavors);
         ImageProviderPipeline formChoice = manager.choosePipeline(formCandidates);
         ImageFlavor formFlavor = (formChoice != null ? formChoice.getTargetFlavor() : null);
-        
+
         //Inline if form is not supported or if a better choice is available with inline mode
         return formFlavor == null || !formFlavor.equals(inlineFlavor);
     }
-    
+
     /** {@inheritDoc} */
     protected void drawImage(String uri, Rectangle2D pos, Map foreignAttributes) {
         endTextObject();
@@ -445,7 +445,7 @@
         if (log.isDebugEnabled()) {
             log.debug("Handling image: " + uri);
         }
-        
+
         ImageManager manager = getUserAgent().getFactory().getImageManager();
         ImageInfo info = null;
         try {
@@ -453,7 +453,7 @@
             info = manager.getImageInfo(uri, sessionContext);
             int width = (int)pos.getWidth();
             int height = (int)pos.getHeight();
-            
+
             //millipoints --> points for PostScript
             float ptx = x / 1000f;
             float pty = y / 1000f;
@@ -468,7 +468,7 @@
                 Map hints = ImageUtil.getDefaultHints(sessionContext);
                 org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                         info, getInlineFlavors(), hints, sessionContext);
-                
+
                 //...and embed as inline image
                 if (img instanceof ImageGraphics2D) {
                     ImageGraphics2D imageG2D = (ImageGraphics2D)img;
@@ -488,7 +488,7 @@
                     final ImageRawStream raw = (ImageRawStream)img;
                     if (raw instanceof ImageRawEPS) {
                         ImageRawEPS eps = (ImageRawEPS)raw;
-                        Rectangle2D bbox = eps.getBoundingBox(); 
+                        Rectangle2D bbox = eps.getBoundingBox();
                         InputStream in = raw.createInputStream();
                         try {
                             PSImageUtils.renderEPS(in, uri,
@@ -525,9 +525,9 @@
                     log.debug("Image " + info + " is embedded as a form later");
                 }
                 //Don't load image at this time, just put a form placeholder in the stream
-                PSResource form = getFormForImage(uri);   
+                PSResource form = getFormForImage(uri);
                 Rectangle2D targetRect = new Rectangle2D.Double(ptx, pty, ptw, pth);
-                PSImageUtils.paintForm(form, info.getSize().getDimensionPt(), targetRect, gen);   
+                PSImageUtils.paintForm(form, info.getSize().getDimensionPt(), targetRect, gen);
             }
 
         } catch (ImageException ie) {
@@ -586,7 +586,7 @@
     }
 
     /** {@inheritDoc} */
-    public void paintImage(RenderedImage image, RendererContext context, 
+    public void paintImage(RenderedImage image, RendererContext context,
             int x, int y, int width, int height) throws IOException {
         float fx = (float)x / 1000f;
         x += currentIPPosition / 1000f;
@@ -606,12 +606,12 @@
      * @param endy the y end position
      */
     private void drawLine(float startx, float starty, float endx, float endy) {
-        writeln(gen.formatDouble(startx) + " " 
-                + gen.formatDouble(starty) + " M " 
-                + gen.formatDouble(endx) + " " 
+        writeln(gen.formatDouble(startx) + " "
+                + gen.formatDouble(starty) + " M "
+                + gen.formatDouble(endx) + " "
                 + gen.formatDouble(endy) + " lineto stroke newpath");
     }
-    
+
     /** Saves the graphics state of the rendering engine. */
     public void saveGraphicsState() {
         endTextObject();
@@ -673,7 +673,7 @@
             handleIOTrouble(ioe);
         }
     }
-    
+
     private String getPostScriptNameForFontKey(String key) {
         int pos = key.indexOf('_');
         String postFix = null;
@@ -695,7 +695,7 @@
             return tf.getFontName() + postFix;
         }
     }
-    
+
     /**
      * Returns the PSResource for the given font key.
      * @param key the font key ("F*")
@@ -706,7 +706,7 @@
         if (this.fontResources != null) {
             res = (PSResource)this.fontResources.get(key);
         } else {
-            this.fontResources = new java.util.HashMap(); 
+            this.fontResources = new java.util.HashMap();
         }
         if (res == null) {
             res = new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key));
@@ -714,7 +714,7 @@
         }
         return res;
     }
-    
+
     /**
      * Changes the currently used font.
      * @param key key of the font ("F*")
@@ -742,15 +742,15 @@
                 || area.hasTrait(Trait.BORDER_AFTER)
                 || area.hasTrait(Trait.BORDER_START)
                 || area.hasTrait(Trait.BORDER_END)) {
-            comment("%FOPBeginBackgroundAndBorder: " 
+            comment("%FOPBeginBackgroundAndBorder: "
                     + startx + " " + starty + " " + width + " " + height);
             super.drawBackAndBorders(area, startx, starty, width, height);
-            comment("%FOPEndBackgroundAndBorder"); 
+            comment("%FOPEndBackgroundAndBorder");
         }
     }
-    
+
     /** {@inheritDoc} */
-    protected void drawBorderLine(float x1, float y1, float x2, float y2, 
+    protected void drawBorderLine(float x1, float y1, float x2, float y2,
             boolean horz, boolean startOrBefore, int style, Color col) {
         try {
             float w = x2 - x1;
@@ -760,7 +760,7 @@
                 return;
             }
             switch (style) {
-                case Constants.EN_DASHED: 
+                case Constants.EN_DASHED:
                     useColor(col);
                     if (horz) {
                         float unit = Math.abs(2 * h);
@@ -902,14 +902,14 @@
             handleIOTrouble(ioe);
         }
     }
-    
+
     /** {@inheritDoc} */
     public void startRenderer(OutputStream outputStream)
                 throws IOException {
         log.debug("Rendering areas to PostScript...");
 
         this.outputStream = outputStream;
-        OutputStream out; 
+        OutputStream out;
         if (isOptimizeResources()) {
             this.tempFile = File.createTempFile("fop", null);
             out = new java.io.FileOutputStream(this.tempFile);
@@ -917,7 +917,7 @@
         } else {
             out = this.outputStream;
         }
-        
+
         //Setup for PostScript generation
         this.gen = new PSGenerator(out) {
             /** Need to subclass PSGenerator to have better URI resolution */
@@ -944,7 +944,7 @@
         gen.writeDSCComment(DSCConstants.BBOX, DSCConstants.ATEND);
         gen.writeDSCComment(DSCConstants.HIRES_BBOX, DSCConstants.ATEND);
         this.documentBoundingBox = new Rectangle2D.Double();
-        gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES, 
+        gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES,
                 new Object[] {DSCConstants.ATEND});
         if (headerComments != null) {
             for (Iterator iter = headerComments.iterator(); iter.hasNext();) {
@@ -988,7 +988,7 @@
             PSResource res = (PSResource)this.fontResources.get(key);
             gen.notifyResourceUsage(res);
         }*/
-        
+
         //Write trailer
         gen.writeDSCComment(DSCConstants.TRAILER);
         if (footerComments != null) {
@@ -1016,7 +1016,7 @@
             pageDeviceDictionary.clear();
         }
     }
-    
+
     /**
      * Used for two-pass production. This will rewrite the PostScript file from the temporary
      * file while adding all needed resources.
@@ -1030,7 +1030,7 @@
         in = new java.io.BufferedInputStream(in);
         try {
             try {
-                ResourceHandler.process(this.userAgent, in, this.outputStream, 
+                ResourceHandler.process(this.userAgent, in, this.outputStream,
                         this.fontInfo, resTracker, this.formResources,
                         this.currentPageNumber, this.documentBoundingBox);
                 this.outputStream.flush();
@@ -1100,7 +1100,7 @@
         }
         super.processOffDocumentItem(oDI);
     }
-    
+
     /**
      * Formats and writes a List of PSSetupCode instances to the output stream.
      * @param setupCodeList a List of PSSetupCode instances
@@ -1111,8 +1111,8 @@
             Iterator i = setupCodeList.iterator();
             while (i.hasNext()) {
                 PSSetupCode setupCode = (PSSetupCode)i.next();
-                gen.commentln("%FOPBegin" + type + ": (" 
-                        + (setupCode.getName() != null ? setupCode.getName() : "") 
+                gen.commentln("%FOPBegin" + type + ": ("
+                        + (setupCode.getName() != null ? setupCode.getName() : "")
                         + ")");
                 LineNumberReader reader = new LineNumberReader(
                         new java.io.StringReader(setupCode.getContent()));
@@ -1137,9 +1137,9 @@
         if (this.currentPageNumber == 0) {
             writeHeader();
         }
-        
+
         this.currentPageNumber++;
-        
+
         gen.getResourceTracker().notifyStartNewPage();
         gen.getResourceTracker().notifyResourceUsageOnPage(PSProcSets.STD_PROCSET);
         gen.writeDSCComment(DSCConstants.PAGE, new Object[]
@@ -1159,7 +1159,7 @@
             pageSizes.add(new Long(Math.round(pageHeight)));
         }
         pageDeviceDictionary.put("/PageSize", pageSizes);
-        
+
         if (page.hasExtensionAttachments()) {
             for (Iterator iter = page.getExtensionAttachments().iterator();
                 iter.hasNext();) {
@@ -1245,7 +1245,7 @@
             if (safeSetPageDevice) {
                 content += " SSPD";
             } else {
-                content += " setpagedevice"; 
+                content += " setpagedevice";
             }
             writeEnclosedExtensionAttachment(new PSSetPageDevice(content));
         }
@@ -1256,8 +1256,8 @@
         }
         concatMatrix(1, 0, 0, -1, 0, pageHeight);
 
-        gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);            
-    
+        gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);
+
         //Process page
         super.renderPage(page);
 
@@ -1287,7 +1287,7 @@
             comment("%FOPEndRegionViewport");
         }
     }
-    
+
     /** Indicates the beginning of a text object. */
     protected void beginTextObject() {
         if (!inTextMode) {
@@ -1327,16 +1327,16 @@
                 handleIOTrouble(ioe);
             }
         }
-        
+
         beginTextObject();
-        writeln("1 0 0 -1 " + gen.formatDouble(rx / 1000f) 
+        writeln("1 0 0 -1 " + gen.formatDouble(rx / 1000f)
                 + " " + gen.formatDouble(bl / 1000f) + " Tm");
-        
+
         super.renderText(area); //Updates IPD
 
         renderTextDecoration(tf, fontsize, area, bl, rx);
     }
-    
+
     /** {@inheritDoc} */
     protected void renderWord(WordArea word) {
         renderText((TextArea)word.getParentArea(), word.getWord(), word.getLetterAdjustArray());
@@ -1349,9 +1349,9 @@
         String s = space.getSpace();
         char sp = s.charAt(0);
         Font font = getFontFromArea(textArea);
-        
-        int tws = (space.isAdjustable() 
-                ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust() 
+
+        int tws = (space.isAdjustable()
+                ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
                         + 2 * textArea.getTextLetterSpaceAdjust()
                 : 0);
 
@@ -1366,7 +1366,7 @@
         }
         return tf;
     }
-    
+
     private void renderText(AbstractTextArea area, String text, int[] letterAdjust) {
         String fontkey = getInternalFontNameForArea(area);
         int fontSize = area.getTraitAsInteger(Trait.FONT_SIZE);
@@ -1411,8 +1411,8 @@
         int initialSize = text.length();
         initialSize += initialSize / 2;
         StringBuffer sb = new StringBuffer(initialSize);
-        if (letterAdjust == null 
-                && area.getTextLetterSpaceAdjust() == 0 
+        if (letterAdjust == null
+                && area.getTextLetterSpaceAdjust() == 0
                 && area.getTextWordSpaceAdjust() == 0) {
             sb.append("(");
             for (int i = start; i < end; i++) {
@@ -1437,7 +1437,7 @@
                 }
                 int cw = tf.getWidth(mapped, fontsize) / 1000;
                 int ladj = (letterAdjust != null && i < end - 1 ? letterAdjust[i + 1] : 0);
-                int tls = (i < end - 1 ? area.getTextLetterSpaceAdjust() : 0); 
+                int tls = (i < end - 1 ? area.getTextLetterSpaceAdjust() : 0);
                 offsets[i - start] = cw + ladj + tls + wordSpace;
                 PSGenerator.escapeChar(codepoint, sb);
             }
@@ -1479,7 +1479,7 @@
             return null;
         }
     }
-    
+
     /** {@inheritDoc} */
     protected void restoreStateStackAfterBreakOut(List breakOutList) {
         try {
@@ -1496,16 +1496,16 @@
             handleIOTrouble(ioe);
         }
     }
-    
+
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     protected void startVParea(CTM ctm, Rectangle2D clippingRect) {
         saveGraphicsState();
         if (clippingRect != null) {
-            clipRect((float)clippingRect.getX() / 1000f, 
-                    (float)clippingRect.getY() / 1000f, 
-                    (float)clippingRect.getWidth() / 1000f, 
+            clipRect((float)clippingRect.getX() / 1000f,
+                    (float)clippingRect.getY() / 1000f,
+                    (float)clippingRect.getWidth() / 1000f,
                     (float)clippingRect.getHeight() / 1000f);
         }
         // multiply with current CTM
@@ -1528,12 +1528,12 @@
         super.renderBlockViewport(bv, children);
         comment("%FOPEndBlockViewport");
     }
-    
+
     /** {@inheritDoc} */
     protected void renderInlineParent(InlineParent ip) {
         super.renderInlineParent(ip);
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1545,7 +1545,7 @@
         int style = area.getRuleStyle();
         float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
         float starty = (currentBPPosition + area.getOffset()) / 1000f;
-        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart() 
+        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
                         + area.getIPD()) / 1000f;
         float ruleThickness = area.getRuleThickness() / 1000f;
         Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1555,7 +1555,7 @@
                 case EN_SOLID:
                 case EN_DASHED:
                 case EN_DOUBLE:
-                    drawBorderLine(startx, starty, endx, starty + ruleThickness, 
+                    drawBorderLine(startx, starty, endx, starty + ruleThickness,
                             true, true, style, col);
                     break;
                 case EN_DOTTED:
@@ -1563,13 +1563,13 @@
                     //This displaces the dots to the right by half a dot's width
                     //TODO There's room for improvement here
                     gen.concatMatrix(1, 0, 0, 1, ruleThickness / 2, 0);
-                    drawBorderLine(startx, starty, endx, starty + ruleThickness, 
+                    drawBorderLine(startx, starty, endx, starty + ruleThickness,
                             true, true, style, col);
                     break;
                 case EN_GROOVE:
                 case EN_RIDGE:
                     float half = area.getRuleThickness() / 2000f;
-    
+
                     gen.useColor(lightenColor(col, 0.6f));
                     moveTo(startx, starty);
                     lineTo(endx, starty);
@@ -1606,7 +1606,7 @@
     }
 
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     public void renderImage(Image image, Rectangle2D pos) {
         drawImage(image.getURL(), pos);
@@ -1615,7 +1615,7 @@
     /**
      * {@inheritDoc}
      */
-    protected RendererContext createRendererContext(int x, int y, int width, int height, 
+    protected RendererContext createRendererContext(int x, int y, int width, int height,
             Map foreignAttributes) {
         RendererContext context = super.createRendererContext(
                 x, y, width, height, foreignAttributes);
@@ -1631,7 +1631,7 @@
 
     /**
      * Formats and writes a PSExtensionAttachment to the output stream.
-     * 
+     *
      * @param attachment an PSExtensionAttachment instance
      */
     private void writeEnclosedExtensionAttachment(PSExtensionAttachment attachment)
@@ -1661,7 +1661,7 @@
     /**
      * Formats and writes a Collection of PSExtensionAttachment instances to
      * the output stream.
-     * 
+     *
      * @param attachmentCollection
      *            a Collection of PSExtensionAttachment instances
      */
@@ -1677,15 +1677,15 @@
             iter.remove();
         }
     }
-    
+
     /**
      * Sets whether or not the safe set page device macro should be used
      * (as opposed to directly invoking setpagedevice) when setting the
      * postscript page device.
-     * 
+     *
      * This option is a useful option when you want to guard against the possibility
-     * of invalid/unsupported postscript key/values being placed in the page device. 
-     * 
+     * of invalid/unsupported postscript key/values being placed in the page device.
+     *
      * @param safeSetPageDevice setting to false and the renderer will make a
      * standard "setpagedevice" call, setting to true will make a safe set page
      * device macro call (default is false).
@@ -1701,14 +1701,14 @@
      * It can cause problems (unwanted PostScript subsystem initgraphics/erasepage calls)
      * on some printers when the pagedevice is set.  If this causes problems on a
      * particular implementation then use this setting with a 'false' value to try and
-     * minimize the number of setpagedevice calls in the postscript document output. 
+     * minimize the number of setpagedevice calls in the postscript document output.
      * <p>
      * Set this value to false if you experience unwanted blank pages in your
      * postscript output.
      * @param dscCompliant boolean value (default is true)
      */
     public void setDSCCompliant(boolean dscCompliant) {
-        this.dscCompliant = dscCompliant;        
+        this.dscCompliant = dscCompliant;
     }
 
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@
 import org.apache.xmlgraphics.ps.PSGenerator;
 
 /**
- * Postscript renderer config 
+ * Postscript renderer config
  */
 public class PSRendererConfigurator extends PrintRendererConfigurator {
 
@@ -50,7 +50,7 @@
             super.configure(renderer);
 
             PSRenderer psRenderer = (PSRenderer)renderer;
-            
+
             psRenderer.setAutoRotateLandscape(
                 cfg.getChild("auto-rotate-landscape").getValueAsBoolean(false));
             Configuration child;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java Thu Jul 24 02:35:34 2008
@@ -32,5 +32,5 @@
     /** The font information for the PostScript renderer. */
     public static final String PS_FONT_INFO = "psFontInfo";
 
-    
+
 }



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