Convert PDF to PCL in Java

Andrew Wilson
1 min readMay 16, 2022

PCL (Printer Command Language) is a page description language developed to provide efficient control of printer functions between various printing devices. This article will share how to programmatically convert PDF to PCL using Free Spire.PDF for Java (a totally free library for commercial and personal use).

Import JAR Dependency

Method 1: Download the free library and unzip it. Then add the Spire.Pdf.jar file to your project as dependency.
Method 2: Directly add the jar dependency to maven project by adding the following configurations to the pom.xml.


Sample Code

To convert a PDF file to PCL, you can simply load a pdf document and then convert it to PCL using PdfDocument.saveToFile() method offered by Free Spire.PDF for Java.

import com.spire.pdf.*;

public class toPCL {
public static void main(String[] args) {

//Create a PdfDocument instance
PdfDocument doc = new PdfDocument();

//Load a pdf document

//Convert to pcl file
doc.saveToFile("ToPCL.pcl", FileFormat.PCL);



Andrew Wilson

Explore C#, Java and Python solutions for processing Word/Excel/PowerPoint/PDF files.