pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: How to convert PDF to Image using PDFBOX 2.0.0
Date Sat, 20 Sep 2014 08:39:44 GMT
You probably used only pdfbox.jar. Also use fontbox and xmpbox. 
Alternatively, use pdfbox-app only.

Depending on what pdf files you have, you may also need the levigo JBIG2 
jar file (google for it).

Tilman

Am 20.09.2014 um 09:59 schrieb Jason Hue:
> Hi,
>
> i encounter error java.lang.NoClassDefFoundError:org/apache/fontbox/ttf/Type1Equivalent
> if using
>
> BufferedImage image = renderer.renderImage(i, 1);
>
>
> then i change to BufferedImage image = renderer.renderImageWithDPI(i, 96);
> facing different error as below :
>
> java.lang.NoClassDefFoundError: org/apache/fontbox/ttf/TTFParser
>
>
> Appreciate for any advice.
>
> Best Regards,
> Jason
> .
> On Saturday, September 20, 2014 3:39 PM, Jason Hue <jason.huewk@yahoo.com.INVALID>
wrote:
>   
>
>
> 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 <THausherr@t-online.de>
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


Mime
View raw message