# PdfRewritePreservationOptions

Configures the generic preservation checks used after PDF rewrite and manipulation operations.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfRewritePreservationOptions.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L7)

**Modifiers**

sealed

Configures the generic preservation checks used after PDF rewrite and manipulation operations.

## Inheritance

- object
- PdfRewritePreservationOptions

## Usage

Explore 8 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 4

- Property [PdfRewritePreservationMatrixScenario.PreservationOptions](/api/pdf/officeimo-pdf-pdfrewritepreservationmatrixscenario/#property-preservationoptions)
- Method [PdfRewritePreservationOptions.AllowMetadataChanges](/api/pdf/officeimo-pdf-pdfrewritepreservationoptions/#method-allowmetadatachanges-string)
- Method [PdfRewritePreservationOptions.Clone](/api/pdf/officeimo-pdf-pdfrewritepreservationoptions/#method-clone)
- Method [PdfRewritePreservationOptions.RequireTextMarkers](/api/pdf/officeimo-pdf-pdfrewritepreservationoptions/#method-requiretextmarkers-string)

### Accepted by parameters 4

- Method [PdfDocumentProof.AssertRewritePreservationMatrix](/api/pdf/officeimo-pdf-pdfdocumentproof/#method-assertrewritepreservationmatrix-string-string-func-officeimo-pdf-pdfdocument-officeimo-pdf-pdfdocument-officeimo-pdf-pdfrewritepreservationoptions) parameter `options`
- Method [PdfDocumentProof.AssertRewritePreserved](/api/pdf/officeimo-pdf-pdfdocumentproof/#method-assertrewritepreserved-officeimo-pdf-pdfdocument-officeimo-pdf-pdfrewritepreservationoptions) parameter `options`
- Method [PdfDocumentProof.AssessRewritePreservation](/api/pdf/officeimo-pdf-pdfdocumentproof/#method-assessrewritepreservation-officeimo-pdf-pdfdocument-officeimo-pdf-pdfrewritepreservationoptions) parameter `options`
- Method [PdfDocumentProof.AssessRewritePreservationMatrix](/api/pdf/officeimo-pdf-pdfdocumentproof/#method-assessrewritepreservationmatrix-string-string-func-officeimo-pdf-pdfdocument-officeimo-pdf-pdfdocument-officeimo-pdf-pdfrewritepreservationoptions) parameter `options`

Filter members 

Show inherited

## Constructors

`public PdfRewritePreservationOptions()` [#](#constructor-ctor)

[PdfRewritePreservationOptions.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L7)

## Methods

`public PdfRewritePreservationOptions AllowMetadataChanges(params string[] fieldNames)` [#](#method-allowmetadatachanges-string)

[PdfRewritePreservationOptions.cs:140](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L140)

Allows specific metadata fields to change and returns this options object for fluent setup.

Parameters

**fieldNames string[] required**

Returns

`PdfRewritePreservationOptions`

`public PdfRewritePreservationOptions Clone()` [#](#method-clone)

[PdfRewritePreservationOptions.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L16)

Copies these settings with independent collections and original/rewritten read policies.

Returns

`PdfRewritePreservationOptions`

`public PdfRewritePreservationOptions RequireTextMarkers(params string[] markers)` [#](#method-requiretextmarkers-string)

[PdfRewritePreservationOptions.cs:128](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L128)

Adds required text markers and returns this options object for fluent setup.

Parameters

**markers string[] required**

Returns

`PdfRewritePreservationOptions`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public PdfLoadOptions? OriginalReadOptions { get; set; }` [#](#property-originalreadoptions)

[PdfRewritePreservationOptions.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L29)

Read options used to inspect the original document, including its password when encrypted.

`public PdfLoadOptions? RewrittenReadOptions { get; set; }` [#](#property-rewrittenreadoptions)

[PdfRewritePreservationOptions.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L32)

Read options used to inspect the rewritten document, including its new password when encrypted.

`public bool PreservePageCount { get; set; }` [#](#property-preservepagecount)

[PdfRewritePreservationOptions.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L35)

True when the rewritten PDF must keep the original page count.

`public bool PreservePageGeometry { get; set; }` [#](#property-preservepagegeometry)

[PdfRewritePreservationOptions.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L38)

True when each unchanged page must keep width, height, and rotation.

`public bool PreserveMetadata { get; set; }` [#](#property-preservemetadata)

[PdfRewritePreservationOptions.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L41)

True when Info dictionary metadata fields must be preserved except for explicitly allowed fields.

`public bool PreserveOutlines { get; set; }` [#](#property-preserveoutlines)

[PdfRewritePreservationOptions.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L44)

True when outline/bookmark count must not be lost.

`public bool PreserveNamedDestinations { get; set; }` [#](#property-preservenameddestinations)

[PdfRewritePreservationOptions.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L47)

True when named destination count must not be lost.

`public bool PreservePageLabels { get; set; }` [#](#property-preservepagelabels)

[PdfRewritePreservationOptions.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L50)

True when page-label count and label ranges must not be lost.

`public bool PreserveLinkAnnotations { get; set; }` [#](#property-preservelinkannotations)

[PdfRewritePreservationOptions.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L53)

True when simple link annotation count must not be lost.

`public bool PreserveAnnotations { get; set; }` [#](#property-preserveannotations)

[PdfRewritePreservationOptions.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L56)

True when generic annotation count must not be lost.

`public ISet<string> ExcludedAnnotationSubtypes { get; }` [#](#property-excludedannotationsubtypes)

[PdfRewritePreservationOptions.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L59)

Annotation subtypes excluded from generic annotation-count preservation.

`public ISet<string> ExcludedLinkAnnotationUris { get; }` [#](#property-excludedlinkannotationuris)

[PdfRewritePreservationOptions.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L62)

URI targets excluded from simple link-annotation preservation.

`public ISet<string> ExcludedActionUris { get; }` [#](#property-excludedactionuris)

[PdfRewritePreservationOptions.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L65)

URI action targets excluded from catalog and page-action preservation.

`public bool PreserveForms { get; set; }` [#](#property-preserveforms)

[PdfRewritePreservationOptions.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L68)

True when simple AcroForm field count and form markers must not be lost.

`public bool PreserveEmbeddedFiles { get; set; }` [#](#property-preserveembeddedfiles)

[PdfRewritePreservationOptions.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L71)

True when embedded file/associated file count must not be lost.

`public bool PreserveXmpMetadata { get; set; }` [#](#property-preservexmpmetadata)

[PdfRewritePreservationOptions.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L74)

True when XMP metadata markers must not be lost.

`public bool PreserveOutputIntents { get; set; }` [#](#property-preserveoutputintents)

[PdfRewritePreservationOptions.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L77)

True when output intent count must not be lost.

`public bool PreserveOptionalContent { get; set; }` [#](#property-preserveoptionalcontent)

[PdfRewritePreservationOptions.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L80)

True when optional content/layer markers must not be lost.

`public bool PreserveTaggedContent { get; set; }` [#](#property-preservetaggedcontent)

[PdfRewritePreservationOptions.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L83)

True when tagged PDF structure markers and readable structure metadata must not be lost.

`public bool PreserveCatalogViewSettings { get; set; }` [#](#property-preservecatalogviewsettings)

[PdfRewritePreservationOptions.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L89)

True when catalog page mode, layout, language, and viewer preferences must not be lost.

`public bool PreserveOpenAction { get; set; }` [#](#property-preserveopenaction)

[PdfRewritePreservationOptions.cs:92](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L92)

True when document open-action destination metadata must not be changed.

`public bool PreserveCatalogActions { get; set; }` [#](#property-preservecatalogactions)

[PdfRewritePreservationOptions.cs:95](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L95)

True when catalog-level active action metadata must not be changed.

`public bool PreservePageActions { get; set; }` [#](#property-preservepageactions)

[PdfRewritePreservationOptions.cs:98](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L98)

True when page-level additional action metadata must not be changed.

`public bool PreserveFormWidgetActions { get; set; }` [#](#property-preserveformwidgetactions)

[PdfRewritePreservationOptions.cs:101](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L101)

True when retained AcroForm field and widget actions must not be lost or changed.

`public ISet<string> PreservedActionTypes { get; }` [#](#property-preservedactiontypes)

[PdfRewritePreservationOptions.cs:104](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L104)

Action types compared when action preservation is enabled. An empty set compares every action type.

`public bool PreserveViewerPreferences { get; set; }` [#](#property-preserveviewerpreferences)

[PdfRewritePreservationOptions.cs:109](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L109)

True when viewer preference values must not be changed.

`public bool PreserveDocumentVersionState { get; set; }` [#](#property-preservedocumentversionstate)

[PdfRewritePreservationOptions.cs:112](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L112)

True when header, catalog, and effective PDF version markers must not be changed.

`public bool PreserveRevisionStructure { get; set; }` [#](#property-preserverevisionstructure)

[PdfRewritePreservationOptions.cs:115](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L115)

True when xref-stream, object-stream, previous-revision, and incremental-update markers must not be lost.

`public bool PreserveSecurityState { get; set; }` [#](#property-preservesecuritystate)

[PdfRewritePreservationOptions.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L118)

True when security, signature, DSS/VRI, DocMDP, and usage-rights markers must not be lost or changed.

`public IList<string> RequiredTextMarkers { get; }` [#](#property-requiredtextmarkers)

[PdfRewritePreservationOptions.cs:121](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L121)

Text markers that must remain extractable from the rewritten PDF.

`public ISet<string> AllowedMetadataChanges { get; }` [#](#property-allowedmetadatachanges)

[PdfRewritePreservationOptions.cs:124](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfRewritePreservationOptions.cs#L124)

Metadata fields that the rewrite is allowed to change. Supported names: Title, Author, Subject, Keywords.

<!-- PowerForge markdown artifact sha256:A691B9ACF21B4C8FF54FBD9B89C105CA80162C5734714705E00D162AD7BA4027 -->
