Options

From PDF XChange PDF SDK
Revision as of 08:29, 8 February 2016 by Ivgen (Talk | contribs)

Jump to: navigation, search


Options Table

Name Type Value
Images Dictionary Specifies parameters for optimize images.
Fonts Dictionary Specifies parameters for optimize fonts.
Transparency Dictionary Not yet implemented.
DiscardObjects Dictionary Specifies parameters for discard objects.
DiscardUserData Dictionary Specifies parameters for discard user`s data.
CleanUp Dictionary Specifies parameters for cleanup document.
VersionForSave Integer Specifies a PDF document`s version wich will be used for save.

For receive a valid value use conctruction

val = ((major) << 16) | ((minor) & 0xFFFF)

(for example version 1.7 = ((1) << 16) | ((7) & 0xFFFF)

If you want to leave current version set this parameter to 0.

We recommend to use higher or the same version of original document.

Default value: 0

PresetID String Specifies...

Default value: Empty String

Progress IUnknown Specifies a object based on IProgressMon interface. This object realise progress bar for operation.
SubProgress Boolean Specifies whether the Progress is a top-level progress, or a part of another progress bar.

Default value: false

Images Table

Name Type Value
Enabled Boolean If Enabled == false then optimize will not be use for images.

Default value: true

ReducedOnly Boolean If ReducedOnly == true then optimize images only if there is reduction in size.

Default value: true

Scale Dictionary Specifies parameters for scaling images.
Comp Dictionary Specifies parameters for compressing images.

Scale Table

Name Type Value
Color Dictionary Specifies parameters for scaling fullcolor images.
Grayscale Dictionary Specifies parameters for scaling grayscale images.
Indexed Dictionary Specifies parameters for scaling images with indexed palette.
Mono Dictionary Specifies parameters for scaling monochrome images (1bit color).

Color Table

Name Type Value
Method Integer Specifies a method which will be used for downsampling fullcolor images.

Valid values are:

0- No downsampling

1- Average downsampling

2- Subsampling

3- Bicubic downsampling

Default value: 3

To Integer Specifies DPI for resulting images.

Default value: 150

IfAbove Integer All fullcolor images with DPI above this value will be optimized.

Default value: 225

Grayscale Table

Name Type Value
Method Integer Specifies a method which will be used for downsampling grayscale images.

Valid values are:

0- No downsampling

1- Average downsampling

2- Subsampling

3- Bicubic downsampling

Default value: 3

To Integer Specifies DPI for resulting images.

Default value: 150

IfAbove Integer All grayscale images with DPI above this value will be optimized.

Default value: 225

Indexed Table

Name Type Value
Method Integer Specifies a method which will be used for downsampling images with indexed palette.

Valid values are:

0- No downsampling

1- Subsampling

Default value: 1

To Integer Specifies DPI for resulting images.

Default value: 150

IfAbove Integer All images with indexed palette with DPI above this value will be optimized.

Default value: 225

Mono Table

Name Type Value
Method Integer Specifies a method which will be used for downsampling monochrome images (1bit color).

Valid values are:

0- No downsampling

1- Average downsampling

2- Subsampling

3- Bicubic downsampling

Default value: 3

To Integer Specifies DPI for resulting images.

Default value: 300

IfAbove Integer All monochrome images with DPI above this value will be optimized.

Default value: 450

Comp Table

Name Type Value
Color Dictionary Specifies parameters for compressing fullcolor images.
Grayscale Dictionary Specifies parameters for compressing grayscale images.
Indexed Dictionary Specifies parameters for compressing images with indexed palette.
Mono Dictionary Specifies parameters for compressing monochome images (1bit color).

Color Table

Name Type Value
Method Integer Specifies a method which will be used for compressing fullcolor images.

Valid values are:

0- Retain existing

1- JPEG2000

2- JPEG

3- ZIP

Default value: 2

JPEGQuality Integer Used if JPEG or JPEG2000 compression method selected.

Valid values are:

0= Minimum

1= Low

2= Medium

3= High

4= Maximum

5= Lossless (only for JPEG2000)

Default value: 2

JPEG2000Tile Integer Don't used.

Default value: 256

Grayscale Table

Name Type Value
Method Integer Specifies a method which will be used for compressing grayscale images.

Valid values are:

0- Retain existing

1- JPEG2000

2- JPEG

3- ZIP

Default value: 2

JPEGQuality Integer Used if JPEG or JPEG2000 compression method selected.

Valid values are:

0= Minimum

1= Low

2= Medium

3= High

4= Maximum

5= Lossless (only for JPEG2000)

Default value: 2

JPEG2000Tile Integer Don't used.

Default value: 256

Indexed Table

Name Type Value
Method Integer Specifies a method which will be used for compressing images with indexed palette.

Valid values are:

0- Retain existing

1- ZIP

2- Run Length

3- LZW

Default value: 1

Mono Table

Name Type Value
Method Integer Specifies a method which will be used for compressing monochrome images.

Valid values are:

0- Retain existing

1- JBIG2

2- CCIT Croup 3

3- CCIT Croup 4

4- ZIP

5- Run Length

Default value: 1

JBIG2Quality Integer Don't used.

Default value: 0

Fonts Table

Name Type Value
Enabled Boolean If Enabled == false then optimize will not be use for fonts.

Default value: true

NotUnembed Boolean For 5.5(Build 316.1) or early version only.

Is unavailable in newest version. If true then do not unembed any font. Default value: false

UnembedType Integer Specified a way to unembedding fonts.

0 - do not unembed any font.

1 - unembed recommendable fonts only.

2 - unembed all fonts.

3 - unembed fonts listed in UnembedFonts list.

Unavailable in old version.

Default value: 1

SubsetAll Boolean Don`t used.

Default value: true

MergeSubsets Boolean If true then all font`s subsets will be merged.

Default value: true

UnembedFonts Array Array of Dictionary(UnembedFonts)

Specifies an array of fonts which will be unembeded.

UnembedFonts Table

Name Type Value
FontObjNom Integer Specifies a font handle from document.

Default value: 0

FontName String Specifies a font name.

Default value: Empty String

Transparency Table (Not yet implemented)

Name Type Value
Enabled Boolean Specifies...

Default value: true

Quality Integer Specifies...

Default value: 2

LowTransLevel Integer Specifies...

Default value: 75

LowLineArtText Integer Specifies...

Default value: 288

LowGradientMeshes Integer Specifies...

Default value: 144

LowFlags Integer Specifies...

Default value: 10

MediumTransLevel Integer Specifies...

Default value: 75

MediumLineArtText Integer Specifies...

Default value: 300

MediumGradientMeshes Integer Specifies...

Default value: 150

MediumFlags Integer Specifies...

Default value: 14

HightTransLevel Integer Specifies...

Default value: 100

HightLineArtText Integer Specifies...

Default value: 1200

HightGradientMeshes Integer Specifies...

Default value: 300

HightFlags Integer Specifies...

Default value: 12

DiscardObjects Table

Name Type Value
Enabled Boolean Specifies if discard objects is enabled.

Default value: true

Flags Integer 0x001 = Discard all form submission, import and reset actions

0x002 = not used

0x004 = Discard all JavaScript actions

0x008 = Discard all alternate images

0x010 = Discard embedded page thumbnails

0x020 = not used

0x040 = not used

0x080 = Detect and merge image fragments

0x100 = Discard embedded print setting

0x200 = not used

0x400 = Discard bookmarks

Default value: 8

DiscardUserData Table

Name Type Value
Enabled Boolean Specifies if discard user`s data is enabled.

Default value: true

Flags Integer 0x001 = Discard all Comments, forms and multimedia

0x002 = Discard document information and metadata

0x004 = not used

0x008 = Discard file attachments

0x010 = Discard external cross references

0x020 = Discard private data of other applications

0x040 = Discard hidden layer content and flatten visible layers

Default value: 0

CleanUp Table

Name Type Value
Enabled Boolean Specifies if cleanup document is enabled.

Default value: true

CleanUpCompress Integer Don't used.

Default value: 0

Flags Integer 0x001= Use Flate to encode streams that are not encoded

0x002= In streams that use LZW encoding use Flate instead

0x004= Discard invalid bookmarks

0x008= Discard invalid links

0x010= Discard unreferenced named destinations

0x020= not used

0x040= not used

0x080= Discard duplicates of Fonts

0x100= Discard duplicates of Images

0x200= Discard duplicates of XForms

0x400= Find and Remove the content outside of crop box

Default value: 1007