You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2015/02/10 22:23:12 UTC
[jira] [Comment Edited] (PDFBOX-1206) TrueType glyphs render
incorrectly
[ https://issues.apache.org/jira/browse/PDFBOX-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14314953#comment-14314953 ]
Tilman Hausherr edited comment on PDFBOX-1206 at 2/10/15 9:22 PM:
------------------------------------------------------------------
I suspect that the original Batik code is broken too. I calculated the SVG values with the Batik code for the outer circle of that "o" of PDFBOX-1435 with the [Batik source|https://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/font/SVGFont.java?view=markup]. Here's the svg file I get:
{code}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="12cm" height="12cm" viewBox="0 0 1200 1200"
xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="1" y="1" width="1000" height="1000"
fill="none" stroke="blue" stroke-width="1" />
<g transform="scale(7)">
<path d="M85,53 T74,49 T54,48.5 T39.5,59.5 T35.5,76.5 T44,94 T62,102 T79.5,97 T89.5,82.5 T88.5,63 Z"
fill="none" stroke="red" stroke-width="5" />
</g>
</svg>
{code}
This can be displayed with firefox, and this "o" has an angle :-(
was (Author: tilman):
I suspect that the original Batik code is broken too. I calculated the SVG values with the Batik code for the outer circle of that "o" of PDFBOX-1435 with the Batik source. Here's the svg file I get:
{code}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="12cm" height="12cm" viewBox="0 0 1200 1200"
xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="1" y="1" width="1000" height="1000"
fill="none" stroke="blue" stroke-width="1" />
<g transform="scale(7)">
<path d="M85,53 T74,49 T54,48.5 T39.5,59.5 T35.5,76.5 T44,94 T62,102 T79.5,97 T89.5,82.5 T88.5,63 Z"
fill="none" stroke="red" stroke-width="5" />
</g>
</svg>
{code}
This can be displayed with firefox, and this "o" has an angle :-(
> TrueType glyphs render incorrectly
> -----------------------------------
>
> Key: PDFBOX-1206
> URL: https://issues.apache.org/jira/browse/PDFBOX-1206
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 1.6.0, 1.7.0
> Environment: All (tested on OS X and Solaris but believe it affects all platforms), tested java 7 update 1 & update 2
> Reporter: Armando Singer
> Labels: convertToImage, image
> Fix For: 2.0.0
>
> Attachments: convertToImage.pdf, converttoimage.pdf-1.png
>
>
> I've done a extensive testing of pdfbox under the new Java 7, update 1 & update 2 releases, and am noticing
> severe image quality issues when converting a pdf to an image.
> Attached is the same pdf turned converted to an image under Java 6, then again with Java 7
> with the same code. The Java 7 version looks pretty bad.
> This is with jdk 1.7 update 1 & 2 (for solaris x64, running headless, and OS X running Java 7 preview update 2 with default with no addition vm args to the default java command). I've also tested against
> the latest code in svn (the images below are from the most current version).
> The good image below is from a recent version of the jdk 1.6 (and it has always looked good
> on at least jdk1.5+).
> To test, I used code like this:
> {code}
> import java.awt.image.BufferedImage;
> import java.io.File;
> import java.io.IOException;
> import javax.imageio.ImageIO;
> import org.apache.pdfbox.pdmodel.PDDocument;
> import org.apache.pdfbox.pdmodel.PDPage;
> public final class PdfToImageTest {
> public static BufferedImage toBufferedImage(final String pdfFile, final int resolution)
> throws IOException {
> PDDocument document = null;
> try {
> document = PDDocument.load(pdfFile);
> final PDPage page = (PDPage) document.getDocumentCatalog().getAllPages().get(0);
> final BufferedImage result = page.convertToImage(BufferedImage.TYPE_INT_ARGB, resolution);
> return result;
> } finally {
> if (document != null) {
> document.close();
> }
> }
> }
> public static void main (String[] args) throws IOException {
> ImageIO.write(toBufferedImage(args[0], 108), "png", new File(args[1]));
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org