pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DImuthu Upeksha <dimuthu.upeks...@gmail.com>
Subject Problem with PDFRenderer
Date Tue, 03 Jun 2014 17:09:51 GMT
Hi all,

I tried to render a buffered image from this [1] PDF file using following
code sample.

PDFRenderer renderer = new PDFRenderer(document);

 BufferedImage image = renderer.renderImage(currentPageNo, zoomFactor);
Then it gave following error. However this code works for other PDFs. What
could be the reason for this?

[1] https://www.dropbox.com/s/ywscxm2n8pubat5/pdf3.pdf

SEVERE: error while creating a xobject

org.apache.pdfbox.filter.MissingImageReaderException: Cannot read JBIG2
image: jbig2-imageio is not installed

at org.apache.pdfbox.filter.JBIG2Filter.decode(JBIG2Filter.java:70)

at org.apache.pdfbox.filter.Filter.decode(Filter.java:58)

at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:359)

at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:272)

at org.apache.pdfbox.cos.COSStream.getDecodeResult(COSStream.java:230)

at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(
PDImageXObject.java:94)

at org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(
PDXObject.java:65)

at org.apache.pdfbox.pdmodel.PDResources.getXObjects(PDResources.java:247)

at org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:57)

at org.apache.pdfbox.util.PDFStreamEngine.processOperator(
PDFStreamEngine.java:529)

at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(
PDFStreamEngine.java:254)

at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(
PDFStreamEngine.java:221)

at org.apache.pdfbox.util.PDFStreamEngine.processStream(
PDFStreamEngine.java:203)

at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:162)

at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:199)

at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:147)

at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:70)

at org.apache.pdfbox.utils.PDFOCRTextStripper.processStream(
PDFOCRTextStripper.java:51)

at org.apache.pdfbox.util.PDFTextStripper.processPage(
PDFTextStripper.java:462)

at org.apache.pdfbox.util.PDFTextStripper.processPages(
PDFTextStripper.java:387)

at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:346
)

at org.apache.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:259)

at org.apache.pdfbox.utils.PDFOCTRTextStripper_Test.test(
PDFOCTRTextStripper_Test.java:19)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:20)

at org.junit.internal.runners.statements.RunBefores.evaluate(
RunBefores.java:28)

at org.junit.internal.runners.statements.RunAfters.evaluate(
RunAfters.java:31)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:70)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:44)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)

at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)

at org.junit.internal.runners.statements.RunBefores.evaluate(
RunBefores.java:28)

at org.junit.internal.runners.statements.RunAfters.evaluate(
RunAfters.java:31)

at org.junit.runners.ParentRunner.run(ParentRunner.java:220)

at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(
JUnit4TestSet.java:35)

at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:146)

at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
JUnit4Provider.java:97)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(
ProviderFactory.java:103)

at com.sun.proxy.$Proxy0.invoke(Unknown Source)

at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(
SurefireStarter.java:145)

at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(
SurefireStarter.java:87)

at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

-- 
Regards

W.Dimuthu Upeksha
Undergraduate
Department of Computer Science And Engineering

University of Moratuwa, Sri Lanka

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message