pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: Problem with PDPixelMap getRGBImage - Something went wrong ... the pixelmap doesn't contain any data
Date Fri, 27 Sep 2013 15:19:22 GMT
Hi,

I already answered your question here [1]

BR
Andreas Lehmkühler

[1] http://apache.markmail.org/thread/v57skp4vlts5nzyi

Am 27.09.2013 16:33, schrieb Paulo Mello:
> Can help me with this problem:
>
> Set 27, 2013 7:12:24 PM org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap
> getRGBImage
>
> SEVERE: Something went wrong ... the pixelmap doesn't contain any data.
>
> Set 27, 2013 7:12:24 PM org.apache.pdfbox.util.operator.pagedrawer.Invoke process
>
> WARNING: getRGBImage returned NULL
>
> Set 27, 2013 7:12:24 PM org.apache.pdfbox.util.PDFStreamEngine processOperator
>
> INFO: unsupported/disabled operation: i
>
> My code:
>
> *public**static*List<BufferedImage> getPdfPagesAsImages(String pdfPath, *int*i)
>
> *throws*FileNotFoundException, IOException {
>
> *int*resolution = 185;
>
>               File f = *new*File(pdfPath);
>
>               FileInputStream is = *null*;
>
>               is = *new*FileInputStream(f);
>
>               System./out/.println("PDFUtils: file loaded in directory:"
>
>                             + pdfPath);
>
>               List<BufferedImage> bImages = *new*ArrayList<BufferedImage>();
>
>               PDDocument pdfDocument = *null*;
>
>               PDFParser parser = *new*PDFParser(is);
>
> _parser_.parse();
>
>               pdfDocument = parser.getPDDocument();
>
> *if*(pdfDocument != *null*) {
>
> @SuppressWarnings("unchecked")
>
>                      List<PDPage> pages = (List<PDPage>) pdfDocument
>
>                                    .getDocumentCatalog().getAllPages();
>
> *int*j = 1;
>
> *for*(PDPage p : pages) {
>
>                             BufferedImage convertedImage = p.convertToImage(
>
>                                          BufferedImage./TYPE_INT_RGB/, resolution);
>
> /saveImageToRepository/(i, j, convertedImage);
>
>                             j++;
>
> *if*(/isNegativeImage/(convertedImage)) {
>
>
> bImages.add(/invertNegativeImage/(convertedImage));
>
>                             } *else*{
>
>                                    bImages.add(convertedImage);
>
>                             }
>
>                      }
>
>               }
>
>               pdfDocument.close();
>
> *return*bImages;
>
>         }
>
> *private**static**void*saveImageToRepository(*int*i, *int*j,
>
>                      BufferedImage convertedImage) *throws*IOException {
>
>               File outputfile = *new*File("C:/images/pdfpages/"+ i + j+ ".png");
>
>               ImageIO./write/(convertedImage, "png", outputfile);
>
> //PDFImageWriter
>
>         }
>
> What I can programming to solve this warning.
>
> Because this exception my app stop to work but the imagem was created
>
> Thank you in advance for your attention
>
> cid:image003.png@01CEB971.9F63E490
>
> 	
>
> *Paulo Mello*
> paulo.mello@portaldedocumentos.com.br
> <mailto:paulo.mello@portaldedocumentos.com.br>
> Tel: (11) 5591-2100 – Ramal 110
> Rua dos Íris, 150 - Mirandópolis - São Paulo - SP
> CEP: 04049-040
> www.portaldedocumentos.com.br <http://www.portaldedocumentos.com.br/>
>
> 	
>
> **
>


Mime
View raw message