User Manual

3­Heights® PDF Optimizer Service

Version 6.18.0 Contents

1 Introduction ...... 4 1.1 Description ...... 4 1.2 Functions ...... 4 1.2.1 Features ...... 5 1.2.2 Formats ...... 6 1.2.3 Conformance ...... 6 1.3 Service ...... 6 1.4 Operating Systems ...... 6

2 Installation ...... 7 2.1 Overview ...... 7 2.2 Windows ...... 7 2.3 Uninstall ...... 7 2.4 Color Profiles ...... 7 2.4.1 Default Color Profiles ...... 8 2.4.2 Get Other Color Profiles ...... 8 2.5 Note about the Evaluation License ...... 8

3 License Management ...... 9 3.1 License Features ...... 9

4 Getting Started ...... 10 4.1 Configuration ...... 10 4.1.1 Retrieve Information about Available Options and Settings ...... 10 4.2 Managing the Service ...... 11 4.2.1 State Diagram of the Service ...... 12 4.3 Using the Service ...... 13 4.4 Log Files ...... 13

5 Optimization Process ...... 14 5.1 How to Optimize PDF Documents ...... 14 5.1.1 Identify Target Application Area ...... 14 Web ...... 14 Printing ...... 14 Archiving ...... 15 Scanned Documents ...... 15 Special Requirements ...... 15 5.1.2 Using Optimization Profiles ...... 15 5.2 Optimizing Images ...... 16 5.2.1 Supported Types ...... 16 No Compression (Raw) ...... 16 DCT (JPEG) ...... 17 Flate (ZIP) ...... 17 LZW ...... 17 CCITT Group 3 and 4 ...... 18 JBIG2 ...... 18 JPEG2000 ...... 19 5.2.2 Relevant Factors for the File Size ...... 19 5.2.3 Provided Features for Optimizing Images ...... 20

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 1/56 5.2.4 Mixed Raster Content (MRC) Optimization for Images ...... 21 Phase 1: Cutting out Pictures ...... 22 Phase 2: Separation into Layers ...... 22 Phase 3: Reconstruction ...... 23 5.3 Optimizing Fonts ...... 23

6 Interface Reference ...... 24 6.1 Service Control Commands ...... 24 6.1.1 ­a Pause Service ...... 24 6.1.2 ­c Create Service ...... 24 6.1.3 ­d Delete Service ...... 24 6.1.4 ­i List the Usage ...... 24 6.1.5 ­o Continue Service ...... 25 6.1.6 ­q Query Current Status of Service ...... 25 6.1.7 ­s Start Service ...... 25 6.1.8 ­t Stop Service ...... 25 6.1.9 ­x Run as Executable ...... 25 6.2 Configuration options ...... 26 6.2.1 Configuration File pdfoptimizesvr.ini ...... 26 Autodelete of Successfully Processed Files ...... 26 Job Number Prefix ...... 27 Logpath ...... 27 Polling Interval ...... 28 6.2.2 ­w Specify the Path to the Root Directory ...... 28 6.2.3 ­wd Specify the Drop Path ...... 28 6.2.4 ­wfi Ignore Files with Certain Extensions ...... 29 6.2.5 ­wfs Process only Files with Certain Extensions ...... 29 6.3 Profile Settings ...... 29 6.4 Optimization Options ...... 32 6.4.1 ­c Set the Color Conversion ...... 33 6.4.2 ­cff Compress Type1 fonts (convert to CFF) ...... 33 6.4.3 ­cms Set the Color Management Engine ...... 33 6.4.4 Resolution Values per Image Type ...... 34 6.4.5 Threshold Values per Image Type ...... 35 6.4.6 ­dr Resolution in DPI ...... 35 6.4.7 ­dt Threshold in DPI ...... 36 6.4.8 ­fb Compression Types for Bi­tonal Images ...... 36 6.4.9 ­fc Compression Types for Color and Grayscale Images ...... 37 6.4.10 ­ff Force Re­Compression ...... 38 6.4.11 ­fi Compression Types for Indexed (Paletted) Images ...... 38 6.4.12 ­ft Force Compression Types ...... 39 6.4.13 ­fv Minimum PDF Version ...... 39 6.4.14 ­h Dithering Mode for Bi­Tonal Images ...... 39 6.4.15 ­id Set Value in the Document Information Dictionary ...... 40 6.4.16 ­m Merge Embedded Font Programs ...... 40 6.4.17 ­ml Compression Type for MRC Layers ...... 40 6.4.18 ­mlq Image Quality for MRC Layers ...... 41 6.4.19 ­mlr Resolution in DPI for MRC Layers ...... 41 6.4.20 ­mm Compression Type for the MRC Mask ...... 41 6.4.21 ­mp Compression Type for MRC Cut­Out Pictures ...... 41 6.4.22 ­o Owner Password ...... 42 6.4.23 ­oc Clip Images ...... 42

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 2/56 6.4.24 ­od Optimize Resources ...... 42 6.4.25 ­ol Linearize Only ...... 42 6.4.26 ­or Remove Redundant Objects ...... 43 6.4.27 ­ow Optimize for the Web ...... 43 6.4.28 ­owa Automaticall Optimize for the Web ...... 43 6.4.29 ­p Permission Flags ...... 44 6.4.30 ­pr Set an Optimization Profile ...... 45 6.4.31 ­pw Read an Encrypted PDF File ...... 46 6.4.32 ­q Compression Quality ...... 46 6.4.33 ­rc Reduce Color Complexity of Images ...... 46 6.4.34 ­ri Remove Images ...... 48 6.4.35 ­rf Remove Embedded Font Program ...... 48 6.4.36 ­rs Remove Embedded Standard Fonts ...... 48 6.4.37 ­s Subset Fonts ...... 49 6.4.38 Strip the File ...... 49 6.4.39 ­sfs Flatten Appearances of Signature Fields ...... 50 6.4.40 ­u User Password ...... 50

7 Tips, Tricks and Troubleshooting ...... 52 7.1 The Output File is Still Too large ...... 52 7.1.1 Images ...... 52 7.1.2 Fonts ...... 52 7.2 The Output File Is Larger Than the Input File ...... 52 7.3 The Selected Compression Type is not Applied ...... 53 7.4 The Output Document Is not Encrypted ...... 53

8 Version History ...... 54 8.1 Changes in Version 6 ...... 54 8.2 Changes in Version 5 ...... 54 8.3 Changes in Version 4.12 ...... 54 8.4 Changes in Version 4.11 ...... 54 8.5 Changes in Version 4.10 ...... 55 8.6 Changes in Version 4.9 ...... 55 8.7 Changes in Version 4.8 ...... 55

9 Licensing, Copyright, and Contact ...... 56

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 3/56 1 Introduction

1.1 Description

The 3­Heights® PDF Optimizer Service optimizes PDF documents to suit specific target needs such as electronic document exchange, archiving, or printing. Many processes produce PDF documents that may not be optimized for their specific target application. E.g. the file size may deteriorate download times, or multiply embedded fonts may impede printing. In most of the cases, there is no advantage gained when trying to convert a PDF to some other file format. In contrary, document content may be compromised and file size may increase. Optimization, on the other hand, often leads to good results, or lets the user finely tune trade­offs. The 3­Heights® PDF Optimizer Service not only provides easy configuration through the use of optimization profiles, but also flexible fine­grained control through various specific options.

1.2 Functions

The 3­Heights® PDF Optimizer Service reads an input document and writes the corresponding output document. Depending on the configured optimization options, various parts of the PDF are thereby processed as required. The 3­Heights® PDF Optimizer Service is capable of removing redundant or alternative information, sub­setting and merging font programs, down­sampling images, intelligently choose optimal compression algorithms, and linearize the PDF for fast web view.

PDF Optimizer

PDF

PDF (Print)

PDF PDF Analyze

Linearize PDF PDF Downsample (Web) Strip Features Convert Colors Remove Redundancy PDF

PDF (...) Parameters

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 4/56 1.2.1 Features

Easy configurability through optimization profiles, three of which are as follows: 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 Type 1 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

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 5/56 Spider (web capture) information Features and configuration on file level Read encrypted input files Encrypt and set access authorization for the output file 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 (not PDF 2.0)

1.2.2 Formats

Input Formats

PDF 1.x (PDF 1.0, …, PDF 1.7) PDF 2.0

Output Formats

PDF 1.x (PDF 1.0, …, PDF 1.7) PDF 2.0

1.2.3 Conformance

Standards: ISO 32000­1 (PDF 1.7) ISO 32000­2 (PDF 2.0)

1.3 Service

The 3­Heights® PDF Optimizer Service is a ready­to­use Windows Service that allows to install a Windows NT service process to automatically optimize PDF documents from watched folders by optimizing fonts, images and redundant information. The PDF Optimizer Service combines three programs in one executable. 1. An optimization service, that can be run on a Windows platforms (2000 or later). The service can be created, started, paused, resumed, stopped and deleted via the Windows service control panel and reports to the appli­ cation log of the Windows event log panel. 2. A command line interface to control the PDF optimization service. By means of this interface the service can be created, started, stopped and deleted, etc. 3. A query program which can be used to retrieve information about available options.

1.4 Operating Systems

The 3­Heights® PDF Optimizer Service is available for the following operating systems: Windows Client 7+ | x86 and x64 Windows Server 2008, 2008 R2, 2012, 2012 R2, 2016, 2019 | x86 and x64 ‘+’ indicates the minimum supported version.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 6/56 2 Installation

2.1 Overview

The PDF Optimizer Service is configured by the file pdfoptimizesvr.ini, which needs to be located in the same directory as the executable pdfoptimizesvr.exe. Before starting the service, the configuration file needs to be adjusted. How this is done is described in the chapter Configuration File pdfoptimizesvr.ini. Once configured, the service can be created, started, paused, continued, stopped and deleted via the command line. To use the create and delete functions, administrator permissions are required. To start and stop the service, operator permissions are required. When the service is running, it processes PDF documents that are copied or moved into watched folders. They are then renamed and moved to the folder Jobs. The renaming gives the PDF a 16 character long Time­stamp to create unique job tickets. This ensures there are no conflicts with documents that have the same name.

2.2 Windows

The 3­Heights® PDF Optimizer Service comes as an MSI installer. The installation of the software requires the following steps. 1. You need administrator rights to install this software. 2. Log in to your download account athttp://www.pdf­tools.com. Select the product “PDF Optimizer Service”. If you have no active downloads available or cannot log in, please contact pdfsales@­tools.com for assistance. You will find different versions of the product available. We suggest to download the version, which is selected by default. A different version can be selected using the combo box. The product comes as an MSI (Microsoft Installer) package that provides an installation routine for installing and uninstalling the 3­Heights® PDF Optimizer Service. The package installs the 64­bit version, which runs on 64­bit platforms only. 3. Start the MSI package and follow the steps in the installation routine. 4. Make sure your platform meets the requirements regarding color spaces described in chapter Color Profiles.

