extract images from pdf using pdfbox

前端 未结 8 1970
刺人心
刺人心 2020-11-28 09:22

I m trying to extract images from a pdf using pdfbox. The example pdf here

But i m getting blank images only.

The code i m trying:-

public st         


        
8条回答
  •  感情败类
    2020-11-28 09:43

    You can use PDPage.convertToImage() function which can convert the PDF page into a BufferedImage. Next you can use the BufferedImage to create an Image.

    Use the following reference for further detail:

    • All PDF realated classes in PDFBox you can get in Apache PDFBox 1.8.3 API
    • Here you can see PDPage related documentation.

    And do not forget to look for PDPage.convertToImage() function in PDPage class.

提交回复
热议问题