TXTextControl.TXTextControl.LoadSaveAttribute Property

This property enables an application to specify several attributes that can be used in combination with the Load and Save methods for the following situations: 1. Documents can contain elements, for example a document title, that cannot be converted directly to text properties but may be useful for certain applications. Such an attribute can be set before a document is saved, in order to store it as part of the document, or it can be provided and used after a document has been loaded. 2. In some documents generic information about text properties is left out, for example with HTML documents which define font heights as a percentage of a base height without specifying that base height. Such an attribute can be set before a document is loaded, in order to inform the filter how to calculate such relative values.

Syntax

TXTextControl.LoadSaveAttribute(Attribute) [= value]
Parameter Description
Attribute

Determines the attribute that is to be changed or returned. Possible values are listed in Constants.

Constants

Valid values for the Attribute parameter are:

Constant Description
txDocWidth (0)

Loads or saves a document width in twips. When this property is set before a document is loaded, it is used to calculate width values contained in the document which are relative to the document's width. After a document has been loaded, this property returns the width, contained in the document, or -1 if the document does not contain a width. When a document is saved and this property has not been set, Text Control saves the value of the PageWidth property instead, except this property has been set to -1 previously.

txDocHeight (1)

Loads or saves a document height in twips. It is used in the same manner as described for the txDocWidth attribute.

txDocLeftMargin (2)

Loads or saves a left document margin in twentieths of a point. After a document has been loaded, this property returns the margin contained in the document, or -1 if the document does not contain the margin. When a document is saved and this property has not been set, Text Control saves the value of the PageMarginL property instead, except this property has been set to -1 previously.

txDocTopMargin (3)

Loads or saves a top document margin in twentieths of a point. It is used in the same manner as described for the txDocLeftMargin attribute.

txDocRightMargin (4)

Loads or saves a right document margin in twentieths of a point. It is used in the same manner as described for the txDocLeftMargin attribute.

txDocBottomMargin (5)

Loads or saves a bottom document margin in twentieths of a point. It is used in the same manner as described for the txDocLeftMargin attribute.

txDocTitle (6)

Loads or saves a document title. After a document has been loaded, this property returns the document title contained in the document, or an empty string if the document does not contain a title.

txDocBkColor (7)

Loads or saves a document background color as a RGB value. After a document has been loaded, this property returns the background color contained in the document, or -1, if the document does not contain a background color.

txCSSFile (8)

HTML only. Specifies a full or relative path and filename for a CSS file. This file is only used if txCSSSaveMode determines that stylesheet data is saved in a file.

txCSSSaveMode (9)

HTML only. Determines how to save stylesheets in HTML format. It can be one of the following values:


Code Meaning
0 - Without Stylesheets All format information is saved in the body of the HTML document.
1 - Inline Stylesheets are saved in the head of the HTML document.
2 - Create File Stylesheets are saved in a newly created CSS file. This file has the same name and location as the corresponding HTML file or is specified through the txCSSFile attribute. The file is only created if it does not exist. If the HTML document is saved in a memory buffer this setting cannot be used.
3 - Overwrite File Stylesheets are saved in a newly created CSS file. This file has the same name and location as the corresponding HTML file or is specified through the txCSSFile attribute. If the file already exists, it is overridden. If the HTML document is saved in a memory buffer, this setting cannot be used.
txDocAccessPermissions (10)

PDF only. Specifies how a document can be accessed after it has been opened. This property has only an effect, if also a password has been specified with the txMasterPassword setting. If no password has been specified, the document can be accessed without any restrictions. The settings value can be a bitwise combination of more than one of the following values.


Code Meaning
&H1 Allows authoring comments and fill in interactive form fields (including signature fields).
&H2 Fill-in existing interactive form fields (including signature fields) is allowed.
&H4 Allows content access for the visually impaired only.
&H8 Allows assembly of the the document (insert, rotate or delete pages and create bookmarks or thumbnails).
&H10 Copying or otherwise extracting text and/or graphics is allowed.
&H20 Allows modifying the document's contents.
&H40 Printing the document is fully allowed.
&H80 Printing the document is allowed (low-level).
txMasterPassword (11)

PDF only. Specifies the 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 txDocAccessPermissions setting.

txUserPassword (12)

PDF only. Specifies the password for the user to open the document. If the password is an empty string, the document can be opened by every user.