2.3 Uninstall

If you have used the MSI for the installation, go to Start → 3­Heights® PDF Optimizer Service… → Uninstall …

2.4 Color Profiles

The color conversion feature of the 3­Heights® PDF Optimizer Service uses color profiles by default. For calibrated color spaces (such color spaces with an associated ICC color profile) the color conversion is well de­ fined. For the conversion of uncalibrated device color spaces (DeviceGray, DeviceRGB, DeviceCMYK) however, the 3­Heights® PDF Optimizer Service requires apropriate color profiles. Therefore it is important, that the profiles are available and that they describe the colors of the device your input documents are intended for.

Note: When setting an alternative color management system such as Neuge­ bauer, no color profiles are required.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 7/56 If no color profiles are available, default profiles for both RGB and CMYK are generated on the fly by the 3­Heights® PDF Optimizer Service.

2.4.1 Default Color Profiles

If no particular color profiles are set default profiles are used. For device RGB colors a color profile named "sRGB Color Space Profile.icm" and for device CMYK a profile named "USWebCoatedSWOP.icc" are searched for in the following directories:

Windows 1. %SystemRoot%\System32\spool\drivers\color 2. directory Icc, which must be a direct sub­directory of where the pdfoptimizesvr.exe resides.

2.4.2 Get Other Color Profiles

Most systems have pre­installed color profiles available, for example on Windows at %SystemRoot%\sys­ tem32\spool\drivers\color\. Color profiles can also be downloaded from the links provided in the directory bin\Icc\ or from the following websites: http://www.pdf­tools.com/public/downloads/resources/colorprofiles.zip http://www.color.org/srgbprofiles.html https://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html

2.5 Note about the Evaluation License

With the evaluation license the 3­Heights® PDF Optimizer Service automatically adds a watermark to the output files.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 8/56 3 License Management

The 3­Heights® PDF Optimizer Service requires a valid license in order to run correctly. If no license key is set or the license is not valid, then an error message will be printed to the service log. More information about license management is available in the license key technote.

3.1 License Features

The functionality of the 3­Heights® PDF Optimizer Service contains two areas to which the following license features are assigned:

Optimize General optimization

Color Optimizations involving color conversion

A license can include an arbitrary set of these features. The presence of any feature in a given license key can be checked in the license manager. The Interface Reference specifies in more detail which functions are included in which license features.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 9/56 4 Getting Started

4.1 Configuration

Before starting the PDF Optimizer Service for the first time, the file pdfoptimizesvr.ini needs to be modified. Editing this file while the PDF Optimizer Service is running has no impact. The service first needs to be stopped and restarted after the modification. When opening this file with a text editor, it looks like this:

[PdfOptimizeSvr] AutoDelete=True Threads=2 Thread1=­w C:\WebOptimize ­pr web Thread2=­w C:\PrintOptimize ­pr print

The meaning of these keys and values in this example is as follows:

AutoDelete=True This option automatically deletes a PDF file after it is processed successfully. When set to False, the processed file will be copied to the sub directory Succeeded.

Threads= The given value stands for the total number of concurrent threads. Each thread can have its own assigned settings. One thread corresponds to one watched folder.

Threads1= Sets the options such as name of watched folder and settings etc. for thread 1.

­w C:\WebOptimize Creates a watched folder with the given name for this thread. The path must be an absolute path. Network mapped drive letters or relative paths or driver letters mapped via the subst command are not recognized, because the service process per default runs under the “LocalSystem” account. (The user can be changed as described in chapter Managing the Service.)

­pr web Sets the optimization options for this watched folder.

This means that any PDF document that is moved or copied to the folder C:\WebOptimize or C:\PrintOpti­ mize will be optimized with the web optimization profile or the print optimization profile respectively.

Note: Any string, such as a file name, that contains spaces must be enclosed in quotation marks. E.g. if the watched folder contains spaces in its path, the entire path needs to be quoted: ­w "C:\A path\with spaces".

4.1.1 Retrieve Information about Available Options and Settings

A quick overview over all configuration options and service control commands that the 3­Heights® PDF Optimizer Service supports can be output in the form of a usage message on the command line. To display this information, first open a Windows command line (cmd.exe) and then type:

pdfoptimizesvr

(See also Service Control Commands.) A short overview over all the options that can be configured in the pdfoptimizesvr.ini is displayed when typing the following in a Windows command line:

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 10/56 pdfoptimizesvr ­i

(See also Optimization Options.)

4.2 Managing the Service

Once the configuration is done, the service can be started and controlled by executing pdfoptimizesvr.exe on the command line. The path can be omitted if the pdfoptimizesvr.exe is included in the %PATH% environment variable.

Note: It is essential that the executable pdfoptimizesvr.exe and the con­ figuration file pdfoptimizesvr.ini be on a non­mapped drive.

Note: To create or delete the service, administrator permissions are required.

1. To create the service, use the option ­c.

pdfoptimizesvr ­c

After executing this command, the service is created. It is now visible in the “Computer Management” window under “Services”. To open the “Computer Management” window, go to Start → Control Panel → Administra­ tive Tools → Computer Management or simply right­click the icon “My Computer” on the desktop and select “manage”. If the services was created correctly it appears as “3­Heights® PDF Optimizer Service” as shown in the image below.

2. By default, the 3­Heights® PDF Optimizer Service runs in the “LocalSystem” account. After the service has been created, the user can be changed. This will be required in a situation where a network share is used as a watched folder and the process needs to run under a user with the appropriate access permission rights, since the account “LocalSystem” does not have any permissions on remote systems. To change the user, right­click the service in the Services window and select “Properties”. Then change the user in the tab “Log On”. 3. After its creation, the service can be started with the option ­s.

pdfoptimizesvr ­s

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 11/56 4. Now the 3­Heights® PDF Optimizer Service is up and running, and files can be moved, copied or drag­and­ dropped into the watched folder. 5. To stop the service, use the option ­t.

pdfoptimizesvr ­t

To restart use ­s again. 6. To delete the service use the option ­d.

pdfoptimizesvr ­d

4.2.1 State Diagram of the Service

The 3­Heights® PDF Optimizer Service behaves as described in the state diagram below: If “Stop” is called when the service is in the state “Paused”, the current job is aborted. This means the current page is finished processing, then the job is terminated. If “Stop” is called when the service is the state “Running”, the current job (all pages) is finished. Then the service is stopped.

Stopped

Create Stop (Abort)

Start Stop Delete

Resume

Unknown Running Paused Pause

Restart Restart (Abort / Start) (Stop / Start) Stop Delete Delete

Marked for Delete

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 12/56 4.3 Using the Service

Once the service is created and started, the watched folders configured in pdfoptimizesvr.ini are created automatically. In each watched folder, the following sub­folders are created: Jobs InProgress Succeeded Failed Optimized Logs Temp When a file is moved, copied, or drag­and­dropped into the configured watched folder, the service will do the fol­ lowing: 1. Each file is moved to the sub folder Jobs. While moving, the file is renamed by adding a 16 character long job­number prefix. This ensures a well defined processing order and unique file names. 2. A worker­thread takes the file from the folder Jobs and moves it to InProgress. The file is then processed. 3. Depending on the outcome of the processing, the following is done:

The file was processed successfully The input file is moved to the folder Succeeded or it is deleted, depending on whether AutoDelete or AutoDeleteAll is set to true or false in the configuration file pdfoptimizesvr.ini. The optimized document is stored in Optimized.

The file was not processed successfully The input file is moved to the folder Failed or it is deleted, depending on whether AutoDeleteALL is set to true or false in the configuration file pdfoptimizesvr.ini. A log file is created in the folder Logs. The file name is the same as the input file with the extension substituted by .txt.

4. In any case, an entry in the log file of this thread is created.

4.4 Log Files

The log file per thread Each thread (watched folder) has a log file. The log file resides in the same directory as the executable pdfoptimizesvr.exe and the configuration file pdfoptimizesvr.ini. It is named PdfOptimizeSvr­log­‹n›.txt, where the number of the log file ‹n› is increased whenever the service is re­started. The log file is locked by the service as long as the service is running. The log file contains general messages (including a time stamp that is not shown here) such as:

­ [1] Worker thread for directory C:\pdfoptimizesvr\Folder started.

Error messages such as:

* Error 0 while opening file C:\pdfoptimizesvr\Folder\InProgress\Job­...

The error log file per document For each document which failed to be processed successfully, there is an error log file created. The log file is written to the sub­folder Logs and has the same file name as the input document, with extension .txt. There is no error log available if a document cannot be opened (e.g. it is not an appropriate document type).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 13/56 5 Optimization Process

5.1 How to Optimize PDF Documents

5.1.1 Identify Target Application Area

PDF documents are used in a wide variety of application areas, all having different requirements. As a very first step, one should precisely identify the targeted application area. A few typical fields of application are described briefly below. However, PDF documents can also be used in other ways or in combinations of the ones listed below.

Web

All documents related to the web should be kept small in file size. As a consequence they take less storage on the web­server and can be transferred quicker, resulting in shorter download times. In order to reduce the file size as much as possible, all information that is not required for displaying the document without a visual loss can be removed. This may include: Down­sampling images (­dt, ­dr) Clipping images to their visible parts (­oc) Applying compressions algorithms with high compression ratios (­fb, ­fc, ­fi) Collapsing redundant objects (­or) Removing unused resources (­od) Removing irrelevant information such as article threads, metadata, alternate images, document structure infor­ mation, etc. (Strip the File) Merging and sub­setting embedded font programs (­s and ­m) Depending on the PDF documents to be optimized, font programs of embedded standard fonts can even be removed (­rs). Additionally, PDF documents can be linearized (­ow). This is a method of preparing a PDF file in way that pages can be accessed randomly via a PDF viewer web­browser plug­in, i.e. selected pages can be displayed before the whole file is downloaded. For this to work, the PDF viewer web­browser plug­in has to support correct interpretation of linearized PDF. Documents which are intended to be displayed on a Computer display should be saved in ab RGB (red green blue) color space. RGB is the native form for any light­emitting device, such as computer monitor or television. An RGB image uses three channels and therefore takes up less space than a CMYK (cyan magenta yellow black) image which uses four channels. (­c)

Printing

