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

Frank Yao commented on PDFBOX-2696:
-----------------------------------

Below is the main code:(when  run this code in jdk1.7, some text in the 1st 
page of this pdf is disappeared after extracting the image)
               
PDDocument document = null;
                try {
                        document = 
PDDocument.load("C:\\2015020962544_GOFlyer_customizable_HQHBO.pdf");
                } catch (IOException ex) {
                        System.out.println("" + ex);
                }
                List<?> pages = document.getDocumentCatalog().getAllPages();
                Iterator<?> iter = pages.iterator();
                int i = 1;

                while (iter.hasNext()) {
                        PDPage page = (PDPage) iter.next();
                        BufferedImage img = page.convertToImage();
                        File outputfile = new File("C:\\HQHBO" + i + ".jpg");
                        ImageIO.write(img, "jpg", outputfile);
                        i++;
                        break;
                }


> PDDocument issue
> ----------------
>
>                 Key: PDFBOX-2696
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2696
>             Project: PDFBox
>          Issue Type: Bug
>         Environment: jdk1.7,windows 64bit
>            Reporter: Frank Yao
>         Attachments: 1st page image extract.png, 
> 2015020962544_GOFlyer_customizable_HQHBO.pdf
>
>
> when I want to extract an image from the first page of pdf file, some text in 
> the first page will be disappeared, when I open  the image file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to