Hi  Tilman

Very appreciate for the help, finally able to generate the image but jvm having 
warning as below :

17:30:18,825 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (1) in font VRQGOC+TTE22F6270t00
17:30:18,826 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (2) in font VRQGOC+TTE22F6270t00
17:30:18,826 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (3) in font VRQGOC+TTE22F6270t00
17:30:18,827 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (4) in font VRQGOC+TTE22F6270t00
17:30:18,828 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (5) in font VRQGOC+TTE22F6270t00
17:30:18,829 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (6) in font VRQGOC+TTE22F6270t00
17:30:18,830 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (7) in font VRQGOC+TTE22F6270t00
17:30:18,831 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (8) in font VRQGOC+TTE22F6270t00
17:30:18,832 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (9) in font VRQGOC+TTE22F6270t00
17:30:18,834 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (20) in font 
WQJOPO+TTE1714AF0t00
17:30:18,836 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (21) in font 
WQJOPO+TTE1714AF0t00
17:30:18,837 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (22) in font 
WQJOPO+TTE1714AF0t00
17:30:18,838 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (23) in font 
WQJOPO+TTE1714AF0t00
17:30:18,841 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (24) in font 
WQJOPO+TTE1714AF0t00
17:30:18,842 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (25) in font 
WQJOPO+TTE1714AF0t00
17:30:18,844 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (26) in font 
WQJOPO+TTE1714AF0t00
17:30:18,847 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (27) in font 
WQJOPO+TTE1714AF0t00
17:30:18,850 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (28) in font 
WQJOPO+TTE1714AF0t00
17:30:18,852 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (29) in font 
WQJOPO+TTE1714AF0t00
17:30:18,855 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (30) in font 
WQJOPO+TTE1714AF0t00
17:30:18,855 WARN  [org.apache.pdfbox.pdmodel.font.PDSimpleFont] 
(taskExecutor-1) No Unicode mapping for .notdef (31) in font 
WQJOPO+TTE1714AF0t00

Do you have any idea for this ?

Thanks,
Jason


On Saturday, September 20, 2014 4:39 PM, Tilman Hausherr 
<[email protected]> wrote:
 


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 
> <[email protected]> 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 
> <[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

Reply via email to