For printing applications the file size is not the highest priority. More important is to have a document which prints in a predictable way. This means that correct fonts should be used, colors should look as expected, images should be high in resolution, etc. For that reason no data from the original document that is used for a well­defined re­production should be removed or altered. Fonts should not be un­embedded, images should not be down­sampled. (Of course there are always exceptions). For many printing applications it may be advantageous to convert images to the CMYK color space because this is primarily used in systems that reflect light (such as printed paper). (­c)

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 14/56 In certain documents, the same font is embedded multiple times. If, e.g., a PDF­producing software embeds the same font for each created page, then large multi­page documents contain many copies of a font program. Also, a document can contain a complete font program, of which only very few glyphs are used for display. In such situations, merging and sub­setting font programs can lead to faster printing. (­m and ­s) There are still further ways to decrease the file size: Clipping images to their visible parts (­oc) Compressing uncompressed images, e.g. with a type (­fb, ­fc, ­fi, see also Supported Image Compression Types) Collapsing redundant objects (­or) Removing unused resources (­od) Removing irrelevant information for printing, such as thumbnails, article threads, document structure informa­ tion, etc. (Strip the File)

Archiving

Archiving can have varying requisites, such as: Minimize the file size, maximize the reproducibility of the document, minimize the access time to find a specific archived document, etc. The most common way for archiving a PDF is the PDF/A format, which is defined in the ISO Standard 19005. PDF/A requires fonts to be embedded, metadata to be included and prohibits certain features, like LZW or JPEG2000 com­ pression or alternate images. The 3­Heights® PDF Optimizer Service does not create PDF/A output but can be used, e.g., to reduce the file size prior to converting to PDF/A.

Scanned Documents

For certain types of scanned documents, MRC (mixed raster content) optimization can have a significant impact on file size while still preserve the visual appearance of the document. The 3­Heights® PDF Optimizer Service supports MRC, see also Mixed Raster Content (MRC) Optimization for Images.

Special Requirements

As an example for a specific requirement, the 3­Heights® PDF Optimizer Service supports the restriction of compres­ sion types for images in a document to a given list of types. (See ­ft, ­fb, ­fc, and ­fi.) Another requirement may be to encrypt the resulting PDF and protect it by a user password and/or by an owner password. The 3­Heights® PDF Optimizer Service provides both by means of the options ­p, ­u, and ­o. PDF documents which mainly consist of scanned images to which an OCR (optical character recognition) layer is to be applied at a later time should be optimized in a way that the OCR process of the optimized document works as well as with the original. That means that image compression should either be lossless, or at least perceptually lossless. Perceptually lossless refers to a compression which is lossy, but its visual quality is high enough that neither the human eye nor an OCR engine can distinguish between original and optimized document. (See also Supported Image Compression Types.)

5.1.2 Using Optimization Profiles

The 3­Heights® PDF Optimizer Service provides the notion of “optimization profiles” to quickly arrive at a configu­ ration suitable for many application areas. Once the application area is defined, the optimization profile that best matches the requirements can be identified. The configuration is done by setting this profile (­pr) followed by adjusting individual settings that differ from the profile.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 15/56 ­pr web ­dbt ­1

The actual profile settings for all profiles are in Profile Settings.

5.2 Optimizing Images

For the 3­Heights® PDF Optimizer Service the target compression type of an image is specified by giving a numerical value between ­1 and 10 to the options ­fb, ­fc, and ­fi. Several values can be combined in a comma­separated list. (No spaces are allowed in the list.) The values 1 to 8 directly correspond to PDF compression types, other values indicate a special behavior.

Value Compression

0 No Compression (Raw)

1 DCT (JPEG)

2 Flate (ZIP)

3 LZW

4 CCITT Fax Group 3 (CCITT Fax Group 3 and 4)

5 CCITT Fax Group 3 2D (CCITT Fax Group 3 and 4)

6 CCITT Fax Group 4 (CCITT Fax Group 3 and 4)

7 JBIG2 (Supported in PDF 1.4 or later)

8 JPEG2000 (Supported in PDF 1.5 or later, not supported in PDF/A­1)

9 In contrast to the values 0­8, this is not a single compression format. Instead, this enables MRC optimization on color and monochrome images. (See Mixed Raster Content (MRC) Optimization for Images) Application area: Scanned documents.

10 In contrast to the values 0­8, this is not a single compression format. Instead, this tells 3­Heights® PDF Optimizer Service to use the same compression as the original input image.

­1 Exclude from processing

5.2.1 Supported Image Compression Types

In PDF, up to 8 different ways of compressing binary data are supported. (See also PDF Reference 1.7, Chapter 3.3 for more information on these types.)

No Compression (Raw)

Raw means no compression is applied.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 16/56 DCT (JPEG)

Developer Joint Photographic Experts Group committee

Version PDF 1.2 and later, PDF/A­1

Color depth 8, 24 bits per pixel

Compression type Lossy

Compression algorithm The image is broken up into blocks that are 8 by 8 samples. On each of these blocks and color channel a discrete cosine transformation (DCT) is applied and its coefficients are quantized. The visual quality of the resulting image depends on the loss of information defined by the step size of the quantization and on the image that is being compressed. The compression can be controlled via an image quality parameter—a value from 1 to 100 (default 75). Typical compression ratios are 15:1 (no perceptible loss of information) to 30:1.

Application area Sampled continuous­tone pictures (photographs)

Flate (ZIP)

Developer Flate compression is based on the public­domain zlib / deflate compression method.

Version PDF 1.2 and later, PDF/A­1

Color depth 1­8, 24 bits per pixel

Compression type Lossless

Compression algorithm A lossless algorithm that uses a combination of the LZ77 algorithm and .

Application area Images

LZW

Developer Abraham Lempel, Jacob Ziv and Terry Welch Copyright based issues, which expired in most countries in 2003/2004, reduced the popularity of this compression. As one of its consequences it is not included in PDF/A standard.

Version PDF 1.2 and later

Color depth 2­8 bits per pixel

Compression type Lossless

Compression algorithm An indexed based compression that is also used in the GIF and TIFF image formats.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 17/56 Application area Gray­scale images, artificial images

CCITT Fax Group 3 and 4

Developer International Telecommunications Union (ITU), formerly known as the Comité Consultatif International Téléphonique et Télégraphique

Version PDF 1.0 and later, PDF/A­1

Color depth 1 bit per pixel

Compression type Lossless

Compression algorithm Group3 1­dimensional version of the CCITT Group 3 Huffman encoding algorithm. Group 3 2D 2­dimensional version of the CCITT Group 3 Huffman encoding algorithm. Group 4 An advanced version of a bi­tonal algorithm based on the CCITT Fax Group 3 2D compression.

Application area Line­art image, bi­tonal,

JBIG2

Developer Joint Bi­Level Image Experts Group

Version PDF 1.4 and later, PDF/A­1

Color depth 1 bit per pixel

Compression type Lossless

Compression algorithm The image is broken down into individual symbols, which are stored in a table. A symbol is added to the table if it does not exist yet. If a matching symbol already exists, it is used as a reference. This algorithm works especially well for images with a lot of similar symbols such as scanned text or images that use patterns. Generally JBIG2 provides a better compression ratio than CCITT Group 3 or Group 4 compression. Typical compression ratios for text pages are 20:1 to 50:1.

Application area Line­art image, bi­tonal

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 18/56 JPEG2000

Developer Joint Photographic Experts Group committee

Version PDF 1.5 and later, PDF/A­2

Color depth 8, 24 bits per pixel

Compression type Lossless if the image quality index is set to 100. Lossy otherwise

Compression algorithm JPEG2000 is a ­based image compression standard. It was developed with the intention of superseding the original discrete cosine transform­based JPEG standard.

Application area Sampled continuous­tone pictures (photographs)

5.2.2 Relevant Factors for the File Size

The size of an image is basically determined by four factors:

The pixel mass The total amount of pixels the image has. An image with a size of 600 by 800 pixels has 480’000 pixels total.

The color depth How many bits are required to describe 1 pixel? The table below gives the answer for different types of images. For example, an RGB image with 600 by 800 pixels requires therefore 600 x 800 x 3 bytes = 1.44 Mbytes in uncompressed format.

Color Space Description Bits/Pixel

Bi­tonal Black and white 1

Indexed Colors are stored in an index table which usually holds 2 to 256 entries, e.g. 2­8 GIF.

Grayscale Monochrome 8

Color RGB Color using Red, Green, Blue 24

Color CMYK Color using Cyan, Magenta, Yellow, Key (=black) 32

The compression type A compression algorithm can compress data (such as an image) to reduce its file size. Such an algorithm belongs to either of the following two classes:

Lossless The original image can be restored exactly.

Lossy The compression modifies the pixels. The original image cannot be restored from the compressed version. This is typically applied to photographic images where the human eye cannot distinguish whether the image was modified. The most common is JPEG. The benefit of lossy compression is the higher compression ratio.

See also Supported Image Compression Types.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 19/56 The content of the image The simpler the image, the better it compresses. For most compression algorithms a simple image (e.g. completely white) compresses much better than a complex image (e.g. a photo).

Examples: CCITT Fax compression was designed to compress black text written on a white background. The algorithm was optimized under the assumption that a page contains more white pixels than black pixels. Therefore a bi­tonal image with a lot of black does generally not compress as well as in image with more white even if they have the same pixel mass. JBIG2 compression searches for patterns, and uses them multiple times. For example in a scanned text document the same few dozen of characters are used over and over again. The algorithm is optimized to save frequent patterns more efficiently than rare ones.

5.2.3 Provided Features for Optimizing Images

The 3­Heights® PDF Optimizer Service offers the following possibilities to optimize images:

The pixel mass can be reduced. (It cannot be increased.) This is done by clipping (cropping) the image size to its visible extent and/or by reducing the image resolution. The resolution defines how many pixels there are in given length of the image. The most common unit for resolution is DPI (dots per inch). If an image has a resolution of 200 DPI, it means when displayed at 100% zoom, there are 200 pixels for 1 inch of image. The higher the resolution, the “sharper” is the image. A monitor has usually a resolution of at least 96 DPI, a laser printer of at least 600 DPI. When the file size matters, a common resolution for color and grayscale images in PDF is 150 DPI (usually higher for bi­tonal). The process of changing the amount of pixels an image has, is called re­sampling, or down­sampling when the result has less pixels than the original image. In the 3­Heights® PDF Optimizer Service down­sampling is applied by setting a target resolution and a threshold resolution. The default values are 150 DPI for the target resolution and 225 DPI for the threshold resolution. This means every image that has a resolution of 225 DPI or higher is potentially down­sampled to 150 DPI. Of course, the threshold resolution can be set equal to the target resolution. However there are many cases where down­ sampling by just a little bit has disadvantages. In particular, lossy images (e.g. JPEG compression) loose visual quality every time they are newly compressed. On top of that the compressed output can be larger than the input because artifacts introduced by the previous compression(s) are now considered as part of the image which needs to be compressed and lead to a worse compression even when the resolution is reduced. Per default, the 3­Heights® PDF Optimizer Service will, however, prevent such unnecessary re­sampling.

