Compressing PDF Files


downsample Ability to specify a target resolution and a trigger resolution at which grayscale images will be recompressed.
trigger-dpi Number representing the Dots per Inch. All grayscale images above this resolution will be downsampled.
target-dpi Number representing the Dots per Inch. The new resolution of downsampled grayscale images.
recompress Sets the type and quality of compression used to downsample grayscale images.  JPEG compression is a compression format commonly used for photographs.  It uses a technique known as DCT, Discrete Cosine Transform.
type same Keep original default compression algorithm provided in the images themselves
zip Use ZIP compression
jpeg Use JPEG compression
jpeg2000 Use JPEG2000 compression
zip-jpeg Use both ZIP and JPEG compression for the images
quality These values are valid for JPEG and JPEG2000 compression only:
lossless Original quality of the graphic is preserved (see Monochrome). Only available for JPEG2000.

Optional. Enable any of these values by adding it to the profile and setting it equal to "on."

optimize-images-only-if-reduction-in-size Set this value to "on" if you want the Datalogics PDF REST APIs to only downsample an image found in a PDF document if the newly downsampled image is in fact smaller than the original. When recompressing an image, the output file that results can possibly expand in size.  If the process yields an image that is the same size as the original, or larger, the API will leave the image alone.
consolidate-duplicate-image-and-forms Remove duplicate copies of alternate images and forms.
down-convert-16-to-8-bpc-images When enabled, images that are 16 bits per component will be converted to 8 bits per component.

The color depth of an image is the number of bits used per pixel for each color component. RGB, for example, has three color components. By down-converting an image in a PDF file from 16 bpc to 8 bpc, you are reducing the resolution of the image, but also significantly reducing its size. If a PDF document features high-resolution images, the final PDF can also be significantly smaller.

This feature is not applicable if Color Conversion is enabled (see Color Conversion). Color Conversion will attempt to down-convert 16 bpc images automatically if you turn it on. The down-convert feature only has an impact if Color Conversion is turned off.

    "images": {
. . .
        "grayscale": {
            "downsample": {
                "trigger-dpi": 220,
                "target-dpi": 150
            "recompress": {
                "type": "jpeg",
                "quality": "medium"
 . . .
        "optimize-images-only-if-reduction-in-size": "on",
        "consolidate-duplicate-image-and-forms": "on",
        "down-convert-16-to-8-bpc-images": "on"