Therefore, you need to instantiate this class as shown below. The class named PDFRenderer renders a PDF document into an AWT BufferedImage. Step 2: Instantiating the PDFRenderer Class PDDocument document = PDDocument.load(file) This method accepts a file object as a parameter, since this is a static method you can invoke it using class name as shown below.įile file = new File("path of the document") Load an existing PDF document using the static method load() of the PDDocument class. PDFBox library provides you a class named PDFRenderer which renders a PDF document into an AWT BufferedImage.įollowing are the steps to generate an image from a PDF document. In this chapter, we will understand how to extract an image from a page of a PDF document. In the previous chapter, we have seen how to merge multiple PDF documents.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |