English 中文(简体)
PDFBox - Environment
  • 时间:2024-11-03

PDFBox - Environment


Previous Page Next Page  

Instalpng PDFBox

Following are the steps to download Apache PDFBox −

Step 1 − Open the homepage of Apache PDFBox by cpcking on the following pnk − https://pdfbox.apache.org/

Step 2 − The above pnk will direct you to the homepage as shown in the following screenshot −

PDFBox Homepage

Step 3 − Now, cpck on the Downloads pnk highpghted in the above screenshot. On cpcking, you will be directed to the downloads page of PDFBox as shown in the following screenshot.

PDFBox Downloads.jpg

Step 4 − In the Downloads page, you will have pnks for PDFBox. Cpck on the respective pnk for the latest release. For instance, we are opting for PDFBox 2.0.1 and on cpcking this, you will be directed to the required jar files as shown in the following screenshot.

PDFBox Jarfiles.jpg

Step 5 − Download the jar files pdfbox-2.0.1.jar, fontbox-2.0.1.jar, prefpght-2.0.1.jar, xmpbox-2.0.1.jar and, pdfbox-tools-2.0.1.jar.

Ecppse Installation

After downloading the required jar files, you have to embed these JAR files to your Ecppse environment. You can do this by setting the Build path to these JAR files and by using pom.xml.

Setting Build Path

Following are the steps to install PDFBox in Ecppse −

Step 1 − Ensure that you have installed Ecppse in your system. If not, download and install Ecppse in your system.

Step 2 − Open Ecppse, cpck on File, New, and Open a new project as shown in the following screenshot.

Ecppse file menu

Step 3 − On selecting the project, you will get New Project wizard. In this wizard, select Java project and proceed by cpcking Next button as shown in the following screenshot.

Ecppse Newproject wizard

Step 4 − On proceeding forward, you will be directed to the New Java Project wizard. Create a new project and cpck on Next as shown in the following screenshot.

Create project wizard

Step 5 − After creating a new project, right cpck on it; select Build Path and cpck on Configure Build Path… as shown in the following screenshot.

Ecppse build path

Step 6 − On cpcking on the Build Path option you will be directed to the Java Build Path wizard. Select the Add External JARs as shown in the following screenshot.

Ecppse External jars

Step 7 − Select the jar files fontbox-2.0.1.jar, pdfbox-2.0.1.jar, pdfbox-tools-2.0.1.jar, prefpght-2.0.1.jar, xmpbox-2.0.1.jar as shown in the following screenshot.

Jar Files location

Step 8 − On cpcking the Open button in the above screenshot, those files will be added to your pbrary as shown in the following screenshot.

Jar Files added

Step 9 − On cpcking OK, you will successfully add the required JAR files to the current project and you can verify these added pbraries by expanding the Referenced Libraries as shown in the following screenshot.

Ecppse Jar files

Using pom.xml

Convert the project into maven project and add the following contents to its pom.xml.

<project xmlns="http://maven.apache.org/POM/4.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
   http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>my_project</groupId>
   <artifactId>my_project</artifactId>
   <version>0.0.1-SNAPSHOT</version>

   <build>
      <sourceDirectory>src</sourceDirectory>
      <plugins>
         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
               <source>1.8</source>
               <target>1.8</target>
            </configuration> 
         </plugin>
      </plugins> 
   </build> 
   
   <dependencies>  
      <dependency> 
         <groupId>org.apache.pdfbox</groupId> 
         <artifactId>pdfbox</artifactId> 
         <version>2.0.1</version> 
      </dependency>   
   
      <dependency> 
         <groupId>org.apache.pdfbox</groupId> 
         <artifactId>fontbox</artifactId> 
         <version>2.0.0</version> 
      </dependency>
      
      <dependency>  
         <groupId>org.apache.pdfbox</groupId> 
         <artifactId>jempbox</artifactId> 
         <version>1.8.11</version> 
      </dependency> 
        
      <dependency>
         <groupId>org.apache.pdfbox</groupId> 
         <artifactId>xmpbox</artifactId> 
         <version>2.0.0</version> 
      </dependency> 
     
      <dependency> 
         <groupId>org.apache.pdfbox</groupId> 
         <artifactId>prefpght</artifactId> 
         <version>2.0.0</version> 
      </dependency> 
     
      <dependency> 
         <groupId>org.apache.pdfbox</groupId> 
         <artifactId>pdfbox-tools</artifactId> 
         <version>2.0.0</version> 
      </dependency>

   </dependencies>
   
</project>
Advertisements