Skip to content
PDF Tips

Open Source PDF Processing: LibreOffice, Ghostscript & Stirling

Discover powerful open source tools for PDF processing—LibreOffice, Ghostscript, and Stirling-PDF—and learn how to leverage them effectively.

By · Reviewed by PDFRun Editorial Team
Published July 5, 2026 · 6 min read

Open source PDF processing tools have revolutionized how individuals and organizations handle document workflows without expensive proprietary software. Three standout solutions—LibreOffice, Ghostscript, and Stirling-PDF—offer powerful capabilities for creating, converting, compressing, and manipulating PDF files. This guide explores each tool’s strengths and shows you how to implement effective PDF workflows using open source technology.

Whether you’re a developer automating document processing, a small business owner managing invoices, or someone who values privacy and control over your documents, understanding these open source options will save you money and increase your flexibility.

LibreOffice: The Document Conversion Powerhouse

LibreOffice is a comprehensive office suite that excels at creating and converting documents to PDF format. Its Writer, Calc, and Impress components produce high-quality PDFs directly from word processing documents, spreadsheets, and presentations.

To create a PDF from LibreOffice, open your document and select File > Export as PDF. The export dialog offers extensive options including image compression quality, PDF/A compliance for long-term archiving, and security settings like password protection and printing restrictions. These granular controls rival commercial solutions.

LibreOffice also works from the command line for batch processing. This command converts a Word document to PDF without opening the graphical interface:

libreoffice --headless --convert-to pdf document.docx

This automation capability makes LibreOffice valuable for server environments and scripted workflows. You can process hundreds of documents overnight or integrate PDF generation into web applications. However, LibreOffice focuses primarily on creation and conversion rather than advanced PDF manipulation like page extraction or form filling.

For quick conversions without installing software, PDFRun’s Word to PDF converter offers instant results through your browser.

Ghostscript: Advanced PDF Manipulation via Command Line

Ghostscript is the Swiss Army knife of PDF processing, operating primarily through command-line interfaces. This powerful interpreter handles PostScript and PDF files with exceptional versatility, making it indispensable for developers and power users.

One of Ghostscript’s most valuable features is PDF compression. This command significantly reduces file size while maintaining readability:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf input.pdf

The -dPDFSETTINGS parameter accepts values like /screen (lowest quality, smallest size), /ebook (moderate quality), /printer (high quality), and /prepress (highest quality for commercial printing). Choose based on your specific needs.

Ghostscript also excels at merging PDFs. This command combines multiple files into one document:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf file1.pdf file2.pdf file3.pdf

For splitting PDFs, you can extract specific page ranges. This extracts pages 1-5:

gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dFirstPage=1 -dLastPage=5 -sOutputFile=output.pdf input.pdf

While extremely powerful, Ghostscript’s command-line nature presents a learning curve. Users seeking graphical alternatives can use PDFRun Compress for file size reduction or PDFRun Merge for combining documents through an intuitive web interface.

Stirling-PDF: Comprehensive Web-Based PDF Toolkit

Stirling-PDF bridges the gap between command-line power and user-friendly interfaces. This self-hosted web application provides a complete PDF processing suite accessible through any browser, combining the capabilities of multiple open source tools into one cohesive platform.

Unlike LibreOffice and Ghostscript, Stirling-PDF offers a graphical interface for dozens of PDF operations including conversion, compression, merging, splitting, rotation, watermarking, OCR, and form filling. The application processes everything locally—files never leave your server, ensuring complete privacy and control.

Setting up Stirling-PDF is straightforward with Docker. This single command launches the application:

docker run -d -p 8080:8080 -v ./data:/usr/share/tessdata --name stirling-pdf frooodle/s-pdf:latest

Once running, navigate to http://localhost:8080 to access the full interface. The home page presents organized categories: Convert, Security, Images, Page Operations, and General utilities. Each tool provides clear instructions and real-time processing.

