Print

Extract Text From PDF Java

Using Apache PDFBox library, we can extract text/strings from a pdf file. In this example, we extract text from a pdf file named "test.pdf". We create a maven based project and add Apache PDFBox library dependency in the pom.xml file. 

<dependency>
     <groupId>org.apache.pdfbox</groupId>
     <artifactId>pdfbox</artifactId>
     <version>1.8.9</version>
 </dependency>

Write the following code in the "ReadPdfText.java" class.

Print

Create Pdf In Java

The Apache PDFBox™ library is an open source Java tool for working with PDF documents. This library allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. Apache PDFBox also includes several command line utilities. This article explains how to create a pdf file with multiple lines of words using Apache PDFBox library. 

We create a maven based project and add Apache PDFBox library in the pom.xml file. 

<dependency>
    <groupId>org.apache.pdfbox</groupId>
    <artifactId>pdfbox</artifactId>
    <version>1.8.9</version>
</dependency>

Write the following code in the "CreatePdfDocument.java" class.