PDF Compression preset INI files

PDF Compression presets are stored in separate INI files.

Each preset INI file must have an entry in the IceViewer.ini. See the description of the IceViewer.ini [PDF Compression] section.

Each preset INI file contains the following sections. The section and key names must be written exactly as shown.

[Preset]

Name: The name of the preset shown in the Settings list of the Advanced PDF Optimizer dialog, in double quotes, for example "Report". The name must be unique and cannot be empty.

Read Only: Sets whether the preset can be changed and deleted in IceViewer. Possible options:

  • 0: The preset can be changed and deleted. (default)
  • 1: The preset cannot be changed or deleted. The Custom preset cannot be read-only.

[Images]

Enabled: Sets whether images are optimized. Possible options:

  • 0: Images are not changed.
  • 1: Images are optimized using the settings in the image sections below. (default)

Optimize images only if there is a reduction in size: Keeps the original image when the optimized image would not be smaller. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Allow recompression of existing JPEG images: Sets whether images that are already JPEG compressed may be compressed again. This saves more space, but can slightly reduce the image quality. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

[Color images] and [Grayscale images]

Both sections use the same keys. The settings apply to color and grayscale images respectively.

Downsample: Sets whether the resolution of high resolution images is reduced. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Downsample to (ppi): The resolution in pixels per inch that images are reduced to. (default: 150)

For images above (ppi): Only images with a higher resolution than this value are downsampled. Must be at least the value of Downsample to (ppi). (default: 225)

Compression: The compression used for the images. Possible options:

  • Retain existing: Images keep their current compression.
  • JPEG: Lossy JPEG compression, best for photos. (default)
  • JPEG 2000: Lossy or lossless JPEG 2000 compression.
  • ZIP: Lossless compression, best for screenshots and drawings. Flate is also accepted.
  • Auto: IceViewer chooses the compression for each image.

Quality: The image quality for the selected compression. Not used with ZIP compression. Possible options:

  • • Minimum
  • Low
  • Medium (default)
  • High
  • Maximum
  • Lossless: Only with JPEG 2000 compression.

[Monochrome images]

Downsample: Sets whether the resolution of high resolution black-and-white images is reduced. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Downsample to (ppi): The resolution in pixels per inch that black-and-white images are reduced to. (default: 300)

For images above (ppi): Only images with a higher resolution than this value are downsampled. Must be at least the value of Downsample to (ppi). (default: 450)

Compression: The compression used for black-and-white images. Possible options:

  • Retain Existing: Images keep their current compression.
  • ZIP: Lossless compression. Flate is also accepted.
  • CCITT Group 3: Fax compression.
  • CCITT Group 4: Fax compression, usually smaller than Group 3.
  • JBIG2: The smallest files. (default)
  • Auto: IceViewer chooses the compression for each image.

Quality: The quality of black-and-white images. Only used with JBIG2 and Auto compression. Possible options:

  • Lossy: Smaller files. (default)
  • Lossless: Every pixel is kept exactly.

[Fonts]

Enabled: Sets whether fonts are optimized. Possible options:

  • 0: Fonts are not changed.
  • 1: Fonts are optimized. (default)

Subset embedded TrueType fonts: Keeps only the characters that the document uses from each embedded TrueType font. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Do not unembed any font: Sets whether all embedded fonts are kept. Possible options:

  • 0: The fonts listed in Fonts to unembed are removed from the document. (default)
  • 1: No fonts are removed. Fonts to unembed is ignored.

Fonts to unembed: The embedded fonts that are removed from the document, separated by spaces and enclosed in double quotes, for example "Arial-BoldMT TimesNewRomanPSMT". Use the exact PDF font names, without the leading slash, including any subset prefix, for example ABCDEF+Arial-BoldMT. All fonts with a listed name are removed. If the key is missing, no fonts are removed.

[Discard Objects]

Each key removes one kind of object from the document. Possible options for all keys:

  • 0: The objects are kept.
  • 1: The objects are removed.

Discard all links, actions and JavaScript: Links, buttons and scripts. (default: 0)

Discard all alternate images: Extra versions of images, for example for printing. (default: 1)

Discard embedded page thumbnails: Page thumbnail images stored in the document. (default: 1)

Discard document tags: The document structure used by screen readers. (default: 0)

Discard embedded print settings: Print settings such as paper size and number of copies. (default: 0)

Discard bookmarks: The bookmarks of the document. (default: 0)

[Discard User Data]

Each key removes one kind of user data from the document. Possible options for all keys:

  • 0: The data is kept. (default for all keys)
  • 1: The data is removed.

Discard all comments: Notes, highlights and other annotations.

Discard all form fields (without flattening): Form fields and their values.

Discard all multimedia: Embedded sound and video.

Discard document information and metadata: Title, author, keywords and other document information. When enabled, the modification date of the document is not updated either.

Discard file attachments: Files embedded in the document.

Discard private data of other applications: Data that other applications stored in the document.

[Clean Up]

Compress document structure (object streams): Stores the internal structure of the document in compressed object streams. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Use Flate to encode streams that are not encoded: Compresses the parts of the document that are not compressed yet. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Optimize page content: Removes redundant drawing instructions from the pages. Possible options:

  • 0: Disabled.
  • 1: Enabled. (default)

Optimize the PDF for fast web view: Lets the first page appear quickly when the document is opened from a website. This can make the file slightly larger. Possible options:

  • 0: Disabled. (default)
  • 1: Enabled.

Sample preset file

[Preset]

Name="Small scans"

Read Only=0

[Images]

Enabled=1

Optimize images only if there is a reduction in size=1

Allow recompression of existing JPEG images=1

[Color images]

Downsample=1

Downsample to (ppi)=150

For images above (ppi)=225

Compression=JPEG

Quality=Low

[Grayscale images]

Downsample=1

Downsample to (ppi)=150

For images above (ppi)=225

Compression=JPEG

Quality=Low

[Monochrome images]

Downsample=1

Downsample to (ppi)=300

For images above (ppi)=450

Compression=JBIG2

Quality=Lossy

[Fonts]

Enabled=1

Subset embedded TrueType fonts=1

Do not unembed any font=1

[Discard Objects]

Discard embedded page thumbnails=1

Discard all alternate images=1

[Clean Up]

Compress document structure (object streams)=1

Optimize page content=1