You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Richard Brown (JIRA)" <ji...@apache.org> on 2016/05/01 00:00:14 UTC

[jira] [Comment Edited] (PDFBOX-3333) Rotated text does not generate accurate preview renderings

    [ https://issues.apache.org/jira/browse/PDFBOX-3333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15265516#comment-15265516 ] 

Richard Brown edited comment on PDFBOX-3333 at 4/30/16 9:59 PM:
----------------------------------------------------------------

Also, I see no way to include code snippets in JIRA other than attaching it as a file.  Here is the code I used to generate the thumbnail with the issue.  I used ImageMagick to generate the thumbnail created for the iText PDF.

    public static void printImage(String pdfFilename, String thumbPath, Integer dpi) throws IOException {

        PDDocument document = PDDocument.load(new File(pdfFilename));

        PDFRenderer pdfRenderer = new PDFRenderer(document);

        BufferedImage bim = pdfRenderer.renderImage(0, 1.0f);

        // suffix in filename will be used as the file format

        ImageIOUtil.writeImage(bim, thumbPath, dpi);

        document.close();

    }


was (Author: chronosafe):
Also, I see no way to include code snippets in JIRA other than attaching it as a file.  Here is the code I used to generate the thumbnail with the issue.  I used ImageMagick to generate the thumbnail created for the iText PDF.

    public static void printImage(String pdfFilename, String thumbPath, Integer dpi) throws IOException {
        PDDocument document = PDDocument.load(new File(pdfFilename));
        PDFRenderer pdfRenderer = new PDFRenderer(document);
        BufferedImage bim = pdfRenderer.renderImage(0, 1.0f);
        // suffix in filename will be used as the file format
        ImageIOUtil.writeImage(bim, thumbPath, dpi);
        document.close();

    }

> Rotated text does not generate accurate preview renderings
> ----------------------------------------------------------
>
>                 Key: PDFBOX-3333
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3333
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.1
>         Environment: Mac OS X development, Ubuntu production
>            Reporter: Richard Brown
>            Priority: Critical
>         Attachments: 000001_3VW7T7AT1FM805256.png, 000002_3VW7T7AT1FM805256.pdf, 000002_3VW7T7AT1FM805256_450_450.png, 000063_WAU3FAFR4CA029987.pdf, BlueWideSticker1.pdf
>
>
> When filling a PDF field that is rotated the resulting generated PDF has the correct format.  But when you generate an image of the PDF the image has the text in those rotated fields as not rotated.
> I have tried a variety of templates and they all do the same thing: view the preview of the PDF and see unrotated text.  Open the PDF and see the correctly rotated text.
> Note that I generate the same PDF using iText 5.5.9 and the preview is correct, the text is correctly rotated.  I'm basically bouncing back and forth between iText and PDFBox trying to find a working solution.
> If it makes any difference I'm using an FDF file to fill with iText and an XFDF file for PDFBox because I can't figure out how to load an FDF in 2.0.1.



--
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