The color depth can be modified for color images. The color depth can be left unchanged, set to Grayscale (8 bit), RGB (24 bit) or CMYK (32 bit). It cannot be changed to black and white (1 bit).

Note: In certain circumstances, the color depth of the image is not converted, e.g. if the resulting file size increases or if the image is pre­blended with a matte color.

The color complexity can be reduced. By “color complexity” we mean the following hierarchy of possible image pixel contents: 1. All pixels have the same color. 2. All pixels are either black or white. 3. All pixels are colored gray. 4. Pixels have differing colors.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 20/56 By color complexity reduction we mean that images are converted to their lowest possible color complexity. E.g., a color image with only black and white pixels is converted to a bi­tonal image. Furthermore, an image with color complexity 1 (single color) is down­sampled to one pixel. Color complexity reduction is also applied to masks and soft masks: Soft masks of complexity 2 (bi­tonal) are converted to masks. Masks and soft masks with complexity 1 (single color) whose color is such that the (soft) mask is opaque are removed.

Note: Currently, color complexity reduction is only carried out for images that have a device color space (DeviceRGB, DeviceGray, or DeviceCMYK) or an space whose base color space is a device color space.

The compression can be setup independently for the following three image compression types:

Type Description

Bi­tonal Black and white images.

Indexed Images with an indexed (also known as “paletted”) color space.

Continuous Color (RGB and CMYK) images and grayscale images.

Bi­tonal images usually contain text or black and white graphics, indexed images usually contain color graphics such as logos, while continuous images usually contain photographs. For each of the above image types, several compression algorithms can be set. The 3­Heights® PDF Optimizer Service tries all the given compression algorithms and takes the one that yields the smallest file size. Note that the more compression algorithms are set, the longer the process of optimizing images will take. Furthermore, a more conservative image processing strategy can be enabled. This strategy prevents all the compression trials if the image has neither been clipped nor down­sampled nor undergone a color­conversion. Hence, if the image has not been altered, then the original image from the input document is taken.

The content of the image cannot be changed directly. However changing the resolution or applying a lossy compression algorithm modifies the content of the image.

Note: Unless forcing of re­compression is enabled, the 3­Heights® PDF Op­ timizer Service never increases the file size of an image because it chooses the smallest among all tried compression algorithms and the original image in the input file. This means the 3­Heights® PDF Optimizer Service cannot be used to “un­compress” embedded images.

5.2.4 Mixed Raster Content (MRC) Optimization for Images

Some raster images—typically scanned documents—consist mainly of text, possibly in several colors and interspersed with some pictures. Such Note: There exists an optimiza­ images are difficult to compress with one single compression type be­ tion profile for MRC optimization. cause of the diverse or even conflicting features of different parts of the See Profile Settings. image.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 21/56 MRC optimization is a way of breaking such images down into parts, such that each part is well suited for one type of a compression algorithm. With this approach, the resulting file size often can be reduced without significantly reducing the visual quality of the document.

Note: MRC optimization can only be enabled for continuous images, i.e. not for bi­tonal images and images with an indexed color space. Monochrome (gray­scale) images are treated as entire photographic regions, see also Phase 1: Cutting out Pictures. MRC optimization may yield unexpected results, e.g. because the input image is not suitable for MRC. As another example, images in the original PDF may be stored as small slices, and MRC optimization fails because the 3­Heights® PDF Optimizer Service has no option to concatenate such image slices. A PDF that contains MRC­optimized images is not suited for optical character recognition (OCR) and image extraction.

In the 3­Heights® PDF Optimizer Service, MRC optimization works in three phases as explained below.

Phase 1: Cutting out Pictures

In this phase, the input image is analyzed and rectangular areas containing photographic features are detected. Each detected region is cut out and placed as a separate image in the resulting PDF. Depending on the input image it is possible that this phase decides that the whole input image consists of one photographic region covering the whole image. In this case, the second phase (Phase 2: Separation into Layers) is omitted. On the other hand, it is possible, that actual photographic regions present in the input image are not recognized correctly. This can happen for example if a photographic region contains parts with uniform color. For the cut­out images, a compression type can be set.

Note: The resulting cut pictures are neither down­sampled nor color­converted. Monochrome (gray­scale) images are always treated as entire photographic re­ gions.

Phase 2: Separation into Layers

For this second phase the image is not supposed to contain any photographic features. Instead, the image is as­ sumed to consist of text and graphic, potentially with varying color. Now, the whole image is separated into two layers, a foreground and a background layer. Additionally, a mask is created, which can be thought of as a bi­tonal image that is not displayed directly but tells for each pixel whether to show the foreground layer or the background layer.

Example: Let the image consist of a yellow background with black paragraph text and a title text in red. Then the resulting background layer contains the yellow color only. The foreground layer contains the black text color where the para­ graph text is located and the red text color where the title is located. In the mask, pixels for which the foreground layer should be displayed are set to 1, the others are set to 0. I.e. the mask contains 1’s where the black and the red text is and 0’s everywhere else.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 22/56 In the resulting PDF the foreground layer, the background layer and the mask are stored as three images and thus are allowed to have different resolution and different compression types. Since all the detailed features have been moved to the mask, it makes sense to down­sample the foreground and background layers and use a low image quality. The mask on the other hand is usually stored with a lossless compression type optimized for text.

Phase 3: Reconstruction

In this phase the results of phase 1 (the cut­out images) and phase 2 (the layers and the mask) are used to synthe­ size the desired result. If in phase 1, a single photographic region covering the entire image is detected, then the original image is used and the reconstruction is finished. Otherwise, the reconstruction first places the background layer, followed by the foreground layer with the mask. Finally if any cut­images are found they are placed at their respective locations on top of the foreground layer.

5.3 Optimizing Fonts

Every text in a PDF document is written with a font. This font can either be embedded or not embedded in the resources of the PDF. Embedded means a font program is embedded that describes how glyphs are drawn. If a font is not embedded the application rendering the PDF (e.g. 3­Heights® PDF Viewer or Adobe Acrobat) have to select a replacement font. Therefore the visual appearance of text written with an embedded font is determinable, whereas it is not when the font is not embedded. A font program can be quite large. An embedded font which contains all WinAnsi characters has a size of about 20­100 Kbytes, if it contains a large Unicode range (e.g. Asian Characters) it can be several Mbytes, whereas an non embedded font requires much less. This leads to the following ways to optimize fonts:

Remove the embedded font: Removing embedded fonts can reduce the file size of a document, particularly when the document contains many fonts. Removing fonts is best applied to (PDF­) standard fonts, such as Arial, Courier, Courier New, Helvetica, Times, Times New Roman. Removing fonts should not be applied to barcode fonts or fancy types.

Note: PDF/A requires fonts to be embedded.

Subset fonts: Only keep the information in the font program that is required to render the characters that are actually used in text in this document. All unused characters are removed.

Merge fonts:A document can have the same font, or a subset of it, embedded multiple times. This commonly occurs when multiple input document, are merged into one large output document. The 3­Heights® PDF Optimizer Service Tool can merge these fonts into one font (if they can be merged).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 23/56 6 Interface Reference

6.1 Service Control Commands

These options are used to control the service. The create and delete functions require administrator rights. The start and stop functions require operator rights.

6.1.1 ­a Pause Service

Pause Service ­a

This option pauses the service.

pdfoptimizesvr ­a

6.1.2 ­c Create Service

Create Service ­c

The 3­Heights® PDF Optimizer Service is created using the option ­c.

pdfoptimizesvr ­c

Important: It is essential that pdfoptimizesvr.exe is on a non­mapped drive.

6.1.3 ­d Delete Service

Delete Service ­d

The 3­Heights® PDF Optimizer Service can be deleted with the option ­d. It is best used after the service has already been stopped.

pdfoptimizesvr ­d

6.1.4 ­i List the Usage

List the Usage ­i

The option ­i lists the current version and date of the service along with all available settings.

pdfoptimizesvr ­i

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 24/56 6.1.5 ­o Continue Service

Continue Service ­o

This option resumes the service.

pdfoptimizesvr ­o

6.1.6 ­q Query Current Status of Service

Query Current Status of Service ­q

This option returns the current status of the service.

pdfoptimizesvr ­q The service starts automatically during system startup. The service is stopped. [pdfoptimizesvr] QueryService: The operation completed successfully.

6.1.7 ­s Start Service

Start Service ­s

Once created, the 3­Heights® PDF Optimizer Service can be started with the option ­s.

pdfoptimizesvr ­s

6.1.8 ­t Stop Service

Stop Service ­t

To stop the service, use the option ­t.

pdfoptimizesvr ­t

If “stop” is called while the service is “running”, the current job (all pages) will be finished, after that the service is stopped. If the service was “paused” before calling “stop”, the current page will be finished processing. After that page, the job is aborted.

6.1.9 ­x Run as Executable

Run as Executable ­x

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 25/56 With this option, the PDF Optimizer Service runs as an executable instead of as a Windows Service. It provides the same functionality as long as the executable is “running”.

pdfoptimizesvr ­x

6.2 Configuration options

6.2.1 Configuration File pdfoptimizesvr.ini

The pdfoptimizesvr.ini configuration file defines the setting for the watched folders. It is read upon starting the service.

[PdfOptimizeSvr] required

AutoDelete=... optional true or false

AutoDeleteAll=... optional true or false

LogPath=... optional Either a path like C:\mypath\log or the keyword EventLog

PollingInterval=... optional Value in milliseconds, default 1000

JobPrefix=... optional true or false

LogLevel=... optional 0 or 1

Threads=n required The number of threads

Thread1=­w ... required Options for the first thread

Thread2=­w ... Options for the second thread

Threadn=... There must be exactly as many threads as defined in Threads=n.

Example:

[PdfOptimizeSvr] AutoDelete=true Threads=2 Thread1=­w C:\pdfoptimizesvr\StripOptim ­or ­od ­se ­rs Thread2=­w C:\pdfoptimizesvr\FontOptim ­or ­s ­m

Autodelete of Successfully Processed Files

When a job has successfully been processed, a new PDF document is created in the folder Optimized and the orig­ inal PDF document is by default deleted. In order to retain the original PDF document after successful processing, set the value of Autodelete in the configuration file to false. The original PDF document will then be moved from the folder Jobs to the folder Succeeded. Failed documents are still moved to the folder Failed.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 26/56 [PdfOptimizeSvr] AutoDelete=true

