RecAPI
Command strings of rPdfOptAddCommandStr

The function rPdfOptAddCommandStr of RecPDF Module uses command strings for setting up the optimization process. The below lists show the possible command strings.

Note:
The command strings are case-sensitive.

The structure of a command string:

    CommandStr[:Specifier[:Exact Value]]

The below lists show the CommandStr in bold. Sublists show the Specifiers if any, and the possible Exact Values are also shown where they can be used.

Basic functions

  • XRef - Compress the XRef structure.
  • CompressObjects - Compress the uncompressed data objects.
  • ZIPStreams - Use Zip compression instead of LZW.
  • Linearize - Optimize for fast web view.

Set the version of the PDF

  • PDF13 - Convert to 1.3
  • PDF14 - Convert to 1.4
  • PDF15 - Convert to 1.5
  • PDF16 - Convert to 1.6
  • PDF17 - Convert to 1.7
  • PDFA_1A - Convert to PDF/A-1a
  • PDFA_1B - Convert to PDF/A-1b
  • PDFA_2A - Convert to PDF/A-2a
  • PDFA_2B - Convert to PDF/A-2b
  • PDFA_2U - Convert to PDF/A-2u
  • PDFA_3A - Convert to PDF/A-3a
  • PDFA_3B - Convert to PDF/A-3b
  • PDFA_3U - Convert to PDF/A-3u

Tag handling

  • RemoveTags - Remove the tags from the PDF.

Font handling

  • SubsetFonts - Subset all embedded fonts.

Security

  • NoSec - Remove security.
  • Sec40 - Protect with 40 bit RC4 encryption.
  • Sec128 - Protect with 128 bit RC4 encryption.
  • Sec128AES - Protect with 128 bit AES encryption.
  • Sec256 - Protect with 256 bit AES encryption.
  • OwnerPassword - Set the owner password. Separate the password with ':'! E.g.: OwnerPassword:123A24d
  • Restrictions - Set the security restrictions. Separate the integer value of the combined restriction flags with ':'! Use the flags of RPDF_RESTRICTIONS. E.g. for disabling printing and changing: Restrictions:8448

Image compression

  • BWImages - Set the compression of the black and white images. Possible specifiers:
    • CCITTFax - Group4 compression.
    • JBIG2 - JBIG2 compression. Possible exact values: 1...100
      • E.g.: BWImages:JBIG2:80
  • GrayImages - Set the compression of the grayscale images. Possible specifiers:
    • JPEG - JPEG compression. Possible exact values: 1...100
    • JPEG2000 - JPEG2000 compression. Possible exact values: 1...100
    • ZIP - Zip compression.
  • ColorImages - Set the compression of the color images. Possible specifiers:
    • JPEG - JPEG compression. Possible exact values: 1...100
    • JPEG2000 - JPEG2000 compression. Possible exact values: 1...100
    • ZIP - Zip compression.

Colorspace conversions

  • ImagesToBW - Convert all images to black and white.
  • ImagesToGray - Convert color images to grayscale.
  • ConvertToGray - Convert all PDF content to grayscale.

Metadata handling

  • FixMetadata - Fix metadata errors. Remove incorrect metadata entries.
  • MetaAdd - Add metadata entry.
    • E.g.: MetaAdd:pdf:Producer:SomeApp
  • MetaRemove - Remove metadata entry.
    • E.g.: MetaRemove:pdf:Keywords
  • MetaReplace - Replace metadata entry.