DocumentSettings Class
Represents stored preferences which shall be used when processing the contents of the document.
- Inheritance:
- System.ObjectDocumentSettings
Constructors
DocumentSettings()
Initializes a new instance of the DocumentSettings class.
Properties
AttachedTemplate
Gets or sets the location of a document template which shall be attached to the current document if it is accessible and of a format supported by an application such as MS Word.
Property Value
- System.String
The location of a document template which shall be attached to the current document.
Remarks
If value is null or System.String.Empty, then the document shall not have an attached document template, and applications should use their default template in its place.
BookFoldPrinting
Gets or sets a value indicating whether to print the document as a book fold. Supported only in DOCX format.
Property Value
- System.Boolean
true to print a document in a series of booklets so the printed pages can be folded and read as a book; otherwise, false.
BookFoldPrintingReverse
Gets or sets a value indicating whether to print the document as a reverse book fold. Supported only in DOCX format.
public bool BookFoldPrintingReverse { get; set; }
Public Property BookFoldPrintingReverse As Boolean
Property Value
- System.Boolean
true to reverse the printing order for book fold printing of bidirectional or Asian language documents; otherwise, false.
BookFoldPrintingSheets
Gets or sets the number of pages to be included in each booklet.
public int BookFoldPrintingSheets { get; set; }
Public Property BookFoldPrintingSheets As Integer
Property Value
- System.Int32
The number of pages for each booklet.
CompatibilityMode
Gets or sets the Microsoft Word compatibility mode. For Microsoft Word 2016, set this value to 15.
Property Value
- System.Int32
The Microsoft Word compatibility mode.
DecimalSeparator
Gets or sets the string to use as the decimal separator in numeric values in the document.
Property Value
- System.String
The string to use as the decimal separator in numeric values in the document.
DefaultTabStop
Gets or sets the value which shall be used as the multiplier to generate automatic tab stops in this document.
Default value is 36 points (half an inch).
Property Value
- System.Double
The value which shall be used as the multiplier to generate automatic tab stops in this document.
Remarks
Automatic tab stops refer to the tab stop locations which occur after all custom tab stops in the current paragraph have been surpassed.
DoNotExpandShiftReturn
Gets or sets a value indicating whether to justify the contents of incomplete lines which end in a soft line break when the parent paragraph is justified.
public bool DoNotExpandShiftReturn { get; set; }
Public Property DoNotExpandShiftReturn As Boolean
Property Value
- System.Boolean
true to not expand character spaces on the line ending in justified paragraph; otherwise, false.
Endnote
Gets the endnote settings.
Property Value
The endnote settings.
Remarks
Note can be configured using NoteSettings on a document level (Footnote and Endnote) or on a section level (FootnoteSettings and EndnoteSettings. Document level settings are cloned when new Section is added to the DocumentModel.
PDF format has the following limitations:
- Footnotes are always rendered on the same page as their references.
- Footnotes that don't fit on a single page are clipped.
- Note numbering setting RestartEachPage is not supported.
HTML and TXT formats have the following limitations:
- All footnotes and then endnotes are exported at the end of the document.
- Note numbering setting RestartEachPage is not supported.
Footnote
Gets the footnote settings.
Property Value
The footnote settings.
Remarks
Note can be configured using NoteSettings on a document level (Footnote and Endnote) or on a section level (FootnoteSettings and EndnoteSettings. Document level settings are cloned when new Section is added to the DocumentModel.
PDF format has the following limitations:
- Footnotes are always rendered on the same page as their references.
- Footnotes that don't fit on a single page are clipped.
- Note numbering setting RestartEachPage is not supported.
HTML and TXT formats have the following limitations:
- All footnotes and then endnotes are exported at the end of the document.
- Note numbering setting RestartEachPage is not supported.
MirrorPageMargins
Gets or sets a value indicating whether the left and right margins defined in the PageSetup shall be swapped on facing pages.
Property Value
- System.Boolean
true if the left and right margins defined in the PageSetup shall be swapped on facing pages; otherwise, false.
Remarks
This setting is generally used when printing on both sides of pages and binding them like a book.
TrackRevisions
Gets or sets a value indicating whether changes are tracked as revisions.
Property Value
- System.Boolean
true if changes are tracked when this document is edited in Microsoft Word; otherwise, false.
Remarks
GemBox.Document does not use this option when updating the document, it does not automatically track changes. This option only instructs Microsoft Word whether the track changes are enabled or disabled.
TwoPagesOnOne
Gets or sets a value indicating whether to print two pages per sheet. Supported only in DOCX format.
Property Value
- System.Boolean
true to print a document two pages per sheet; otherwise, false.
UpdateStylesOnOpen
Gets or sets a value indicating whether the styles in the specified document are updated to match the styles in the attached template each time the document is opened by an application such as MS Word.
Property Value
- System.Boolean
true if the styles in the specified document are updated to match the styles in the attached template each time the document is opened; otherwise, false.
Remarks
GemBox.Document does not use this flag to update styles when document is loaded.
Methods
Clone()
Clones this DocumentSettings instance.
Returns
Cloned DocumentSettings.
Clone(DocumentModel)
Clones this DocumentSettings instance.
public DocumentSettings Clone(DocumentModel destinationDocument)
Public Function Clone(destinationDocument As DocumentModel) As DocumentSettings
Parameters
destinationDocument
- DocumentModel
Destination document which will store styles etc. from cloned elements.
Returns
Cloned DocumentSettings.