pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (PDFBOX-116) PNG image page completely garbled
Date Tue, 30 Mar 2010 08:22:27 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jukka Zitting resolved PDFBOX-116.
----------------------------------

    Resolution: Fixed

Since this worked in 1.1.0, it's better to leave the issue resolved and open a separate one
for the regression in the latest trunk. See PDFBOX-672.

> PNG image page completely garbled
> ---------------------------------
>
>                 Key: PDFBOX-116
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-116
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>             Fix For: 1.1.0
>
>
> [imported from SourceForge]
> http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1392196
> Originally submitted by nobody on 2005-12-28 11:09.
> Hi:
> Attached is a zip file containing a 1 page PDF scanned 
> PDF doc and the image extracted using pdfBox.  
> As you can see, the PDF file shows the document fine, 
> but the image (which it saved with suffix png.png) is 
> completely garbled.
> I have tried the following ways, all with the same 
> result:
> (a) PDPage.convertToImage() --> BufferedImage --> 
> ImageIO.write(image,"png",...)
> Code:
> PDDocument document = PDDocument.load("test3.pdf");
> List pages = document.getDocumentCatalog().getAllPages
> ();
> PDPage page = (PDPage)pages.get(0);
> BufferedImage image = page.convertToImage();
> ImageIO.write(image, "png", new File("test31.png"));
> (b) PDPage --> PDResources --> getImages() -->  obtain 
> the PDXObjectImage() from iterator  --> getRGBImage() -
> -> BufferedImage --> ImageIO.write().
> PDDocument document = PDDocument.load("test3.pdf");
> List pages = document.getDocumentCatalog().getAllPages
> ();
> PDPage page = (PDPage)pages.get(0);
> PDResources resources = page.getResources();
> Map images = resources.getImages();
> if( images != null )
> {
>     Iterator imageIter = images.keySet().iterator();
>     while( imageIter.hasNext() )
>     {
>         String key = (String)imageIter.next();
>         PDXObjectImage image = (PDXObjectImage)
> images.get( key );
>  image.write2file("test3."+image.getSuffix());
>         BufferedImage bufImg = image.getRGBImage();
>         ImageIO.write(bufImg, "png", new File
> ("test31.png"));
>      }
> }
> Please let me know!
> CONTACT: vick_venkat at yahoo dot com.
> [attachment on SourceForge]
> http://sourceforge.net/tracker/download.php?group_id=78314&atid=552832&aid=1392196&file_id=161339
> testdocs.zip (application/x-zip-compressed), 74080 bytes
> Contains PDF file with extracted garbled PNG image

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message