Thanks Andreas, but  get the PDDocument during a parser()

                File f = new File(pdfPath);
                FileInputStream is = null;
                is = new FileInputStream(f);

                PDDocument pdfDocument = null;
                PDFParser parser = new PDFParser(is);
                parser.parse();
                pdfDocument = parser.getPDDocument();


I dont use more the load method. 
I dont understand why this exception occurs. 
PS: I had not received the answer of my old question. sorry about that

Can you help me with my way in this situation?

Thank you a lot.

My oldest question i did not received
Paulo Mello
[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 




-----Mensagem original-----
De: Andreas Lehmkuehler [mailto:[email protected]] 
Enviada em: sexta-feira, 27 de setembro de 2013 12:19
Para: [email protected]
Assunto: Re: Problem with PDPixelMap getRGBImage - Something went wrong ...
the pixelmap doesn't contain any data

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