pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1088324 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java
Date Sun, 03 Apr 2011 15:19:21 GMT
Author: lehmi
Date: Sun Apr  3 15:19:20 2011
New Revision: 1088324

URL: http://svn.apache.org/viewvc?rev=1088324&view=rev
Log:
PDFBOX-993: added more shape transparency as proposed by Jesse Eichar

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java?rev=1088324&r1=1088323&r2=1088324&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java Sun Apr
 3 15:19:20 2011
@@ -147,9 +147,11 @@ public class PageDrawer extends PDFStrea
         {
             switch(this.getGraphicsState().getTextState().getRenderingMode()) {
                 case PDTextState.RENDERING_MODE_FILL_TEXT:
+                    graphics.setComposite( this.getGraphicsState().getNonStrokeJavaComposite()
);
                     graphics.setColor( this.getGraphicsState().getNonStrokingColor().getJavaColor()
);
                     break;
                 case PDTextState.RENDERING_MODE_STROKE_TEXT:
+                    graphics.setComposite( this.getGraphicsState().getStrokeJavaComposite()
);
                     graphics.setColor( this.getGraphicsState().getStrokingColor().getJavaColor()
);
                     break;
                 case PDTextState.RENDERING_MODE_NEITHER_FILL_NOR_STROKE_TEXT:
@@ -157,6 +159,7 @@ public class PageDrawer extends PDFStrea
                     Color nsc = this.getGraphicsState().getStrokingColor().getJavaColor();
                     float[] components = {Color.black.getRed(),Color.black.getGreen(),Color.black.getBlue()};
                     Color  c = new Color(nsc.getColorSpace(),components,0f);
+                    graphics.setComposite( this.getGraphicsState().getStrokeJavaComposite()
);
                     graphics.setColor(c);
                     break;
                 default:
@@ -167,6 +170,7 @@ public class PageDrawer extends PDFStrea
                             + " Using RenderingMode "
                             + PDTextState.RENDERING_MODE_FILL_TEXT
                             + " instead");
+                    graphics.setComposite( this.getGraphicsState().getNonStrokeJavaComposite()
);
                     graphics.setColor( this.getGraphicsState().getNonStrokingColor().getJavaColor()
);
             }
 
@@ -382,9 +386,10 @@ public class PageDrawer extends PDFStrea
      * @param at The transformation to use when drawing.
      * 
      */
-    public void drawImage(Image awtImage, AffineTransform at){        
-                graphics.setClip(getGraphicsState().getCurrentClippingPath());
-                graphics.drawImage( awtImage, at, null );
+    public void drawImage(Image awtImage, AffineTransform at){
+        graphics.setComposite(getGraphicsState().getStrokeJavaComposite());
+        graphics.setClip(getGraphicsState().getCurrentClippingPath());
+        graphics.drawImage( awtImage, at, null );
     }
     
     /**



Mime
View raw message