To delete failed documents as well use the following setting:

[PdfOptimizeSvr] AutoDeleteAll=true

Job Number Prefix

Every time a document is copied from the watched folder to the Jobs sub folder, it is renamed by adding a 21 char­ Note: When JobPrefix=false then the in­ acter prefix containing a time­stamp of the form Job­‹8 coming documents must have unique file names. digits›­‹8 digits›_. For example Job­01C61DD4­E72E1BCE_ The job number prefix ensures that several documents with the same name can correctly be processed. Adding the prefix can be prevented with the following line in the configuration file:

[PdfOptimizeSvr] JobPrefix=false

Logpath

Log­messages created by the service are by default written to the sub­directory log. To alter the directory, add a line similar as shown below to the configuration file:

[PdfOptimizeSvr] LogPath=C:\path\log

Messages created by the service can be added to the system’s application event log instead of written to a log file. This is achieved by adding the following line to the configuration file:

[PdfOptimizeSvr] LogPath=EventLog

The system’s application log event will then log messages similar as shown below: CreateService: The operation completed successfully. StartService: The operation completed successfully.

Note: The messages are only fully accessible while the service is created.

Otherwise a message as shown below is displayed: The description for Event ID (1) in Source (pdfoptimizesvr) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: DeleteService: The operation completed successfully.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 27/56 Polling Interval

The polling interval defines the time in milliseconds that the polling­thread pauses between two polls. The time passing until the same watched folder is polled again (maximum pick­up time) is: The value of PollingInterval plus the actual time it takes to poll all watched folders. The higher the polling interval, the lower the network traffic, and the longer it takes until documents are picked up. Suggested values for the polling intervals are 1000 to 10000 milliseconds.

[PdfOptimizeSvr] PollingInterval=5000

6.2.2 ­w Specify the Path to the Root Directory

Specify the Path to the Root Directory ­w ‹dir›

This option sets the path to the root directory.

Note: This parameter must always be the first parameter of a thread.

Parameter:

‹dir› The given path should not contain mapped drives, since other users (such as LocalSystem) do not recognize them.

Example:

­w C:\pdfoptimizesvr\Root

The service supports path lengths including file name of up to 258 characters. This includes the 21 characters of the job ticket. If a file name exceeds this value, its file name is truncated at the end of the file name and before the file extension. It is therefore suggested that watched folder names are kept reasonably short.

6.2.3 ­wd Specify the Drop Path

Specify the Drop Path ­wd ‹dir›

This option sets the path of the drop directory. If this option is not set, then the drop directory equals the root directory ­w. The drop directory is the watched folder, where input files are picked up and processed by the service.

Parameter:

‹dir› The drop directory can be at any existing (network­) location with the following conditions: The directory exists (it is not automatically created unlike the root directory).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 28/56 The user under which the service runs has access permissions to this directory.

Example:

­wd C:\Path\DropFilesInHere

6.2.4 ­wfi Ignore Files with Certain Extensions

Ignore Files with Certain Extensions ­wfi ‹exts›

By default, the service tries to process all files dropped into the drop­in folder, regardless of the extension. With this option, files with certain file extensions can be ignored.

Example: Ignore temporary files.

­wfi .temp.tmp

6.2.5 ­wfs Process only Files with Certain Extensions

Process only Files with Certain Extensions ­wfs ‹exts›

By default, the service tries to process all files dropped into the drop directory, regardless of the extension. With this option, the processing can be restricted to a set of known file extensions.

Example: Restrict the processing to PDF and FDF files.

­wfs .pdf.fdf

6.3 Profile Settings

The following table lists all settings for optimization all profiles. The profile labeled “(default)” contains the settings in effect when no profile is selected.

Note: Values in parentheses, although set, have no effect because images are excluded from processing or image down­sampling is disabled due to a threshold set to ­1.

Note: The license feature Color does support none of the following profiles but the default profile.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 29/56 Profile Settings

web mrc (default) print archive max

Compression Types for Bi­tonal Images (­fb):

Exclude (­1) � �

CCITT Group 4 (6) � � � �

JBIG2 (7) � � �

Source (10) � � � �

Compression Types for Continuous Images (­fc):

Exclude (­1) �

JPEG (1) � � � �

Flate (2) � � � �

JPEG2000 (8) � � �

MRC (9) �

Source (10) � � � �

Compression Types for Indexed Images (­fi):

Exclude (­1) � �

Flate (2) � � � �

LZW (3) �

Source (10) � � � �

Resolution for Bi­Tonal Images (Resolution (200)1 200 (200)1 (200)1 160 (200)1 Values per Image Type)

Threshold for Bi­Tonal Images (Threshold ­1 280 ­1 ­1 220 ­1 Values per Image Type)

Resolution for Monochrome Images (150)1 150 (150)1 (150)1 130 (150)1 (Resolution Values per Image Type)

Threshold for Monochrome Images ­1 210 ­1 ­1 180 ­1 (Threshold Values per Image Type)

Resolution for Color Images (Resolution (150)1 150 (150)1 (150)1 130 (150)1 Values per Image Type)

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 30/56 Profile Settings

web mrc (default) print archive max

Threshold for Color Images (Threshold ­1 210 ­1 ­1 180 ­1 Values per Image Type)

Image Quality (­q) 75 75 80 80 70 75

Color Conversion (­c) 0 1 2 0 1 1

Clip Images (­oc) � � � � �

Reduce Color Complexity (­rc) � � � �

Force Re­Compression (­ff)

Force Compression Types (­ft)

Dithering Mode (­h) 0 (Floyd Steinberg)

MRC Layer Compression (­ml) 8 (JPEG2000)

MRC Layer Resolution (­mlr) 70

MRC Layer Quality (­mm) 6 (CCITT Fax Group 4)

MRC Layer Quality (­mlq) 20

MRC Cut Picture Compression (­mp) 1 (JPEG)

Convert Fonts to CFF (­cff) � � � �

Merge Font Programs (­m) � � � � �

Remove Standard Fonts (­rs) �

Subset Font Programs (­s) � � � � �

Optimize Resources (­od) � � � � �

Linearize (­ow)

Linearize (­owa) �

Remove Redundant Objects (­or) � � � � �

Strip the File:

Article threads (Strip the File) � � � �

Metadata (Strip the File) � �

Piece info (Strip the File) � � � �

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 31/56 Profile Settings

web mrc (default) print archive max

Document structure (Strip the File) � � � �

Thumbnails (Strip the File) � � � � �

Spider (Strip the File) � � � �

Alternates (Strip the File) � � �

Outlines (Bookmarks) (Strip the File) �

Other annotations (Strip the File) �

Form fields (Strip the File) �

Link Annotations (Strip the File)

6.4 Optimization Options

An option is a configuration string of the form

­‹option› ‹parameters›

where ‹option› is a 1 to 3­letter string that names the option and ‹parameters› are further configuration val­ ues given to this options. Many options don’t support any ‹parameters›. Options define how the document should be optimized. Options are parsed from left to right, the last set value is applied. (An exception to this is setting a profile with ­pr: Profiles are always applied first.)

Example: With the following options, the resolution for re­sampling of all raster image types (color, monochrome, bi­tonal) is first set to 100, then the monochrome resolution is set explicitly to 120.

­dr 100 ­dmr 120

If in the above command the setting ­dmr 120 was set before ­dr 100, it would not have any influence, since ­dr 100 applies to all compressions and therefore would overwrite the previous setting. In the following all options are listed in alphabetical order. Options that are marked with a license features are available if the listed feature is included in the license. See also License Features.

1 These values, although set, have no effect because down­sampling of images is disabled.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 32/56 6.4.1 ­c Set the Color Conversion

Set the Color Conversion ­c ‹n› License feature: Color

This option activates conversion of raster images from one color space into another, e.g. convert all RGB images to CMYK images. This option is affected when This option does not have any impact on objects other than raster images setting a profile (­pr). that use color spaces, such as vector graphics or text. Color key masked im­ ages are not color converted. Pre­blended images can be converted from RGB to Grayscale. The parameter ‹n› has the following meaning:

Color Conversions

‹n› Conversion Color Values

0 (default) Don’t convert colors

1 Convert to ICE sRGB colors red, green, blue

2 Convert to CYMK color (using profiles) cyan, yellow, magenta, key

3 Convert color images to grey scale grey

Example: To convert all embedded color images that use the RGB color space to images of the CMYK color space, use the following command

­c 2

6.4.2 ­cff Compress Type1 fonts (convert to CFF)

Compress Type1 fonts (convert to CFF) ­cff License feature: Optimize

Convert embedded Type1 (PostScript) fonts to Type1C (Compact Font For­ mat). This reduces the file size. This option is affected when setting a profile (­pr).

6.4.3 ­cms Set the Color Management Engine

Set the Color Management Engine ­cms ‹engine› License feature: Color

The transformation of colors from one color space to another is performed using a color management engine. Supported engines are:

none The algorithms specified in the PDF reference are used. This results in the maximum possible contrast.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 33/56 neugebauer The Neugebauer algorithm efficiently converts CMYK to RGB. It does not need any color profiles. The results, however, look similar to conversion using color profiles.

lcms (default): Use ICC color profiles. Default profiles are used for all unmanaged device color spaces as described in section Color Profiles.

‹FileName› When providing a file name, a configurable version of the Neugebauer algorithm is applied. The coefficients can be defined in the text file. The default Neugebauer coefficients are listed below (Red, Green, Blue; Color): 1.000000, 1.000000, 1.000000; White 0.000000, 0.682353, 0.937255; C 0.925490, 0.000000, 0.549020; M 1.000000, 0.949020, 0.000000; Y 0.137255, 0.121569, 0.125490; K 0.180392, 0.188235, 0.572549; CM 0.000000, 0.650980, 0.313725; CY 0.000000, 0.054902, 0.137255; CK 0.929412, 0.109804, 0.141176; MY 0.137255, 0.000000, 0.000000; MK 0.105882, 0.098039, 0.000000; YK 0.211765, 0.211765, 0.223529; CMY 0.000000, 0.000000, 0.003922; CMK 0.000000, 0.070588, 0.000000; CYK 0.133333, 0.000000, 0.000000; MYK 0.000000, 0.000000, 0.000000; CMYK

The Neugebauer algorithm mixes the colors based on the amount of color and the corresponding weighted coeffi­ cient. Altering the values for a pure color specifically changes the result for this pure color. The color transition remains smooth.

Example: The following command selects the neugebauer color management engine.

­cms neugebauer

6.4.4 Resolution Values per Image Type

DPI for Bi­Tonal Images ­dbr ‹dpi› License feature: Optimize DPI for Color Images ­dcr ‹dpi› License feature: Optimize DPI for Monochrome Images ­dmr ‹dpi› License feature: Optimize

