Author: ssteiner
Date: Wed Oct 27 14:04:45 2021
New Revision: 1894589

URL: http://svn.apache.org/viewvc?rev=1894589&view=rev
Log:
FOP-3033: Update PDFBox to 2.0.21

Added:
    xmlgraphics/fop-pdf-images/trunk/lib/fontbox-2.0.21.jar   (with props)
    xmlgraphics/fop-pdf-images/trunk/lib/pdfbox-2.0.21.jar   (with props)
Removed:
    xmlgraphics/fop-pdf-images/trunk/lib/fontbox-2.0.19.jar
    xmlgraphics/fop-pdf-images/trunk/lib/pdfbox-2.0.19.jar
Modified:
    xmlgraphics/fop-pdf-images/trunk/pom.xml
    
xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java

Added: xmlgraphics/fop-pdf-images/trunk/lib/fontbox-2.0.21.jar
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/lib/fontbox-2.0.21.jar?rev=1894589&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/fop-pdf-images/trunk/lib/fontbox-2.0.21.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/fop-pdf-images/trunk/lib/pdfbox-2.0.21.jar
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/lib/pdfbox-2.0.21.jar?rev=1894589&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/fop-pdf-images/trunk/lib/pdfbox-2.0.21.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: xmlgraphics/fop-pdf-images/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/pom.xml?rev=1894589&r1=1894588&r2=1894589&view=diff
==============================================================================
--- xmlgraphics/fop-pdf-images/trunk/pom.xml (original)
+++ xmlgraphics/fop-pdf-images/trunk/pom.xml Wed Oct 27 14:04:45 2021
@@ -23,7 +23,7 @@
     <dependency>
       <groupId>org.apache.pdfbox</groupId>
       <artifactId>pdfbox</artifactId>
-      <version>2.0.19</version>
+      <version>2.0.21</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>

Modified: 
xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java?rev=1894589&r1=1894588&r2=1894589&view=diff
==============================================================================
--- 
xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java
 (original)
+++ 
xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java
 Wed Oct 27 14:04:45 2021
@@ -21,6 +21,7 @@ package org.apache.fop.render.pdf.pdfbox
 
 import java.awt.Dimension;
 import java.awt.Graphics2D;
+import java.awt.RenderingHints;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
@@ -172,8 +173,10 @@ public class ImageConverterPDF2G2D exten
                     at.scale(area.getWidth() / mediaBox.getWidth(),
                             area.getHeight() / mediaBox.getHeight());
                     g2d.transform(at);
-                normaliseScale(g2d);
-                    new 
PDFRenderer(pdDocument).renderPageToGraphics(selectedPage, g2d);
+                    normaliseScale(g2d);
+                    PDFRenderer pdfRenderer = new PDFRenderer(pdDocument);
+                    pdfRenderer.setRenderingHints(getDefaultRenderingHints());
+                    pdfRenderer.renderPageToGraphics(selectedPage, g2d);
                 }
             } catch (UnsupportedOperationException e) {
                 throw e;
@@ -184,6 +187,14 @@ public class ImageConverterPDF2G2D exten
             }
         }
 
+        private RenderingHints getDefaultRenderingHints() {
+            RenderingHints r = new RenderingHints(null);
+            r.put(RenderingHints.KEY_INTERPOLATION, 
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+            r.put(RenderingHints.KEY_RENDERING, 
RenderingHints.VALUE_RENDER_QUALITY);
+            r.put(RenderingHints.KEY_ANTIALIASING, 
RenderingHints.VALUE_ANTIALIAS_ON);
+            return r;
+        }
+
         private void normaliseScale(Graphics2D g2d) {
             if (!(g2d instanceof AbstractGraphics2D)) {
                 AffineTransform old = g2d.getTransform();



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

Reply via email to