Link

Running on Java 8 or later

JPedal includes a simple API. JPedal is written in Java but can be used from other languages or command line.

How to use JPedal from Command Line or any language

JPedal takes a set of commands which allow easy access to JPedal features. This list will appear if no commands are run or if you use the –help command as follows.

java -jar jpedal.jar --help

1

Examples to Convert PDF to Image

//convert Single file to BMP file (separate BMP for each page)
java -jar jpedal.jar --convert "pdfFile.pdf" imageOutput BMP

//convert directory of files to PNG file (separate PNG for each page)
java -jar jpedal.jar --convert files imageOutput PNG

More details can be found in the convert PDF to Image tutorials.

Examples to View PDF File

//open pdfFile.pdf in PDF Viewer
java -jar jpedal.jar --view "pdfFile.pdf" 

//open new blank PDF Viewer window
java -jar jpedal.jar --view 

More details can be found in the viewer tutorial.

Examples to Print PDF File

//Print the specified pdf file on the specified printer
java -jar jpedal.jar --print "pdfFile.pdf" "printerName"

//Print page 1 of the pdf file on the specified printer
java -jar jpedal.jar --print "pdfFile.pdf" "printerName" 1

More details can be found in the print tutorial.

Examples to Extract Images from PDF File

//Extract all raw images as PNG files from the specified PDF file
java -jar jpedal.jar --extractImages "pdfFile.pdf" "output/dir/" PNG

More details can be found in the extract images tutorial.

Examples to Extract Clipped Images from PDF File

//Extract all clipped images as PNG files from the specified PDF file
//at original size
java -jar jpedal.jar --extractClippedImages "pdfFile.pdf" "output/dir/" PNG -1 raw

//Extract all clipped images as PNG files from the specified PDF file
//at original size, and a height of 200px
java -jar jpedal.jar --extractClippedImages "pdfFile.pdf" "output/dir/" PNG -1 "raw" 200 "height200" 

More details can be found in the extract clipped images tutorial.

Examples to Extract Metadata from PDF File

//Extract all types of metadata from the specified file as JSON
java -jar jpedal.jar --metadata "pdfFile.pdf" 

//Extract only fields metadata from the specified file as JSON
java -jar jpedal.jar --metadata "pdfFile.pdf" fields

More details and a full list of metadata that can be returned can be found in the metadata tutorial.