3-Heights™ PDF Optimizer - Compress PDF in C#, Java or Command Line

The 3-Heights™ PDF Optimizer optimizes PDF files in various aspects. The main application is a PDF compressor, i.e. reduce the file size for electronic document exchange or space-saving document archiving. A combination of various sophisticated features allows for high compression with no or minimum visual quality loss. Another application is to optimize PDF for printing, by merging embeded fonts to reduce the spool file size and apply device specific color space conversion. The PDF Optimizer comes in different variants: as Shell to be used on the command line, as watched folder service and as API to be used with C#, Visual Basic, Java, C/C++.

Compress PDF

Resize your files according to your requirements

Optimize PDF

Convert color spaces and optimize fonts for printing

Compress Multiple PDF Files

Optimize your PDF by batch or programmatically (C#, Java, C++)

Automate compression of PDF documents in professional digital printing software

Processes have become faster and more reliable, and also enabled inbro to leverage their investment in cloud computing to be able to scale their business cheaply and effectively. Due to the implementation of PDF Optimization the permanent infrastructure could even be reduced by one managed machine.

“Proofs to Perfection” with the 3-Heights™ PDF Optimizer and Command Line Suite

File processing and file transmission without a loss in quality have been substantially improved through integration of the PDF Tools products in the document management workflow.

Advanced PDF document optimization & PDF compression features

PDF Optimizer - Features

Easy configurability through optimization profiles:

  • Web profile
    • Remove redundant and unnecessary data for electronic document exchange
    • Down-sample, clip, and intelligently compress images
    • Merge and subset fonts
    • Linearize the output
    • Convert colors to RGB
  • Archive profile
    • Remove redundant and unnecessary data for archiving
    • Intelligently compress images
    • Merge and subset fonts
  • Print profile
    • Remove redundant and unnecessary data for printing
    • Down-sample, clip, and intelligently compress images
    • Merge and subset fonts
    • Convert colors to CMYK

Features and fine grained configuration for optimizing images

  • Separately configurable compression of bi-tonal, indexed and continuous (i.e. color and gray-scale) images
  • Define threshold in dots per inch (DPI) for triggering image down-sampling
  • Define target image resolution in DPI for image down-sampling
  • Automatically select best compression type for each image
  • Configure enforcement of configured compression types
  • Color conversion to CMYK, RGB, or GrayScale
  • Remove invisible parts of images
  • Reduce the number of color channels used for images, image masks and soft masks if applicable
  • Convert soft masks to image masks if applicable
  • Perform mixed raster content (MRC) optimization for images
  • Choose color management engine
  • Remove images entirely and substitute by empty XObjects

Features and fine grained configuration for optimizing fonts

  • Subset font programs to contain only the used glyphs
  • Merge compatible font programs and fonts
  • Compress Type1 fonts (convert to CFF)
  • Remove font programs

Features for optimizing page content 

  • Remove unused resources
  • Automatic page content optimization
  • Flatten or remove page annotations and form fields

Fine grained configuration for removal of:

  • Redundant objects
  • Embedded standard fonts (e.g. Courier, Arial, Times)
  • Embedded, non-symbolic fonts
  • Unnecessary file information
  • Article threads
  • Alternative images
  • Metadata
  • Page piece information
  • Output intent
  • Document structure tree including markup
  • Miniature page preview images (Thumbnails)
  • Spider (web capture) information

Features and configuration on file level

  • Read encrypted input files
  • Encrypt and set access authorization for the output file
  • Process memory-resident files
  • Automatic removal of obsolete objects stemming from previous changes to the file
  • Set minimum PDF version of the output file
  • Linearize output file for fast web view

Listing and extraction features

  • List fonts and their properties
  • List and extract images and their properties
  • Extract number of pages
  • Error code


  • ISO 32000-1 (PDF 1.7)
  • ISO 32000-2 (PDF 2.0)

Supported formats

Input formats

  • PDF 1.0 to 1.7
  • PDF 2.0

Output formats

  • PDF 1.0 to 1.7
  • PDF 2.0

Areas of use - customized PDF compression

Web & Mail

Web-based applications demand short response times. Potential customers lose interest when online publications and documents are slow to load. Same as poorly compressed PDF documents make emails unnecessarily large and can slow down communications or prevent the exchange of documents by email altogether. Small and linearized PDF documents reduce response times significantly and improve the outgoing mail processes significantly.

Pre-press stage

The priorities in the pre-press stage focus on correct reproduction and color quantity reduction during printing. Hence, all colors can be converted to CMYK for instance.

Other areas of use

  • Web publishing platform
  • As an optimization step after assembling documents from a heterogeneous source
  • Conversion of colors to standardize corporate color space standards


Archiving requirements can vary. For instance, alternative images may be required in one case but not in another. Redundant or unnecessary data should not be archived in either scenario. The 3‑Heights™ PDF Optimizer component offers selective optimization options to enable precisely these kinds of configuration variations.

Checklist how to optimize PDF documents

  • Identify target application area
    for example:
    • Web (small size, short download, fast display)
    • Printing (correct fonts, right color scheme, suitable resolution)
    • Archiving (embedded fonts, color profiles, metadata)
    • Scanned documents (lossless image compression for ocr enginge)
    • Special requirements

  • Apply adequate optimization settings
    for example:
  • Color space
  • Resolution
  • Fonts
  • Color/monochrome compression
  • Bi-tonal compression
  • Redundant objects
  • Article thread
  • Form field
  • Alternate images
  • Meta data
  • Page piece info
  • Document structure tree
  • Thumbnails
  • Spider

Optimize PDF document for archiving

Apply the optimization profile for archiving to reduce the file size while following the archive-typical imperative of preserving all information. Redundant objects are removed, embedded font files are merged and reduced to the subset of used glyphs. Resources are optimized and images are compressed depending on their type.

C# sample:
// Create the optimizer
using (Optimizer optimizer = new Optimizer())
    // Choose the optimization profile for archiving
    optimizer.Profile = PDFOptimizationProfile.eOptimizationProfileArchive;

    // Open input file
    if (!optimizer.Open(inputPath, ""))
        throw new Exception(String.Format("Input file {0} cannot be opened. " +
            "{1} (ErrorCode: 0x{2:x}).", inputPath, optimizer.ErrorMessage, optimizer.ErrorCode));

    // Save output file
    if (!optimizer.SaveAs(outputPath, "", "", PDFPermission.ePermNoEncryption))
        throw new Exception(String.Format("Output file {0} cannot be created. " +
            "{1} (ErrorCode: 0x{2:x}).", outputPath, optimizer.ErrorMessage, optimizer.ErrorCode));

    // Close input file
    if (!optimizer.Close())
        throw new Exception(String.Format("Input file {0} cannot be closed. " +
            "{1} (ErrorCode: 0x{2:x}).", inputPath, optimizer.ErrorMessage, optimizer.ErrorCode));
Java sample:
// Create the optimizer
optimizer = new PdfOptimize();

// Choose the optimization profile for archiving

// Open input file
if (!optimizer.open(inputPath, "")) 
    throw new IOException(String.format("Input file %s cannot be opened. %s (ErrorCode: 0x%08x).",
        inputPath, optimizer.getErrorMessage(), optimizer.getErrorCode()));

// Save output file
if (!optimizer.saveAs(outputPath, "", "", NativeLibrary.PERMISSION.ePermNoEncryption)) 
    throw new IOException(String.format("Output file %s cannot be created. %s (ErrorCode: 0x%08x).",
        outputPath, optimizer.getErrorMessage(), optimizer.getErrorCode()));

// Close input file
if (!optimizer.close())
    throw new IOException(String.format("Input file %s cannot be closed. %s (ErrorCode: 0x%08x).",
        inputPath, optimizer.getErrorMessage(), optimizer.getErrorCode()));
C sample:
// Create the optimizer
pOptimizer = PdfOptimizeCreateObject();

// Choose the optimization profile for archiving
PdfOptimizeSetProfile(pOptimizer, eOptimizationProfileArchive);

// Open input file
if (!PdfOptimizeOpen(pOptimizer, szInputPath, _T("")))
    _tprintf(_T("Input file %s cannot be opened. %s (ErrorCode: 0x%08x).\n"), szInputPath,
        PdfOptimizeGetErrorMessage(pOptimizer), PdfOptimizeGetErrorCode(pOptimizer));
    iReturnValue = 1;
    goto cleanup;

// Save output file
if (!PdfOptimizeSaveAs(pOptimizer, szOutputPath, _T(""), _T(""), ePermNoEncryption))
    _tprintf(_T("Output file %s cannot be created. %s (ErrorCode: 0x%08x).\n"), szOutputPath,
        PdfOptimizeGetErrorMessage(pOptimizer), PdfOptimizeGetErrorCode(pOptimizer));
    iReturnValue = 1;
    goto cleanup;

// Close input amd output files
if (!PdfOptimizeClose(pOptimizer))
    _tprintf(_T("Input file %s cannot be closed. %s (ErrorCode: 0x%08x).\n"), szInputPath,
        PdfOptimizeGetErrorMessage(pOptimizer), PdfOptimizeGetErrorCode(pOptimizer));
    iReturnValue = 1;
    goto cleanup;

What you get with 3-Heights™ PDF Optimizer

  • Numerous features for customized optimization
  • Predefined optimization profiles for different applications
  • Efficient compression, thanks to powerful algorithms and methods
  • Designed for individual processing and mass processing
  • Powerful component with high stability, quality and scalability

☎ +41 43 411 44 51   ✉ pdfsales(at)pdf-tools.com

Quality assurance
Clean, lean and conform PDF documents without loss of quality and information.

Storage space
Relevant saving of storage space in the corresponding application area - especially for long-term digital archive storage.

Efficient processing through the 3-Heights™ architecture. Fast document display, short download times and optimal searchability thanks to elimination of redundant data and application-oriented PDF optimization.

PDF Expert blog - PDF document's color space - rich black vs true black

Replacing rich black by true black in PDF documents

When it comes to printing then all colors in a PDF document are transformed to the native color space of the printing device. If, e.g. a text uses a black RGB color then it is transformed to an equivalent CMYK value which contains contributions from all four color channels...

PDF Expert Blog - embedded fonts and PDF mass printing application

The problem with embedded fonts in PDF mass printing applications

PDF is more and more finding its way into mass printing applications. However, PDF spool files often ask too much from a print engine resulting in aborts or, even worse, incomplete prints which may not be noticed. What is special about PDF mass printing...

PDF Optimization - reduce your files to the max, compress and clean-up your PDF files

bids for bytes?
Reduce your documents
to the max!

Special - Optimization

Optimization - reduce your files to the max

Archival processes therefore need to be kept under control, with a focus on optimization. And one area that can be improved is data optimization itself.

Get more information about the benefits of document optimization and compression.