Click or drag to resize
Pdf Library for .NET

GlobalPropertiesAutoRepair Property

Gets or sets whether a damaged PDF document is repaired when it is opened. Default is true.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.6
Syntax
public static bool AutoRepair { get; set; }

Property Value

Boolean
Remarks

When a document cannot be read as written - a damaged or missing cross-reference table, wrong stream lengths, a document catalog the trailer does not point to - it is read again with its structure rebuilt from the objects the file contains, as PDF viewers do. A document that reads as written is not affected.

Set it to false to refuse such documents instead: opening one throws an exception. It applies to every document opened after it is set: a document loaded from a file or a stream, a document appended or prepended to another, and the documents the PDF managers load. PdfToText and PdfRasterizer read a document their own reader cannot open through the same repair.

A repaired document is saved in full, not as an update to the file it was read from, so a digital signature it carried no longer verifies once it is saved. A document opened with a wrong password is refused either way.

See Also