Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36B5E10EFA for ; Fri, 27 Sep 2013 14:35:44 +0000 (UTC) Received: (qmail 56366 invoked by uid 500); 27 Sep 2013 14:35:44 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 56290 invoked by uid 500); 27 Sep 2013 14:35:41 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 56281 invoked by uid 99); 27 Sep 2013 14:35:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 14:35:40 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [200.213.212.161] (HELO mail3.portaldedocumentos.com.br) (200.213.212.161) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 14:35:32 +0000 Received: (qmail 17887 invoked by uid 507); 27 Sep 2013 11:32:24 -0300 Received: from 200-153-104-50.customer.tdatabrasil.net.br (HELO NBK002063) (paulo.mello@portaldedocumentos.com.br@200.153.104.50) by mail3.portaldedocumentos.com.br with SMTP; 27 Sep 2013 11:32:24 -0300 From: "Paulo Mello" To: Subject: Problem with PDPixelMap getRGBImage - Something went wrong ... the pixelmap doesn't contain any data Date: Fri, 27 Sep 2013 11:33:59 -0300 Message-ID: <00b701cebb8e$9c3c7100$d4b55300$@portaldedocumentos.com.br> MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_00B8_01CEBB75.7718BA00" X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac67jkFmY7uNFFa1RJSSSWROOeMF3Q== Content-Language: pt-br X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_00B8_01CEBB75.7718BA00 Content-Type: multipart/alternative; boundary="----=_NextPart_001_00B9_01CEBB75.7718E110" ------=_NextPart_001_00B9_01CEBB75.7718E110 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Can help me with this problem: =20 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 =20 =20 My code: public static List getPdfPagesAsImages(String pdfPath, = int i) throws FileNotFoundException, IOException { int resolution =3D 185; File f =3D new File(pdfPath); FileInputStream is =3D null; is =3D new FileInputStream(f); System.out.println("PDFUtils: file loaded in directory:" + pdfPath); List bImages =3D new = ArrayList(); PDDocument pdfDocument =3D null; PDFParser parser =3D new PDFParser(is); parser.parse(); pdfDocument =3D parser.getPDDocument(); if (pdfDocument !=3D null) { @SuppressWarnings("unchecked") List pages =3D (List) pdfDocument .getDocumentCatalog().getAllPages(); int j =3D 1; for (PDPage p : pages) { BufferedImage convertedImage =3D = p.convertToImage( BufferedImage.TYPE_INT_RGB, resolution); saveImageToRepository(i, j, convertedImage); j++; if (isNegativeImage(convertedImage)) { =20 bImages.add(invertNegativeImage(convertedImage)); } else { bImages.add(convertedImage); } } } pdfDocument.close(); return bImages; } =20 =20 private static void saveImageToRepository(int i, int j, BufferedImage convertedImage) throws IOException { File outputfile =3D new File("C:/images/pdfpages/" + i + j+ ".png"); ImageIO.write(convertedImage, "png", outputfile); =20 //PDFImageWriter =20 } =20 What I can programming to solve this warning. Because this exception my app stop to work but the imagem was created =20 Thank you in advance for your attention Paulo Mello paulo.mello@portaldedocumentos.com.br=20 Tel: (11) 5591-2100 =96 Ramal 110 Rua dos =CDris, 150 - Mirand=F3polis - S=E3o Paulo - SP CEP: 04049-040 www.portaldedocumentos.com.br=20 =20 =20 =20 =20 ------=_NextPart_001_00B9_01CEBB75.7718E110 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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<= /b> = i)

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 throws = FileNotFoundException, IOException {

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 int<= /b> = resolution =3D 185;

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 File f =3D new<= /b> = File(pdfPath);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 FileInputStream is =3D null= ;

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 is =3D new<= /b> = FileInputStream(f);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 System.out<= /i>.println("PDFUt= ils: file loaded in directory:"

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 + = pdfPath);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 List<BufferedImage> bImages =3D = new<= /b> = ArrayList<BufferedImage>();

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 PDDocument pdfDocument =3D null= ;

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 PDFParser parser =3D new<= /b> = PDFParser(is);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 parser.parse();

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 pdfDocument =3D = parser.getPDDocument();

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 if = (pdfDocument !=3D null= ) = {

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 @SuppressWa= rnings("unche= cked")

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 List<PDPage> pages =3D = (List<PDPage>) pdfDocument

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 .getDocumentCatalog().getAllPages();

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 int<= /b> j = =3D 1;

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 for<= /b> = (PDPage p : pages) {

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = BufferedImage convertedImage =3D p.convertToImage(

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 BufferedImage.TYPE_INT_RG= B, = resolution);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = saveImageToRepository(i, j, convertedImage);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = j++;

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = if = (isNegativeImage(convertedImage)) {

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 = bImages.add(invertNegativeImage(convertedImage));

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } = else= = {

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 bImages.add(convertedImage);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = }

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 }

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 pdfDocument.close();

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 return = bImages;

=A0=A0=A0=A0=A0= =A0 }

 

 

=A0=A0=A0=A0=A0= =A0 private = static = void= = saveImageToRepository(int<= /b> i, = int<= /b> = j,

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 BufferedImage convertedImage) = throws = IOException {

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 File outputfile =3D new<= /b> = File("C:/im= ages/pdfpages/" + i + j+ = ".png&= quot;);

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 ImageIO.write(convertedImage, "png&q= uot;, = outputfile);

 <= /p>

=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 //PDFImageW= riter

 <= /p>

=A0=A0=A0=A0=A0= =A0 }

 

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

Paulo Mello
paulo.mello@portaldedocumentos.com.br =
Tel: (11) 5591-2100 – Ramal 110
Rua dos =CDris, 150 - = Mirand=F3polis - S=E3o Paulo - SP
CEP: 04049-040
www.portaldedocumentos.com.br =

3D"cid:image003.png@01CEB971.9F63E490"

 

 

 

 

------=_NextPart_001_00B9_01CEBB75.7718E110-- ------=_NextPart_000_00B8_01CEBB75.7718BA00--