pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinayak Agrawal <vinayakagrawa...@gmail.com>
Subject Pdfbox issue in Linux Environment
Date Sun, 07 Dec 2014 10:19:17 GMT
I am currently working on a java project where I am using pdfbox to extract
images from a pdf using getImages/getXobject method. I created the code and
it works as expected in windows 7(JRE 1.7 Oracle) environment.
When I move this code in linux environment Redhat 6.5(JRE 1.7 Oracle), it
throws multiple exceptions.
Please let me know what am I doing wrong.

Please find the java code attached as an attachment. The error message is :

Dec 7, 2014 5:17:17 AM org.apache.pdfbox.cos.COSDocument finalize
WARNING: Warning: You did not close a PDF Document
Dec 7, 2014 5:17:17 AM
org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap getRGBImage
SEVERE: java.lang.NullPointerException
Throwable occurred: java.lang.NullPointerException
	at org.apache.pdfbox.io.RandomAccessFileOutputStream.<init>(RandomAccessFileOutputStream.java:52)
	at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:317)
	at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:266)
	at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:192)
	at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:232)
	at org.apache.pdfbox.pdmodel.common.PDStream.getByteArray(PDStream.java:510)
	at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.getRGBImage(PDPixelMap.java:255)
	at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.write2OutputStream(PDPixelMap.java:386)
	at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.write2file(PDXObjectImage.java:262)
	at com.vinayak.PdfBoxExtractor3.read_pdf(PdfBoxExtractor3.java:45)
	at com.vinayak.PdfBoxExtractor3.main(PdfBoxExtractor3.java:16)
Exception in thread "main" java.lang.NullPointerException
	at com.vinayak.PdfBoxExtractor3.read_pdf(PdfBoxExtractor3.java:39)
	at com.vinayak.PdfBoxExtractor3.main(PdfBoxExtractor3.java:16)

Vinayak Agrawal

"To Strive, To Seek, To Find and Not to Yield!"
~Lord Alfred Tennyson

View raw message