Stirling-PDF leverages other open source projects like Apache PDFBox, LibreOffice, OCRmyPDF, and Tesseract OCR under the hood. This integration means you access the combined power of multiple specialized tools through one consistent interface, eliminating the need to learn different command syntaxes.

For organizations requiring on-premises document processing with no cloud dependencies, Stirling-PDF provides an enterprise-grade solution. However, individual users who prefer not to self-host can access similar functionality through PDFRun, which is powered by Stirling-PDF technology and requires no installation.

Choosing the Right Tool for Your PDF Workflow

Each open source solution serves different use cases. Select based on your specific requirements:

Choose LibreOffice when:

  • You need to create PDFs from office documents with precise formatting control
  • PDF/A compliance for archiving is essential
  • You want batch conversion of document formats
  • You’re already using LibreOffice for document editing

Choose Ghostscript when:

  • You’re comfortable with command-line tools
  • You need to automate PDF processing in scripts
  • Server-side document handling without GUI is required
  • Maximum compression and quality control is essential

Choose Stirling-PDF when:

  • You need comprehensive PDF manipulation beyond creation
  • A user-friendly interface is important for your team
  • You want to self-host with complete privacy control
  • You require OCR, form filling, and advanced features in one place

Many professionals combine these tools. For example, use LibreOffice to create initial PDFs, Ghostscript for automated compression in batch scripts, and Stirling-PDF for ad-hoc splitting, merging, and security operations.

Practical Workflow Examples

Invoice Processing Workflow: A small business receives invoices in various formats. LibreOffice converts Word and Excel files to PDF, Ghostscript compresses them to reduce storage costs, and Stirling-PDF merges monthly batches into single archive files with timestamps added as watermarks.

Document Publication Pipeline: Technical writers produce documentation in LibreOffice Writer. A script exports chapters as individual PDFs, Ghostscript optimizes them for web viewing, and Stirling-PDF adds page numbers and applies password protection before distribution.

Scan Digitization Project: Historical documents are scanned as image PDFs. Stirling-PDF runs OCR to make them searchable, rotates misaligned pages, and removes blank pages. Ghostscript then compresses the final archives for long-term storage.

These workflows demonstrate how open source tools create professional document management systems without licensing costs. Users who prefer cloud-based convenience can replicate these operations using PDFRun Rotate, PDFRun OCR, and other specialized tools.

Frequently Asked Questions

Can open source PDF tools really replace Adobe Acrobat?

For most users, yes. LibreOffice, Ghostscript, and Stirling-PDF together handle PDF creation, conversion, compression, merging, splitting, security, OCR, and form filling—covering 95% of typical PDF tasks. Adobe Acrobat retains advantages in advanced form creation, certain prepress workflows, and specific proprietary features, but open source alternatives meet the needs of individuals, small businesses, and many enterprises without subscription costs.

Are open source PDF processors secure and private?

Absolutely. Open source tools like LibreOffice, Ghostscript, and Stirling-PDF process documents locally on your machine or server. No files are uploaded to third-party servers, eliminating privacy concerns associated with online-only services. Additionally, open source code can be audited by security researchers, often making these tools more trustworthy than closed-source alternatives. Stirling-PDF specifically emphasizes local processing with no external data transmission.

How difficult is it to learn command-line tools like Ghostscript?

Ghostscript has a learning curve, but mastering a few core commands covers most common tasks. Start with basic compression and merging operations using the examples in this article. Document the commands you use frequently in simple scripts or text files for reference. Alternatively, use Stirling-PDF or PDFRun for graphical interfaces that handle the same operations without command-line knowledge. Many users learn Ghostscript gradually, starting with GUI tools and transitioning to automation as their needs grow.

#Ghostscript #LibreOffice #open source PDF #Stirling-PDF

Try PDFRun Free

40+ PDF tools, no account required. Process your first file in under 30 seconds.

Open PDF Tools →