Hi,
I having error as below :
java.lang.NoClassDefFoundError: org/apache/fontbox/ttf/Type1Equivalent
below is my code :
String fullPath = filePath + filename;
File pdfFile =new File(fullPath);
PDDocument document = null;
document = PDDocument.load(pdfFile);
PDFRenderer renderer = new PDFRenderer(document);
int numPages = document.getNumberOfPages();
int count = 1;
for (int i = 0; i < numPages; i++)
{
BufferedImage image = renderer.renderImage(i, 1);
File imageFile = new File( filePath + File.separator +
FilenameUtils.getBaseName(filename) + File.separator +
FilenameUtils.getBaseName(filename) + "_" + count++ + ".jpg" );
imageFile.mkdirs();
ImageIO.write(image, "jpg",imageFile);
}
Appreciate for any solution.
Best Regards,
Jason Hue
On Saturday, September 20, 2014 1:55 PM, Tilman Hausherr
<[email protected]> wrote:
new PDFRenderer(document).renderImage() or renderImageWithDPI()
Download the source code and look at the examples and at the tests
Enjoy!
Tilman
Am 20.09.2014 um 05:05 schrieb Jason Hue:
> Hi,
>
> May i know how to convert PDF to Image using PDFBOX 2.0.0 ?
>
> Thanks,
> Jason