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:[email protected]

        

*Paulo Mello*
[email protected]
<mailto:[email protected]>
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/>

        

**


Reply via email to