You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Atthapon Junpun-eak (JIRA)" <ji...@apache.org> on 2015/11/03 12:29:27 UTC

[jira] [Commented] (PDFBOX-3083) Form fields are missing when rendering

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

Atthapon Junpun-eak commented on PDFBOX-3083:
---------------------------------------------

Hi [~tilman],

Wow! Thanks for quick response.

- May I know when that line of code will be released? 
(I'd like to have a quick fix for my project ^_^)

- Do you have suggestions how I can use this line without having to modified PdfBox i.e. creating a new class which extends PDFStreamEngine class, possible ?



Sorry for some more questions.

-  Did you test this with PdfBox version 2.0.0 ?

- The code below is what I'm using to convert pdf to image.

Can you help share your correct code to me also?

{code:title=Bar.java|borderStyle=solid}
PDDocument pdfDoc = null;
        try {
            pdfDoc = PDDocument.load(new File("D:/tmp/myout.pdf"));
           
            PDFRenderer renderer = new PDFRenderer(pdfDoc);

            for (int i = 0; i < pdfDoc.getNumberOfPages(); i++) 
            {
                //----------------------- Buffered Image - PDFBOX 2.0----------------
                BufferedImage bufferedImage = renderer.renderImage(i, 1);
                File imageFile2 = new File("D:/tmp/out_bufferedimage_" + Integer.toString(i + 1)+".png");
                ImageIO.write(bufferedImage, "png", imageFile2);
            }
        } catch (IOException e) {
            throw new RuntimeException("File myout_image could not be read.", e);
        }
        finally
        {
           if( pdfDoc != null )
           {
        	   pdfDoc.close();
           }
        }
{code}

Thanks a lot for your help

> Form fields are missing when rendering
> --------------------------------------
>
>                 Key: PDFBOX-3083
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3083
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 1.6.0, 1.8.10, 2.0.0
>         Environment: JDK 1.7, Tomcat 7, Maven 3
> Eclipse IDE (Mars)
>            Reporter: Atthapon Junpun-eak
>            Priority: Critical
>         Attachments: PDFBOX-3083-acroform90°1.jpg, myout_image_1.jpg, mypdf.pdf, out_bufferedimage_1.png
>
>
> Hi,
> I was trying to convert my pdf file to image (jpg or png) but only the grey text (see my attached pdf) were successfully converted to an image file but the blue text cannot.
> I've try to extract this pdf with several PdfBox versions : 2.0, 1.8.10, and 1.6 but it doesn't work. 
> However, with 1.6, the generated image contains both grey and blue text but in an incorrect layout/alignment.
> Can you please verify this issue?
> Please also let me know if you have any quick fix for this issue.
> -------------------------------
> Attached Sources : 
> - mypdf.pdf : original pdf to be converted
> - out_bufferedimage_1.png : converted with PdfBox 2.0 and 1.8.10
> - myout_image_1.jpg :  converted with PdfBox 2.0 and 1.6
> -------------------------------
> Thanks a lot.
> Best,



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