The target resolution values for down­sampling images can be set individu­ ally for different types of images. This option is affected when setting a profile (­pr).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 34/56 Parameter:

‹dpi› The target resolution in DPI. The default values for ‹dpi› are as follows:

Bi­Tonal Images 200

Color Images 150

Monochrome Images 150

6.4.5 Threshold Values per Image Type

DPI for bi­tonal images ­dbt ‹dpi› License feature: Optimize DPI for color images ­dct ‹dpi› License feature: Optimize DPI for monochrome images ­dmt ‹dpi› License feature: Optimize

The threshold values above which down­sampling an image is activated can be set with these options. This option is affected when setting a profile (­pr).

Parameter:

‹dpi› The threshold in DPI. A value of ­1 indicates that all images of this type are excluded from down­sampling. Default: ­1.

6.4.6 ­dr Resolution in DPI

Resolution in DPI ­dr ‹dpi› License feature: Optimize

Set the target resolution after re­sampling images, image masks and im­ age’s soft masks in dots per inch (DPI). Only those images with a resolution This option is affected when value higher than the threshold value, which is set with option ­dt, will be setting a profile (­pr). processed. The default target resolution is 150 DPI. Pre­blended images, images with a color key mask, masks, and soft mask images are not re­sampled.

Example: In order to down­sample all raster images with a resolution greater than 150 DPI to 75 DPI, apply the following

­dt 150 ­dr 75

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 35/56 6.4.7 ­dt Threshold in DPI

Threshold in DPI ­dt ‹dpi› License feature: Optimize

This option defines the minimum resolution an image must have to be op­ timized. The threshold value for down­sampling raster images is used in This option is affected when conjunction with the option ­dr, which sets the actual target resolution for setting a profile (­pr). those down­sampled images. The threshold resolution must be equal or higher than the target resolution. If the value is set to ­1, down­sampling is turned off. This is the default.

Example: Select the “web” profile and down­sample all raster images with an original resolution higher or equal to 150 DPI to a new resolution of 75 DPI.

­pr web ­dt 150 ­dr 75

Example: Select the “web” profile but disable down­sampling of images.

­pr web ­dt ­1

If the size (in terms of bytes) of the re­sampled image is larger than its original size, the original image is kept instead.

6.4.8 ­fb Compression Types for Bi­tonal Images

Compression Types for Bi­tonal Images ­fb ‹compr›

This option affects only bi­tonal (black and white) images. The option ­fb is followed by a comma­separated list of numerical values (no spaces allowed This option is affected when in the list). The following values are possible: setting a profile (­pr).

Bi­Tonal Compression

Value Compression Filter

0 RAW data

2 Flate (ZIP) compression

3 Lempel­Ziv­Welch (LZW) compression

4 CCITT Fax Group 3 compression

5 CCITT Fax Group 3 2D compression

6 (default) CCITT Fax Group 4 compression

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 36/56 Bi­Tonal Compression

7 JBIG2 compression

10 Take the compression type from the original image in the input PDF

­1 Exclude bi­tonal images from processing

Example: To let the 3­Heights® PDF Optimizer Service try CCITT Group 3 compression, JBIG2 compression and the compression that is used in the source image of the original file use the following command

­fb 3,7,10

The above command makes the 3­Heights® PDF Optimizer Service go through all bi­tonal images and processes each image individually as follows. All the given compression algorithms are executed. If the input image has a compression different from CCITT Fax Group 3 and JBIG2, then the compression of the input image is also executed. As a result, several candidate versions are obtained. Now a choice is made among all these versions (including the original image) based on the size in bytes. The smallest candidate is chosen and used in the output document.

6.4.9 ­fc Compression Types for Color and Grayscale Images

Compression Types for Color and Grayscale Images ­fc ‹compr›

This option affects normal color images (RGB and CMYK) as well as grayscale (monochrome) images. The option ­fc is followed by a comma­separated This option is affected when list of numerical values (no spaces allowed in the list). The following values setting a profile (­pr). are possible:

Color/Monochrome Compression

Value Compression Filter License Feature

0 RAW data Optimize, Color

1 (default) DCT(JPEG) compression Optimize, Color

2 Flate (ZIP) compression Optimize, Color

8 JPEG2000 compression Optimize, Color

9 Perform MRC optimization (See Mixed Raster Content (MRC) Optimization for Optimize Images)

10 Take the compression type from the original image in the input PDF Optimize, Color

­1 Exclude continuous images from processing Optimize, Color

Example: To let the 3­Heights® PDF Optimizer Service try JPEG compression, JPEG2000 compression and the compression that is used in the source image of the original file use the following command.

­fc 1,8,10

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 37/56 The above command makes the 3­Heights® PDF Optimizer Service go through all color and grayscale images and processes each image individually as follows. All the given compression algorithms are executed. If the input image has a compression different from JPEG and JPEG2000, then the compression of the input image is also executed. As a result, several candidate versions are obtained. Now a choice is made among all these versions and the original image based on the size in bytes. The smallest candidate is chosen and used in the output document.

6.4.10 ­ff Force Re­Compression

Force Re­Compression ­ff License feature: Optimize

If this option is set, then images are always re­compressed, i.e., the original image is never used as a candidate for inclusion in the output document. If This option is affected when not set (default), then images are only re­compressed if the resulting image setting a profile (­pr). is smaller than the original, i.e. occupies less bytes to store in the file.

6.4.11 ­fi Compression Types for Indexed (Paletted) Images

Compression Types for Indexed (Paletted) Images ­fi ‹compr›

This affects only images with an indexed color space. This type of color space is sometimes used for color graphics and logos. The option ­fc is followed This option is affected when by a comma­separated list of numerical values (no spaces allowed in the list). setting a profile (­pr). The following values are possible:

Indexed Compression Types

Value Compression Filter

0 RAW data

2 Flate (ZIP) compression

3 Lempel­Ziv­Welch (LZW) compression

10 Take the compression type from the original image in the input PDF

Example: To let the 3­Heights® PDF Optimizer Service try Flate compression and LZW compression use the following command:

­fi 2,3

The above command makes the 3­Heights® PDF Optimizer Service go through all images with indexed color space and processes each image individually as follows. All the given compression algorithms are executed. As a result, two candidate versions are obtained. Now a choice is made among these two versions and the original image based on the size in bytes. The smallest candidate is chosen and used in the output document.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 38/56 6.4.12 ­ft Force Compression Types

Force Compression Types ­ft License feature: Optimize

If this option is set, then re­compression of images is forced if an image in the input PDF has a compression type that differs from the compression types This option is affected when given in ­fb, ­fc, or ­fi. Use this option if you want to allow only the given setting a profile (­pr). compression types for images in the output PDF.

6.4.13 ­fv Minimum PDF Version

Minimum PDF Version ­fv ‹1.x›

This option allows to set the minimum PDF version of the created PDF output file. Supported values are 1.1 to 1.7 and 2.0. (PDF 1.4 corresponds to Acrobat 5, PDF 1.5 to Acrobat 6, etc.) There are three parameters that influence the version of the PDF output file: The value set using the option ­fv. The PDF version of the input file. Other settings in the optimization (JBIG2 requires PDF 1.4, JPEG2000 requires PDF 1.5) The maximum of the three values above sets the PDF version in the output file.

Example: 1. Input PDF is version 1.5 and the following setting is used

­fv 1.4

The output file is PDF version 1.5.

Example: 2. Input PDF is version 1.4 or lower and the following setting is used

­fv 1.4

The output file is PDF version 1.4.

Example: Input PDF is version 1.3 and the following setting is used

­fv 1.4 ­fc 8

If input.pdf contains color images to which JPEG2000 compression is applied, the output file will be version 1.5. Otherwise it will be version 1.4.

6.4.14 ­h Dithering Mode for Bi­Tonal Images

Dithering Mode for Bi­Tonal Images ­h ‹mode›

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 39/56 This option enables or disables dithering when down­sampling bi­tonal im­ ages. This option is affected when setting a profile (­pr).

‹mode› Description

0 No dithering

1 Floyd­Steinberg dithering algorithm

Some bi­tonal images try to evoke the impression of different levels of gray by randomly setting pixels to black. If dithering is applied during down­sampling then the gray levels of such images are preserved better. If dithering is switched off then lines (e.g. text glyphs) are preserved better.

6.4.15 ­id Set Value in the Document Information Dictionary

Set Value in the Document Information Dictionary ­id ‹key› ‹value›

Set the value of an document information dictionary entry ‹key›. Popular entries specified in the PDF Refer­ ence 1.7 are "Title", "Author", "Subject", "Creator" (sometimes referred to as Application), and "Pro­ ducer" (sometimes referred to as PDF Creator). If the entry already exists then the previous entry is overwritten. If the key corresponds to a standard metadata key then the XMP metadata is updated accordingly.

Example: Overwrite the default producer:

­id Producer "MyProgram 1.2"

6.4.16 ­m Merge Embedded Font Programs

Merge Embedded Font Programs ­m License feature: Optimize

Font programs can be merged, if they originate from the same font, e.g. they are of the same type, have the same name and encoding. Merging of Type1 This option is affected when (PostScript) and TrueType fonts is supported. setting a profile (­pr).

6.4.17 ­ml Compression Type for MRC Layers

Compression Type for MRC Layers ­ml ‹compr› License feature: Optimize

This option affects only MRC foreground and background layers. The op­ tion is followed by a single numerical value indicating the compression type This option is affected when to use for MRC foreground and background layers. For possible values see setting a profile (­pr). Color/Monochrome Compression. The default is 8 (JPEG2000 compression).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 40/56 See also Mixed Raster Content (MRC) Optimization for Images.

6.4.18 ­mlq Image Quality for MRC Layers

Image Quality for MRC Layers ­mlq ‹q› License feature: Optimize

This option affects only MRC foreground and background layers. The option is followed by a numerical value between 0 and 100 to be used as the image This option is affected when quality for MRC foreground and background layers when using a lossy com­ setting a profile (­pr). pression for these layers. The default is 10. See also Mixed Raster Content (MRC) Optimization for Images.

6.4.19 ­mlr Resolution in DPI for MRC Layers

Resolution in DPI for MRC Layers ­mlr ‹dpi› License feature: Optimize

This option affects only MRC foreground and background layers. The option is followed by a numerical value that indicates the target resolution in DPI of This option is affected when MRC layers after down­sampling. The default is 70. setting a profile (­pr). See also Mixed Raster Content (MRC) Optimization for Images.

6.4.20 ­mm Compression Type for the MRC Mask

Compression Type for the MRC Mask ­mm ‹compr› License feature: Optimize

