PDF Optimizer JSON Profiles

PDF Optimizer JSON Profiles

PDF Optimizer offers a lot of flexibility on the type and amount of optimization performed on PDF files. You control this flexibility using a PDF Optimizer profile file. PDF Optimizer profiles are JSON files that control the optimizations performed during file processing. Maybe you need PDF content for mobile viewing, web view, PDF/A-1b archival, or simply PDF size reduction. Fortunately, you can create custom tailored profiles to match your exact needs. Let’s look at how PDF Optimizer works, and the default profiles you can modify to create your own.

Understanding the Optimization Process

As PDF Optimizer processes a PDF document, the system follows a series of steps described below. The PDF Optimizer profile allows you to define the settings involved in the optimization process.

  1. The system flattens transparencies found in the PDF input document (optional)
  2. PDF Optimizer converts colors in the PDF input document to a target color space (optional)
  3. Items in the PDF document are optimized, then the objects are compressed as a part of the cleanup process
  4. PDF Optimizer converts the optimized document so that it is compliant with the PDF/A-1b specification (optional)

These steps are described in detail in the PDF Optimizer documentation.

Optimization Categories

The methods used to control optimization are divided into several categories:

  • Images
    • Allows for re-sampling (changing resolution and compression)
    • Consolidation of duplicates
  • Fonts
    • Subset embedded fonts
    • Consolidation of duplicate fonts
    • Remove base 14 fonts
  • Transparency
    • Allows for flatting of transparent objects
  • Objects
    • Removal of one or more object types, java-script, alternate images, thumbnails, document tags, bookmarks
  • User Data
    • Removal of one or more of the following data types
      • Comments
      • Document descriptions and metadata
      • File attachments
      • External cross reference
      • Private data
  • Cleanup
    • Define overall compression
  • General
    • Allows PDF Optimizer to write output even if file is larger
  • Color Conversion
    • Enables PDF Optimizer to convert colors in a PDF document using a target profile
  • PDFA Conversion
    • This setting directs PDF Optimizer to save an optimized PDF document so that it is compliant with the PDF/a-1b standard.

Default Profiles

Now that we have a good idea of PDF Optimizer capabilities, let’s look the default profiles provided.

The mobile.json and standard.json profiles provided with the installation are found in the Optimization Profiles folder. This folder is located in the PDF Optimizer installation directory. These samples provide entries for most options and provide a good starting point for creating your own custom profiles. Profile entries are organized into the same categories that we saw listed above. A third sample profile is located at the end of the PDF Optimizer documentation. The sample in the documentation contains an entry for every available option for each category.

The standard.json PDF Optimizer profile has entries for most optimizer functions. Note that some settings are off and will not affect the document. The standard profile represents a typical attempt to create a smaller PDF document.

When you review the mobile profile, notice that it differs from the standard profile in three areas:

  • Image – more aggressive down sampling with better quality re-compression
  • User data – removal
  • Objects – thumbnails removed

Setting Up Your Profile

You should now have a good understanding of PDF Optimizer profile capabilities and structure. Your JSON profile file should include only settings that define changes you want applied to your PDF documents. You can make your custom profile file as long or as short as you need. Depending on the types of changes you plan to apply, you may only need settings from one or two categories.

All of the settings for compressing a PDF document in PDF Optimizer are optional, and turned off by default. Only settings included in the JSON file are applied. Flag settings must be set to “ON” to take effect. Settings that are turned off do not need to be defined in the JSON profile file. You can create a custom JSON file with only a single setting to compress images. Looking at such a JSON file, you would see it only holds five or six lines of text.

NOTE: Only use lowercase characters for the keys and values you add to the JSON file.

PDF/a-1b Profile

An example of a simple profile to optimize PDFs for the PDF/a-1b archival standard would look like this:

{
   "general": {
        "write-output-even-if-increase-in-size": "on"
   },
   "pdfa-1b-conversion": {
       "enabled": "on",
       "pdfa-1b-target-color-space": "rgb",
       "rasterize-if-errors-encountered": "off"
   }
}

For more complex profiles, simply take one of the provided sample profiles, rename it, and adjust the parameters as needed. Turn parameters on or off, adjust levels of compression, and identify content that can be removed. Don’t forget to download our free PDF Checker tool to detect errors within your PDF – many of which can be resolved with PDF Optimizer.

Leave a comment below if you have questions, or a PDF Optimizer profile you would like to share.

Leave a Reply

Your email address will not be published. Required fields are marked *