txImageCompressionQuality (13)

Sets a value between 1 and 100, which is the quality of a lossy image compression used when a document is saved. It is used for all images in the document the data of which is compressed with a lossy compression algorithm. A value of 100 indicates the maximum quality, a value of 1 indicates the minimum quality. A value of zero selects a compression specific default value. For a single image the value of this property can be overwritten using the ImageExportCompressionQuality property.

txImageMaxResolution (14)

Sets the maximum resolution for all images in the document in dots per inch when the document is saved. If an image's resolution is larger than this property's value, it is reduced, otherwise it is not changed. If this property's value is zero, which is the default value, the default resolution of each image is used. For a single image the value of this property can be overwritten using the ImageExportMaxResolution property.

txLoadMSWordFields (15)

MS Word and RTF only. Converts MS Word fields into marked text fields of the type txFieldMSWord. The FieldTypeData property can be used to get the field's data.

txLoadHighEditFields (16)

MS Word and RTF only. Converts Heiler HighEdit fields into marked text fields of the type txFieldHighEdit. The FieldTypeData property can be used to get the field's data.

txMSWordFieldTypeNames (17)

Specifies a character string specifying the types of MS Word fields to be loaded. This attribute is only used when the txLoadMSWordFields attribute is set to true. The string can contain several type names that must be separated with tab (09) characters. When a document is saved, this attribute is not used.

txImageSaveMode (18)

Determines whether the document's images are stored through its data or through its file reference. By default images are stored through a file reference, when a file reference exists. Otherwise, if an image has been pasted from the clipboard, it is stored with its binary data. For a single image the value of this attribute can be overwritten with the ImageSaveMode property. It can be one of the following values:


Code Meaning
0 - Auto An image is saved with a file reference, when a file reference exists. Otherwise it is saved with its binary data.
1 - SaveAsData The document's images are saved with their binary data.
2 - SaveAsFileReference The document's images are saved through file references. For images without a corresponding file a new file is created.
txImageExportFormat (19)

Sets the format used for saving all images contained in the document. The attribute's value is is the number of the filter in the string returned through the ImageExportFilters property, beginning with number one. For a single image the value of this attribute can be overwritten with the ImageExportFormat property.

txCertificateFileName (20)

Specifies the name of a certificate file containing a X.509 certificate. This certificate can be used to digitally sign a PDF or a PDF/A file. For other formats this property has no meaning. When the certificate file contains a private key, a password must be specified with the txCertificatePassword attribute to decrypt the private key.

txCertificatePassword (21)

Specifies the password to decrypt the private key of a certificate file. A certificate file can be specified with the txCertificateFileName attribute. When a file name is not specified, this attribute has no meaning.

txTimeServerURL (22)

Specifies the URL of a time server which is used to get a time stamp for a certification. If this attribute is not specified, the current date and time on the computer is used. When a certificate file is not specified with the txCertificateFileName attribute, this attribute has no meaning.

txDocumentLevelJavaScriptActions (23)

Specifies a character string containing Javascript. The string can contain several scripts which must be separated with 01 control characters. The scripts are embedded in a PDF document at document level and they are executed, when the PDF document is opened. When the document is saved as PDF/A the scripts are not embedded.

txAbsPath (28)

Specifies a character string that is used to search for resources like images or destinations of hypertext links. When a document is loaded, this path is used to locate a resource. It is only used for resources which are specified through an absolute location. In this case the absolute resource location is completely replaced through the path specified through this property. When a document is saved, this attribute is not used.

txBasePath (29)

Specifies a character string that is used to search for resources given through a relative location. When a document is loaded, this path is added to the relative location of a resource. When a document is saved the string can only be a file path. All files in the document are saved relative to this path.

txBaseFontSize (30)

HTML only. Specifies a base font size in points and is used to convert percentage font sizes to absolute font sizes. When not set, a value of 10 points is used. This attribute is only used when a document is loaded.

txPropFontName (31)

HTML only. Defines a proportional font name when not specified in the document. When not set, Text Control uses a default font. This attribute is only used when a document is loaded.

txMonoFontName (32)

HTML only. Defines a mono-spaced font name when not specified in the document. When not set, Text Control uses a default mono-spaced font. This attribute is only used when a document is loaded.

txTextColor (33)