This option affects only MRC masks. The option is followed by a single numeri­ cal value indicating the compression type to use for MRC masks. For possible This option is affected when values see Bi­Tonal Compression. The default is 6 (CCITT Fax Group 4 com­ setting a profile (­pr). pression). See also Mixed Raster Content (MRC) Optimization for Images.

6.4.21 ­mp Compression Type for MRC Cut­Out Pictures

Compression Type for MRC Cut­Out Pictures ­mp ‹compr› License feature: Optimize

This option affects only cut­out images and entire monochrome (gray­scale) images when doing MRC optimization. The option is followed by a single This option is affected when numerical value indicating the compression type to use for MRC cut­out pic­ setting a profile (­pr). tures. For possible values see Color/Monochrome Compression. The default is 1 (JPEG compression). See also Mixed Raster Content (MRC) Optimization for Images.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 41/56 6.4.22 ­o Owner Password

Owner Password ­o ‹owner›

The owner password is required to change the security settings of the document. In order to apply permission flags, an owner password must be set. Permission flags are set with the switch ­p.

Example: Encrypt a document and set the owner password to ‹owner›.

­o owner

6.4.23 ­oc Clip Images

Clip Images ­oc License feature: Optimize

Images in PDF documents can be clipped. This means that only part of the image is visible, whilst the rest is hidden. The option ­oc detects these im­ This option is affected when ages, reduces their size the area that is actually displayed and replaces the setting a profile (­pr). original image by the reduced image. Pre­blended images are not clipped. Setting ­oc activates the ­od option.

6.4.24 ­od Optimize Resources

Optimize Resources ­od License feature: Optimize

Optimize the resources of the PDF, such as images, color spaces, or fonts. If set, unused resources are removed. Also content streams are re­built. This option is affected when setting a profile (­pr).

6.4.25 ­ol Linearize Only

Linearize Only ­ol License feature: Optimize

Note: With this option enabled, non­Latin characters in the input and output file name are not supported.

Do not apply any optimizations, but linearize the file. This can be significantly faster than the option ­ow. See ­ow for more information. When this option is set then all other options are disabled except ­o, ­u, ­pw, and ­p.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 42/56 6.4.26 ­or Remove Redundant Objects

Remove Redundant Objects ­or License feature: Optimize

This option removes redundant PDF objects. I.e. it identifies duplicates ob­ jects in the input document and collapses them into single objects in the This option is affected when output document. setting a profile (­pr).

6.4.27 ­ow Optimize for the Web

Optimize for the Web ­ow License feature: Optimize

Note: With this option en­ Note: This option has no abled, non­Latin characters in effect when combined with the output file name are not ­owa. supported.

Linearize the PDF output file, i.e. optimize file for fast web access. The 3­Heights® PDF Optimizer Service does not support linearization of PDF 2.0 documents. For such documents, processing fails. In order to automatically disable linearization for PDF 2.0 use ­owa. A linearized document has a slightly larger file size than a non­linearized file and provides the following main fea­ tures: When a document is opened in a PDF viewer of a web browser, the first page can be viewed without download­ ing the entire PDF file. In contrast, a non­linearized PDF file must be downloaded completely before the first page can be displayed. When another page is requested by the user, that page is displayed as quickly as possible and incrementally as data arrives, without downloading the entire PDF file. The above applies only if the PDF viewer supports fast viewing of linearized .

Note: In order to make use of a linearized PDF file, the PDF must reside as a “file” on the web­server. It must not be streamed.

When enabling this option, then no PDF objects will be stored in object streams in the output PDF. For certain input documents this can lead to a significant increase of file size.

6.4.28 ­owa Automaticall Optimize for the Web

Automaticall Optimize for the Web ­owa License feature: Optimize

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 43/56 Note: With this option enabled, non­Latin characters in the output file name are not supported.

Automatically decide whether to linearize the PDF output file for fast web access. Applying linearization can lead to a large increase in file size for certain documents. Enabling this option lets the 3­Heights® PDF Optimizer Service automatically apply linearization or refrain from doing so based on the estimated file size increase. Also, with this option enabled, PDF 2.0 documents are automatically excluded from linearization. See also ­ow for more information for linearized PDFs.

Note: When ­owa is given, then the option ­ow has no effect.

6.4.29 ­p Permission Flags

Permission Flags ­p ‹flags›

This option sets the permission flags. It is only usable when producing encrypted documents. I.e. at least an owner password must be set with ­o, and additionally a user password can be set with ­u. When omitting the option ­p then all permissions are granted. The permissions that can be granted are listed below.

Permission Flags

Flag Description

p allow printing (low resolution)

m allow changing the document

c allow content copying or extraction

o allow commenting

f allow filling of form fields

s allow content extraction for accessibility

a allow document assembly

d allow high quality printing

i set the same permissions as in the input file

0 allow nothing (no permissions are granted)

The actual ‹flags› given to this option is a string that contains one or several of the permission flags above.

Note: The values i and 0 cannot be combined with any other permission flags.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 44/56 Example: The following command sets the owner password to “owner” and the permission flags to “allow printing in low resolution” and “allow form filling”.

­o owner ­p pf

Example: “High quality printing” requires the standard printing flag to be set too.

­o owner ­p pd

Example: Create a document with the same permission settings as present in the input document.

­o owner ­p i

For further information about the permission flags, see PDF Reference 1.7 Section 3.5.2.

6.4.30 ­pr Set an Optimization Profile

Set an Optimization Profile ­pr ‹profile› License feature: Optimize

With this option one of the predefined optimization profiles can be set. Section Profile Settings tabulates the con­ figuration values for all profiles. If a profile is set then all the tabulated configuration parameters are set to their respective values. Configuration parameters not listed in this table are left unchanged.

Parameter:

‹profile› The profile. Currently, the following profiles can be selected:

web Optimization for the Internet.

print Optimization for print.

archive Optimization for archiving purposes.

max Optimization for maximal memory size reduction.

mrc MRC (Mixed Raster Content) optimization of images. See Mixed Raster Content (MRC) Optimization for Images.

One way of quickly arriving at a specific setting is to set a profile and adapt individual configuration parameters.

Example: Use the “web” profile, but inhibit the down­sampling of bi­tonal images.

­pr web ­dbt ­1

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 45/56 6.4.31 ­pw Read an Encrypted PDF File

Read an Encrypted PDF File ­pw ‹password›

A PDF document that has a user password (the password to open the document) can only be processed when either the user or the owner password is provided. The password can be provided using the option ­pw followed by the password.

Example: The input PDF document is encrypted with a user password. Either the user or the owner password of the input PDF is “mypassword”. The command to process such an encrypted file is:

­pw mypassword

When a PDF is encrypted with a user password and the password is not provided or is incorrect, the 3­Heights® PDF Optimizer Service cannot read and process the file. Instead it will generate the following error message:

Password wasn't correct.

6.4.32 ­q Compression Quality

Compression Quality ­q ‹quality› License feature: Optimize

Set the compression quality index for lossy compression methods. This op­ tion only applies to JPEG, JPEG2000 and JBIG2 images. A lower value results This option is affected when in a smaller file size but the images are of poorer visual quality. A higher value setting a profile (­pr). results in better visual quality, but also a larger file size. The supported values range from 1 (lowest) to 100 (highest). The default is 75. For image compressions that support lossless compression (JPEG2000), a value of 100 corresponds to lossless compression, any other value represents lossy compression. For JBIG2, compression is always lossless irrespective of the quality index set. JPEG compression is always lossy.

Example: The following selects the “web” optimization profile and sets the quality index to 50. All images types which support the quality parameter are recompressed with this quality index.

­pr web ­q 50

6.4.33 ­rc Reduce Color Complexity of Images

Reduce Color Complexity of Images ­rc License feature: Color

This option is used to enable color complexity reduction of images. (See also Provided Features for Optimizing Images.) This option is affected when setting a profile (­pr).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 46/56 If enabled then images with device color spaces (DeviceRGB, DeviceCMYK, or DeviceGray) and indexed images with a device color space as base color space are analyzed and if possible converted as follows: An image with DeviceRGB or DeviceCMYK color space in which all pixels are gray is converted to a grayscale image with DeviceGray color space. An image that contains only black and white pixels is converted into a bitonal image. An image in which all the pixels have the same color is down­sampled to one pixel. Furthermore, images’ masks and soft masks are optimized as follows: A soft mask that contains only black and white pixels is converted to a mask. A (soft) mask that is opaque is removed. Note that color complexity reduction is disabled for those images whose com­ pression type is set to ­1. See ­fc and ­fi.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 47/56 6.4.34 ­ri Remove Images

Remove Images ­ri License feature: Optimize

When enabling this option, then images and stencil masks are substituted by empty form XObjects. Inline images are left untouched. All other image processing options are thus irrelevant.

Warning: Enabling this option usually alters the visual appearance of the doc­ ument significantly.

6.4.35 ­rf Remove Embedded Font Program

Remove Embedded Font Program ­rf ‹font› License feature: Optimize

This option makes the 3­Heights® PDF Optimizer Service remove the embedded font program for the given ‹font›. This option can be given several times to remove several font programs.

Warning: The output document may not display correctly on certain systems.

6.4.36 ­rs Remove Embedded Standard Fonts

Remove Embedded Standard Fonts ­rs License feature: Optimize

This option enables the removal of the font programs of all embedded stan­ dard fonts, such as Arial, Courier, CourierNew, Helvetica, Symbol, Times, This option is affected when TimesNewRoman and ZapfDingbats. (A complete list is given below.) The setting a profile (­pr). fonts are replaced with one of the 14 PDF Standard Fonts, all of which have no associated font program. Un­embedding a font decreases the file size. A PDF Viewer must be able to display these 14 PDF Standard Fonts correctly. Therefore using this option usually should not visually alter the PDF when it is displayed. Un­embedding the font works based on the font’s Unicode information. I.e. the un­embedded font’s characters are mapped to those of the original font with the same Unicode. Therefore, only fonts with Unicode information will be un­embedded by the 3­Heights® PDF Optimizer Service. However, if a font’s Unicode information is not correct, un­embedding may lead to visual differences. Whether or not a font’s Unicode information is correct can be verified by extracting text that uses the font. Suitable tools for this purpose are for instance the 3­Heights® PDF Extract Tool or an interactive PDF viewer. If the extracted text is meaningful, the font’s Unicode information is correct and unembedding of the font will not lead to visual differences.

