Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java?rev=1610937&r1=1610936&r2=1610937&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java Wed Jul 16 08:51:22 2014 @@ -29,7 +29,7 @@ import org.apache.commons.logging.LogFac import org.apache.xmlgraphics.image.loader.Image; import org.apache.xmlgraphics.image.loader.ImageFlavor; - +import org.apache.fop.fonts.FontInfo; import org.apache.fop.render.ImageHandler; import org.apache.fop.render.RenderingContext; import org.apache.fop.render.pdf.PDFContentGenerator; @@ -67,9 +67,9 @@ public class PDFBoxImageHandler extends (float)(generator.getState().getTransform().getTranslateX()), (float)(generator.getState().getTransform().getTranslateY() - h - y)); } - - String stream = createStreamForPDF(pdfImage, pdfContext.getPage(), - pdfContext.getUserAgent(), pageAdjust, pos); + FontInfo fontinfo = (FontInfo)context.getHint("fontinfo"); + String stream = createStreamForPDF(pdfImage, pdfContext.getPage(), pdfContext.getUserAgent(), + pageAdjust, fontinfo, pos); if (stream == null) { return; }
Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFUtil.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFUtil.java?rev=1610937&r1=1610936&r2=1610937&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFUtil.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFUtil.java Wed Jul 16 08:51:22 2014 @@ -24,7 +24,9 @@ import org.apache.pdfbox.pdmodel.PDPage; /** * Common utility functions for PDF access. */ -public class PDFUtil { +public final class PDFUtil { + + private PDFUtil() { } /** * Determines the rotation of a given page and normalizes the returned value to the values @@ -40,12 +42,12 @@ public class PDFUtil { rotation += 360; } switch (rotation) { - case 90: - case 180: - case 270: - return rotation; - default: - return 0; + case 90: + case 180: + case 270: + return rotation; + default: + return 0; } } Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java?rev=1610937&r1=1610936&r2=1610937&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java Wed Jul 16 08:51:22 2014 @@ -33,7 +33,6 @@ import javax.xml.transform.Source; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.common.PDRectangle; -import org.apache.pdfbox.pdmodel.encryption.BadSecurityHandlerException; import org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial; import org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial; @@ -57,7 +56,7 @@ public class PreloaderPDF extends Abstra private static final String PDF_HEADER = "%PDF-"; /** static PDDocument cache for faster multi-page processing */ - private static final Cache.Type CACHE_TYPE =Cache.Type.valueOf( + private static final Cache.Type CACHE_TYPE = Cache.Type.valueOf( System.getProperty("fop.pdfbox.preloader-cache", Cache.Type.WEAK.name()).toUpperCase()); private static Map<Object, Cache<URI, PDDocument>> documentCacheMap @@ -119,13 +118,13 @@ public class PreloaderPDF extends Abstra if (pddoc.isEncrypted()) { //Try decrypting with an empty password DecryptionMaterial dec = new StandardDecryptionMaterial(""); - try { +// try { pddoc.openProtection(dec); - } catch (org.apache.pdfbox.exceptions.CryptographyException e) { - notifyCouldNotDecrypt(e); - } catch (BadSecurityHandlerException e) { - notifyCouldNotDecrypt(e); - } +// } catch (org.apache.pdfbox.exceptions.CryptographyException e) { +// notifyCouldNotDecrypt(e); +// } catch (BadSecurityHandlerException e) { +// notifyCouldNotDecrypt(e); +// } } int pageCount = pddoc.getNumberOfPages(); @@ -137,7 +136,7 @@ public class PreloaderPDF extends Abstra PDPage page = (PDPage)pddoc.getDocumentCatalog().getAllPages().get(selectedPage); PDRectangle mediaBox = page.findMediaBox(); PDRectangle cropBox = page.findCropBox(); - PDRectangle viewBox = (cropBox != null ? cropBox : mediaBox); + PDRectangle viewBox = cropBox != null ? cropBox : mediaBox; int w = Math.round(viewBox.getWidth() * 1000); int h = Math.round(viewBox.getHeight() * 1000); Modified: xmlgraphics/fop-pdf-images/trunk/test/java/org/apache/fop/render/pdf/PDFRotateTestCase.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/test/java/org/apache/fop/render/pdf/PDFRotateTestCase.java?rev=1610937&r1=1610936&r2=1610937&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/test/java/org/apache/fop/render/pdf/PDFRotateTestCase.java (original) +++ xmlgraphics/fop-pdf-images/trunk/test/java/org/apache/fop/render/pdf/PDFRotateTestCase.java Wed Jul 16 08:51:22 2014 @@ -52,6 +52,6 @@ public class PDFRotateTestCase { GraphicContext gc = new GraphicContext(); g2d.setGraphicContext(gc); ig.getGraphics2DImagePainter().paint(g2d, rect); - Assert.assertTrue(g2d.getTransform().getShearX() == -0.12626262626262627); + Assert.assertEquals(g2d.getTransform().getShearX(), 0.12626262626262627); } } --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org