[]
Represents options that control the behavior of the Optimize(Stream, OptimizeDocumentOptions) and Optimize(string, OptimizeDocumentOptions) methods.
public class OptimizeDocumentOptions
Public Class OptimizeDocumentOptions
| Name | Description |
|---|---|
| OptimizeDocumentOptions() |
| Name | Description |
|---|---|
| CompressionLevel | Gets or sets the compression level to use. Note: This value overrides the compression level specified by CompressionLevel. The default value is Optimal. |
| DiscardEmbeddedFiles | Gets or sets whether the embedded files (EmbeddedFiles) should be removed from the document. The default value is false. |
| DiscardEmbeddedPageThumbnails | Gets or sets whether embedded page thumbnails should be removed from the document. The default value is false. |
| DiscardJavaScriptActions | Gets or sets whether ActionJavaScript actions should be removed from the document. The default value is false. |
| DiscardOutlines | Gets or sets whether all outlines should be removed from the document. When this property is set to true, the Outlines collection is cleared. The default value is false. |
| DiscardSubmitImportResetActions | Gets or sets whether actions of the types ActionSubmitForm, ActionImportData, and ActionResetForm should be removed from the document. The default value is false. |
| OptimizeFontsOptions | Gets or sets the options used to optimize fonts in the document. The behavior is identical to the OptimizeFonts(OptimizeFontsOptions) method. This property is ignored if RemoveEmbeddedFonts is set to true. By default, this property is not null and contains a default instance of OptimizeFontsOptions. |
| PdfStreamHandling | Gets or sets how existing PDF streams are handled when the document is saved. This setting is applicable only when optimizing an existing PDF that has been loaded. The default value is MinimizeSize. |
| RemoveDuplicateImages | Gets or sets whether images with identical content should be removed from the document. The default value is true. |
| RemoveEmbeddedFonts | Gets or sets whether embedded fonts should be removed from the document. Note that a PDF may display incorrectly after embedded fonts are removed. Use with caution. When this property is true, the value of OptimizeFontsOptions is ignored. The default value is false. |
| UseObjectStreams | Gets or sets whether to use object streams when saving the PDF. Using Multiple (recommended) or Single can significantly reduce the size of the saved PDF in most cases. This property is ignored and object streams are not used if:
The default value is Single. |
| Name | Description |
|---|---|
| SetForMinimumSize() | Configures all optimization settings to minimize the resulting PDF size, regardless of potential impact on quality or compatibility. |