List of Candidate Font Base Names for Removing Arial Arial,Bold Arial,BoldItalic

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 48/56 Arial,Italic CourierNew­BoldItalic Times­Bold Arial­Bold CourierNew­Italic Times­BoldItalic Arial­BoldItalic CourierNewPS­BoldItalicNT Times­Italic Arial­BoldItalicMT CourierNewPS­BoldMT Times­Roman Arial­BoldMT CourierNewPS­ItalicMT TimesNewRoman Arial­Italic CourierNewPSMT TimesNewRoman,Bold Arial­ItalicMT Helvetica TimesNewRoman,BoldItalic ArialMT Helvetica,Bold TimesNewRoman,Italic Courier Helvetica,BoldItalic TimesNewRoman­Bold Courier,Bold Helvetica,BoldOblique TimesNewRoman­BoldItalic Courier,BoldItalic Helvetica,Italic TimesNewRoman­Italic Courier,BoldOblique Helvetica,Oblique TimesNewRomanPS Courier,Italic Helvetica­Bold TimesNewRomanPS­Bold Courier,Oblique Helvetica­BoldItalic TimesNewRomanPS­BoldItalic Courier­Bold Helvetica­BoldOblique TimesNewRomanPS­BoldItal­ Courier­BoldOblique Helvetica­Italic icMT Courier­Oblique Helvetica­Oblique TimesNewRomanPS­BoldMT CourierNew Symbol TimesNewRomanPS­Italic CourierNew,Bold SymbolMT TimesNewRomanPS­ItalicMT CourierNew,BoldItalic Times,Bold TimesNewRomanPSMT CourierNew,Italic Times,BoldItalic ZapfDingbats CourierNew­Bold Times,Italic

6.4.37 ­s Subset Fonts

Subset Fonts ­s License feature: Optimize

Embedded fonts can be subsetted. Subsetting refers to only storing those character glyphs of the font that are actually used. Unused character glyphs This option is affected when are removed. The advantage is that the file size can be reduced this way (in setting a profile (­pr). particular for Asian fonts). The downside is that if text is to be edited, only the characters of the subsetted font can be used.

6.4.38 Strip the File

Remove certain elements of the PDF file. Please refer to thePDF Reference 1.7 for more details on these elements. This option is affected when The following parts of a PDF can be stripped: setting a profile (­pr).

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 49/56 Strip article threads ­sa Flatten and strip form fields and annotations ­sf Flatten and strip form fields ­sff Flatten and strip link annotations ­sfl Flatten and strip other annotations ­sfa Strip invisible annotations ­sia Strip alternate images (variant representations of the base image) ­si Strip the document’s output intents ­so Strip meta data ­sm Strip page piece info (private application data) ­sp Strip document structure tree (incl. markup) ­ss Strip embedded thumbnails ­st Strip spider (web capture) info ­sw Strip everything (all of the above) ­se

Note that ­sf implies ­sfa, ­sff, and ­sfl. Likewise, ­se implies all other strip options listed.

6.4.39 ­sfs Flatten Appearances of Signature Fields

Flatten Appearances of Signature Fields ­sfs License feature: Optimize

A signature in a PDF consist of two parts: a. The invisible digital signature in the PDF. b. The visual appearance that was attributed to the signature. Part (a) can be used by a viewing application, to verify that a document has not changed since it has been signed and report this to the user. Part (b) is merely a “decorative” element on the page without further significance. When optimizing a PDF, the PDF is altered and hence the digital signature is broken. Therefore, the 3­Heights® PDF Optimizer Service removes all signatures, including parts (a) and (b). If the option sfs is set, then digital signatures (parts (a)) are still removed, but their visual appearances (parts (b)) are flattened. I.e. the latter are retained and drawn as non­editable graphic onto the page.

Note: The resulting PDF can be misleading as it visually appears to be signed, but it has no digital signature and hence, a viewer application does not report any broken signature. In most cases, such a behavior is undesirable.

6.4.40 ­u User Password

User Password ­u ‹user›

Set the user password of the document. If a document which has a user password is opened for any purpose (such as viewing, printing, editing), either the user or the owner password must be provided.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 50/56 Someone who knows the user password is able to open and read the document. Someone who knows the owner password is able to open, read and modify (e.g. change passwords) the document. A PDF document can have none, either, or both passwords.

Example: Encrypt a document with a user and an owner password.

­u userpassword ­o ownerpassword

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 51/56 7 Tips, Tricks and Troubleshooting

It is recommended to use an optimization profile ­pr and adapt it to your needs.

7.1 The Output File is Still Too large

First and foremost it is important to understand what kind of content there is in the document. There is no point in trying to optimizing fonts when the document contains scanned images only. Second, it is not possible to compress a document arbitrarily without loss of information.

7.1.1 Images

Try setting a lower threshold and a lower DPI for the images.

Example: Use the “web” profile and rescale all images with a DPI greater than 72 DPI to 50 DPI

­pr web ­dt 72 ­dr 50

Try reducing the quality of the JPEG and JPEG2000 images by setting ­q.

Example: Use the “web” profile and set the quality index to 60

­pr web ­q 60

7.1.2 Fonts

Apply sub­setting to fonts using ­s. This means all glyphs of characters that are unused are removed from the font. Merge font programs using ­m. Multiply occurring glyphs in compatible font programs are then merged into one glyph. Remove non­symbolic embedded fonts using ­rs. Keep in mind that the appearance when rendering a PDF document with non­embedded non­PDF Standard Fonts is unpredictable: Note: While sub­setting and merging font programs is enabled in most optimization profiles, removing standard fonts is not. (See Profile Settings.)

7.2 The Output File Is Larger Than the Input File

The 3­Heights® PDF Optimizer Service also repairs corrupt documents to a certain extent. This means if relevant data is missing it is recovered. This could possibly lead to a larger file size. If linearization is applied, there is information added to the document. This information contains hints for the browser plug­in, and allows it to specifically download only those objects relevant for displaying a certain page. The linearization information can increase the file size by about 1 to 10%. The input file may contain compressed object streams. These are currently not re­constructed in the output document.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 52/56 7.3 The Selected Compression Type is not Applied

Not all compression types can be applied to all types of images. Check the tables Bi­Tonal Compression, Color/ Monochrome Compression, and Indexed Compression Types. The optimization is only applied if it reduces the file size, therefore an image usually is not re­compressed with a new compression that uses more disc space than the original compression. This behavior can, however, be switched off with ­ff.

7.4 The Output Document Is not Encrypted

In order to encrypt the output document, set an owner password using the switch ­o and permission flags using the switch ­p.

Example: Set the owner password to “mypassword” and do not grant any permissions:

­o mypassword ­p 0

It is not possible to inherit the owner or user password or the permission flags from the input document.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 53/56 8 Version History

8.1 Changes in Version 6

Improved processing of images with indexed color space. Down­sampling is now supported if color conversion is activated. Changed behavior for compressing images: Compression types are selected based on the output image’s type, not on the input image’s type. (The image type can change, e.g., if color conversion is activated.) Changed optimization profiles: In profiles “Web”, “Print”, “Archive”, and “Max”, the “Flate” compression is added to images of type “continuous”.

8.2 Changes in Version 5

MRC improvements Improved MRC background and foreground layer coloring. Changed default value for MRC layer compression quality to 20 [previously 10]. Changed MRC behavior: monochrome (gray­scale) images are treated as entire photographic regions (cut­ out pictures). Improved MRC pre­processing: conversion to RGB is now possible. Changed optimization profile mrc: Now includes color conversion to RGB. Changed behavior: Invisible annotations are not removed anymore by default. New option ­sia to remove invisible annotations. New additional supported operating system: Windows Server 2019.

8.3 Changes in Version 4.12

Introduced license features Optimize and Color. Improved MRC functionality supports images with differing resolution in horizontal and vertical direction. Improved file size reduction by using object streams for annotations and form fields by default. Improved runtime for certain document types. New support for encryption according to PDF 2.0 (revision 6, replaces deprecated revision 5). New HTTP proxy setting in the GUI license manager. New option ­owa to automatically choose whether to linearize the output document or not. Changed option ­pr: In the web optimization profile, linearization (­ow) is substituted by auto linearization (­owa).

8.4 Changes in Version 4.11

New support for the creation of appearance streams for free text annotations that contain rich text content. New support for reading and writing PDF 2.0 documents. New support for the creation of output files larger than 10GB (not PDF/A­1). Improved font subsetting of CFF and OpenType fonts. Improved repair of corrupt image streams. New treatment of the DocumentID. In contrast to the InstanceID the DocumentID of the output document is inherited from the input document. Changed option ­p: Added a new value i to adopt the encryption parameters from the input document.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 54/56 New directory Logs in which an error log file is generated for each failed operation. Improved robustness of the watched folder service.

8.5 Changes in Version 4.10

New support for down­sampling of non­shared Masks and SMasks. Improved removal of redundant objects: More types of dictionaries are included. New support for writing PDF objects into object streams. Most objects that are contained in object streams in the input document are now also stored in object streams in the output document. When enabling linearization, however, no objects are stored in object streams. New feature: If linearization and the removal of document structure information are both disabled, then any document structure elements, if present in the input document, are stored in objects streams in the output document. Improved robustness against corrupt input PDF documents. Improved annotation appearance generation for polyline, squiggly, and stamp annotations. Changed option ­pr: Added a new profile archive to optimize for archiving purposes.

8.6 Changes in Version 4.9

Improved support for and robustness against corrupt input PDF documents. Improved repair of embedded font programs that are corrupt. New support for OpenType font collections in installed font collection. Improved metadata generation for standard PDF properties.

8.7 Changes in Version 4.8

Improved content stream optimization. Improved creation of annotation appearances to use less memory and processing time. Added repair functionality for TrueType font programs whose glyphs are not ordered correctly. New option ­rc: Reduce color complexity for images. Changed option ­pr: The profiles web, print, and max now include the option ­rc.

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 55/56 9 Licensing, Copyright, and Contact

PDF Tools AG is a world leader in PDF (Portable Document Format) software, delivering reliable PDF products to international customers in all market segments. PDF Tools AG provides server­based software products designed specifically for developers, integrators, consultants, customizing specialists and IT­departments. Thousands of companies worldwide use our products directly and hun­ dreds of thousands of users benefit from the technology indirectly via a global network of OEM partners. The tools can be easily embedded into application programs and are available for a multitude of operating system platforms.

Licensing and Copyright The 3­Heights® PDF Optimizer Service is copyrighted. This user’s manual is also copy­ right protected; It may be copied and given away provided that it remains unchanged including the copyright notice.

Contact PDF Tools AG Brown­Boveri­Strasse 5 8050 Zürich Switzerland http://www.pdf­tools.com pdfsales@pdf­tools.com

© PDF Tools AG – Premium PDF Technology 3­Heights® PDF Optimizer Service, September 16, 2021 | 56/56