• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pdfbox ConvertToImage returns white images

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I`m converting random page from pdf document to BufferredImage and when i write it with ImageIO.write , i receive white image instead of page. Here is code snapshot to convert 16th page of a document.



I already added to libraries JAI jar and JAI imageIO jars, i saw in internet that it could be the case. I also tested different pdf documents, also one that are from pdfbox support jira resolved issues , wehere developers says that these pdfs works well. Thank you.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I think all the mentions of JAI and the JAI ImageIO plugin are a red herring, since the JAI usage -not much to begin with- has been removed a long time ago.

Are you able to extract images from the ItDoesntWorkScan.pdf document if you add the jbig2-imageio plugin? That's the only case of all those old bug reports about white pages that I can reproduce with the current PDFBox version, and that, too, works fine, if I have that plugin in the classpath. Have you tried putting that plugin in the classpath when running with your document?

In the future, please BeForthrightWhenCrossPostingToOtherSites: http://stackoverflow.com/questions/24711443/pdfbox-converttoimage-returns-white-images-while-converting-pages
 
Daniel Gurianov
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all , thank you for cross-posting rules. I`ll stick to them in future.

When i use ItDoesntWorkScan.pdf from topic youve mentioned, i got completely meaningfull error.

In case of other PDFs i`ve tried , i have absolutly no errors. Everything works perfect, except i`m getting blank image file.
I stuck, cause i have no idea where to investigate further.
Also, i`ve noticed , if i print bi which is BufferedImage object (do not know actually how to look inside it), i get next test representation


dataOffset[0] 0 this part bothers me. Does this mean that bufferedImage arrives to variable already empty ? I`m just guessing.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic