PdfOptimizationOptions Class
The changes PdfOptimizer.CreatePlan plans. Every change is off by default.
public sealed class PdfOptimizationOptionsConstructors
| Name | Description |
|---|---|
| PdfOptimizationOptions() |
PdfOptimizationOptions()
public PdfOptimizationOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| AllowSignatureInvalidation | Gets a value indicating whether the plan may change a document that has signatures. The default is false: PdfOptimizer.Apply refuses to apply a plan that would invalidate them. |
| CompressStreams | Gets a value indicating whether the streams that have no filter are compressed with FlateDecode, when it makes them smaller. A full save with PdfSaveOptions.CompressStreams compresses them too: this matters for an incremental save, or a save that does not compress. |
| FlattenOptionalContent | Gets a value indicating whether the optional content (layers) is flattened: the content hidden in the default configuration is removed, the visible content is kept as ordinary content, and the document no longer has layers. |
| MaxImageResolution | Gets the resolution, in pixels per inch, above which the images are resampled to it, or null (the default) to keep the images. The resolution of an image is the highest of its placements on the pages. |
| PruneUnreachableObjects | Gets a value indicating whether the indirect objects that cannot be reached from the trailer are removed. A full save never writes them: this matters for an incremental save, which writes them as free entries. |
| PruneUnusedResources | Gets a value indicating whether the resources of the pages that their content does not use are removed. |
| RemoveAttachments | Gets a value indicating whether the embedded files and the file attachment annotations are removed. |
| RemoveBookmarks | Gets a value indicating whether the outline (bookmarks) is removed. |
| RemoveComments | Gets a value indicating whether the comments are removed: the markup annotations (notes, highlights, stamps, drawings...) and their pop-ups. |
| RemoveFormFields | Gets a value indicating whether the interactive form is removed, with the widgets of its fields. Use PdfInteractiveForm.Flatten to keep the values on the pages. |
| RemoveJavaScript | Gets a value indicating whether JavaScript is removed: the scripts of the document and the actions that run scripts. |
| RemoveMetadata | Gets a value indicating whether the document information dictionary and the XMP metadata of the document are removed. |
| RemoveOpenAction | Gets a value indicating whether the action run when the document is opened is removed. |
| RemovePageThumbnails | Gets a value indicating whether the thumbnail images of the pages are removed. |
| RemoveXfa | Gets a value indicating whether the XFA form is removed; the AcroForm fields are kept. |
AllowSignatureInvalidation
PdfOptimizationOptions.csGets a value indicating whether the plan may change a document that has signatures. The default is false: PdfOptimizer.Apply refuses to apply a plan that would invalidate them.
public bool AllowSignatureInvalidation { get; init; }Property value
CompressStreams
PdfOptimizationOptions.csGets a value indicating whether the streams that have no filter are compressed with FlateDecode, when it makes them smaller. A full save with PdfSaveOptions.CompressStreams compresses them too: this matters for an incremental save, or a save that does not compress.
public bool CompressStreams { get; init; }Property value
FlattenOptionalContent
PdfOptimizationOptions.csMaxImageResolution
PdfOptimizationOptions.csGets the resolution, in pixels per inch, above which the images are resampled to it, or null (the default) to keep the images. The resolution of an image is the highest of its placements on the pages.
public double? MaxImageResolution { get; init; }Property value
Exceptions
ArgumentOutOfRangeException- The value is not positive.
Remarks
The images of 8 bits per component in gray, RGB or an ICC-based color space of 1 or 3 components, without color key mask or decode array, are resampled; the others are kept. A JPEG image is compressed as JPEG again, the others without loss.
PruneUnreachableObjects
PdfOptimizationOptions.csPruneUnusedResources
PdfOptimizationOptions.csRemoveAttachments
PdfOptimizationOptions.csRemoveBookmarks
PdfOptimizationOptions.csRemoveComments
PdfOptimizationOptions.csRemoveFormFields
PdfOptimizationOptions.csGets a value indicating whether the interactive form is removed, with the widgets of its fields. Use PdfInteractiveForm.Flatten to keep the values on the pages.
public bool RemoveFormFields { get; init; }