1

I'm trying to produce thumbnails for pages for (larger, > 50 pages) pdf documents using pdfbox. I tried using renderer.renderImage(pageNumber) and then scale the image. I also tried using a scale parameter and renderImageWithDPI. Unfortunately, all these attempts take more than 1 second per page image, which makes it more than a minute for all thumbnails. When opening the document with AdobeReader or PDF XChange Editor, the thumbnails seem to appear almost instantaneously. Is there a chance to get the thumbnails more efficiently using pdfbox?

Juergen
  • 61
  • 1
  • 4
  • If you used -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider and have enough memory then no, you can't get it faster. A java program will never be as fast as a native code program. You could also try to use the 1.8.12 instead of the current 2.0.2 version, poor font rendering isn't really important for thumbnails. – Tilman Hausherr Aug 19 '16 at 21:32
  • Thanks, Tilman. -Dsun.java2d.cmm... (which I had not used before) made a factor of 3.5 (from 140 to 40 secs for 78 pages). Still not stunning but better than nothing. – Juergen Aug 19 '16 at 21:51
  • We've mentioned that option on several places... is there one that we missed, because you didn't see it? – Tilman Hausherr Aug 21 '16 at 08:48

0 Answers0