HTML only. Defines a text color. This attribute is only used when a document is loaded. When the txOverwriteTextColor attribute is set to True, this color is used for text coloring. Otherwise when not set to overwrite, this color is only used when no text color is specified in the document.

txOverwriteTextColor (34)

HTML only. Sets the txTextColor attribute to overwrite or not to overwrite.

txTextBkColor (35)

HTML only. Defines a text background color. This attribute is only used when a document is loaded. When the txOverwriteTextBkColor attribute is set to True, this color is used for text background coloring. Otherwise, when not set to overwrite, this color is only used when no text background color is specified in the document.

txOverwriteTextBkColor (36)

HTML only. Sets the txTextBkColor attribute to overwrite or not to overwrite.

txLoadImages (37)

HTML only. Specifies whether or not images are loaded. When not set, images are replaced by its alternate text or a special link text. For all other formats images are always loaded.

txEnableLinks (38)

HTML, RTF and Word only. Converts source and target fields of hypertext links to appropriate marked text fields.

txEnableHighlights (39)

RTF only. Converts all '\cbN' keywords into marked text fields of the type txFieldHighlight.

txEnableTopics (40)

RTF only. Converts all '\sect' keywords into marked text fields of the type txFieldTopic.

txAuthor (41)

Loads or saves the author of the document. After a document has been loaded, this property returns the author contained in the document, or an empty string if the document does not contain an author.

txCreationDate (42)

Loads or saves the creation date of the document. After a document has been loaded, this property returns the creation date contained in the document, or midnight, 30 December 1899, if the document does not contain a creation date. The time must be an UTC time (Coordinated Universal Time).

txDocKeywords (43)

Loads or saves the keywords contained in the document. The string can contain several keywords which must be separated with 09 (TAB) control characters. After a document has been loaded, this property returns the keywords contained in the document, or an empty string, if the document does not contain keywords.

txLastModificationDate (44)

Loads or saves the date of last modification. After a document has been loaded, this property returns the date of last modification contained in the document, or midnight, 30 December 1899, if the document does not contain such a date. The time must be an UTC time (Coordinated Universal Time).

txDocSubject (45)

Loads or saves the subject of the document. After a document has been loaded, this property returns the subject contained in the document, or an empty string if the document does not contain a subject.

txCreatorApplication (46)

Loads or saves the creator application of the document. After a document has been loaded, this property returns the creator application contained in the document, or an empty string if the document does not contain a creator application.

txLinkColor (50)

HTML only. Defines a text color for pieces of text which function as hypertext links. This attribute is only used when a document is loaded. When the txOverwriteLinkColor attribute is set to True, this color is used to color hypertext links. Otherwise when not set to overwrite, this color is only used when no color for links is specified in the document.

txOverwriteLinkColor (51)

HTML only. Sets the txLinkColor attribute to overwrite or not to overwrite.

txUnderlineLinks (52)

HTML only. Specifies whether or not hypertext links are underlined. This attribute is only used when a document is loaded. When set to False, hypertext links are only underlined when specified in the document.

Data Types

txDocWidth Long
txDocHeight Long
txDocLeftMargin Long
txDocTopMargin Long
txDocRightMargin Long
txDocBottomMargin Long
txDocTitle String
txDocBkColor Long
txCSSFile String
txCSSSaveMode Integer
txDocAccessPermissions Long
txMasterPassword String
txUserPassword String
txImageCompressionQuality Integer
txImageMaxResolution Integer
txLoadMSWordFields Boolean
txLoadHighEditFields Boolean
txMSWordFieldTypeNames String
txImageSaveMode Integer
txImageExportFormat Integer
txCertificateFileName String
txCertificatePassword String
txTimeServerURL String
txDocumentLevelJavaScriptActions String
txAbsPath String
txBasePath String
txBaseFontSize Integer
txPropFontName String
txMonoFontName String
txTextColor Long
txOverwriteTextColor Boolean
txTextBkColor Long
txOverwriteTextBkColor Boolean
txLoadImages Boolean
txEnableLinks Boolean
txEnableHighlights Boolean
txEnableTopics Boolean
txAuthor String
txCreationDate Date
txDocKeywords String
txLastModificationDate Date
txDocSubject String
txCreatorApplication String
txLinkColor Long
txOverwriteLinkColor Boolean
txUnderlineLinks Boolean

Limitations

Run time only.

See Also