LoadSettings Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
- Inherits
- Load
Save Settings Base - Load
Settings
- Load
Description
The LoadSettings class provides properties for advanced settings and information during load operations. See the TextControl.Load method for more information.
Syntax
public sealed class LoadSettings : LoadSaveSettingsBasePublic NotInheritable Class LoadSettings
Inherits LoadSaveSettingsBaseExamples
The following example shows how to use the LoadSettings to get the filename and the read bytes of a loaded document.
TXTextControl.LoadSettings ls = new TXTextControl.LoadSettings();
if (textControl1.Load(TXTextControl.StreamType.All, ls) == DialogResult.OK)
{
MessageBox.Show(ls.LoadedFile + " has been loaded. " + ls.BytesRead.ToString() + " bytes read.");
}Dim ls As TXTextControl.LoadSettings = New TXTextControl.LoadSettings()
If TextControl1.Load(TXTextControl.StreamType.All, ls) = DialogResult.OK Then
MessageBox.Show(ls.LoadedFile + " has been loaded. " + ls.BytesRead.ToString() + " bytes read.")
End IfThe following example configures how a WordprocessingML template is loaded.
LoadSettings loadSettings = new();
textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);Dim loadSettings As New LoadSettings()
textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings)Members
Constructors
| Constructor | Description |
|---|---|
| LoadSettings | Not described in the reference. public LoadSettings(); |
Properties
| Property | Description |
|---|---|
| AddParagraph | Specifies whether or not a new paragraph is created before text is loaded. This property has only an effect, when a LoadSettings object is used with the Selection.Load method. By default a new paragraph is not created. When text is loaded into an existing paragraph the formatting attributes of the existing and the last loaded paragraph are merged. When this property is true, attributes are not merged and the newly created paragraph gets the attributes of the last loaded paragraph. |
| ApplicationFieldFormat | Specifies the format of text fields which are imported. The property's value can be one of the ApplicationFieldFormat values. |
| ApplicationFieldTypeNames | Specifies an array of strings containing the type names of fields which are to be imported. This property is only taken into account, if the LoadSettings.ApplicationFieldFormat property is set to ApplicationFieldFormat.MSWord or ApplicationFieldFormat.HighEdit. For example, if the LoadSettings.ApplicationFieldFormat is set to ApplicationFieldFormat.MSWord and this array has the single string MERGEFIELD only Microsoft Word Merge Fields are loaded. If this property is null, which is the default value, all fields with the format specified through the LoadSettings.ApplicationFieldFormat are loaded. |
| Author | Gets the document's author. It is an empty string, if there is no author saved in the loaded document. |
| BytesRead | Gets the number of bytes read during the load operation. |
| ConvertedMergeBlocks | Not described in the reference. public int ConvertedMergeBlocks { get; } |
| CreationDate | Gets the document's creation date. It is January 1, 0001 in the Gregorian calendar, if there is no creation date saved in the loaded document. |
| CreatorApplication | Gets the application, which has created the document. It is an empty string, if a creator application is not saved in the loaded document. |
| CssFileName | Gets the path and filename of the CSS file belonging to a HTML or XML document. |
| DefaultStreamType | Determines the default StreamType used in the file Open... and file Save As... dialogboxes. (Inherited from LoadSaveSettingsBase.) |
| DocumentAccessPermissions | Specifies how a document can be accessed after it has been loaded. If a valid master password has been specified with the MasterPassword property, the document can be accessed without any restrictions. The property's value can be a bitwise combination of more than one of the described values. |
| DocumentBasePath | Sets a base path saved in the document that is used to resolve relative file paths. (Inherited from LoadSaveSettingsBase.) |
| DocumentKeywords | Gets the document's keywords. The property value is null, if there are no keywords saved in the document. |
| DocumentPartName | SpreadsheetML only. Gets or sets the name of the part of the document to be loaded. Each SpreadsheetML document can contain multiple named worksheets. This property can be used to select a certain worksheet. The LoadSettings.GetDocumentPartNames method returns a list of all worksheet names. When this property is null, which is the deafault value, the first worksheet in loaded. When this property is an empty string, a dialog box is opened showing the names of all worksheets the document contains. The end-user can then select the worksheet to be loaded. |
| DocumentSubject | Gets the document's subject string. It is an empty string, if there is no subject saved in the loaded document. |
| DocumentTitle | Gets the document's title. It is an empty string, if there is no title saved in the loaded document. |
| EmbeddedData | Gets a System.Collections.Generic.Dictionary containing additional embedded data contained in a PDF document. Supported formats are specified through the EmbeddedDataFormat enumeration. Each entry in the dictionary is a key-value pair, the key is an EmbeddedDataFormat enumeration value and the value is a string with the data in the specified format. This Dictionary is filled only, if the PDFImportSettings property specifies the LoadEmbeddedData setting. |
| EmbeddedFiles | Specifies an array of EmbeddedFile objects which will be embedded in the saved document. Each file must be specified through a name and its data. (Inherited from LoadSaveSettingsBase.) |
| ImageSearchPath | Sets a file path that is used to search for resources like images or hypertext links. This path replaces all absolute file paths used in the document. |
| LastModificationDate | Gets the date the document is last modified. It is January 1, 0001 in the Gregorian calendar, if such a date is not saved in the loaded document. |
| LoadDocumentBackColor | Specifies whether or not the document background color is loaded. By default it is loaded. |
| LoadedFile | Gets the name and path of the file that has been loaded. |
| LoadedFormatVersion | Not described in the reference. public int LoadedFormatVersion { get; } |
| LoadedStreamType | Gets the StreamType of the file that has been loaded. |
| LoadHypertextLinks | Specifies whether or not hypertext links are loaded. By default hypertext links are loaded. |
| LoadImages | Specifies whether or not images are loaded. If set to false images are displayed through a rectangle and the image's name. By default images are loaded. |
| LoadSubTextParts | DOCX, DOC and RTF Formats only: Specifies whether or not bookmarks which extend over several characters are converted to SubTextParts. By default bookmarks are converted to DocumentTargets and when a bookmark extend over several characters, the first character is used as the target position. |
| MasterPassword | Specifies a password for the document's access permissions. If the password is an empty string, accessing the document is not restricted. If a password is specified, the access permissions are given through the SaveSettings.DocumentAccessPermissions property. (Inherited from LoadSaveSettingsBase.) |
| PageMargins | Gets the margins of the loaded document's pages. If the document does not contain margins the values are set to -1. |
| PageSize | Gets the width and height of the loaded document's pages. If the document does not contain a page size the Width and Height is set to 0. |
| PDFImportSettings | Specifies how the document structure is generated when a PDF document is imported. Adobe PDF format is a low-level output format. In most cases in contains only geometrical information about the single characters. A high-level document structure specifying paragraphs, tables, sections and styles is not available. The TXTextControl PDF import filter will reconstruct the original document according to the value of the PDFImportSettigs property. |
| ReportingMergeBlockFormat | Specifies how reporting merge blocks are handled when a document is saved. Reporting merge blocks can be saved in a document either through special document targets represented through DocumentTarget objects or through special subtextparts represented through SubTextPart objects. When a merge block is marked with document targets, the name of the starting marker begins with blockstart_ and the name of the ending marker begins with blockend_. When a merge block is marked through a subtextpart, its name begins with txmb_. (Inherited from LoadSaveSettingsBase.) |
| UserDefinedDocumentProperties | Gets a dictionary with all user-defined document properties contained in the loaded document. The property's value is an object of the type UserDefinedPropertyDictionary or null, if the document does not contain any user-defined property. |
| UserPassword | Specifies the password for the user when the document is reopened. If the password is an empty string the document can be reopened by every user. (Inherited from LoadSaveSettingsBase.) |
| ValidateFormat | Not described in the reference. public bool ValidateFormat { get; set; } |
Methods
| Method | Description |
|---|---|
| GetDocumentPartNames | SpreadsheetML only. Returns the names of all document parts the specified document contains. Each SpreadsheetML document can contain multiple named worksheets. |