Allows to specify additional options (such as password or base URI) when loading a document into a Document object.
Shows how to load an encrypted Microsoft Word document.
#include <Aspose.Words.Cpp/Loading/LoadOptions.h>
Public Member Functions | |
LoadOptions () | |
Initializes a new instance of this class with default values. More... | |
LoadOptions (LoadFormat loadFormat, const String &password, const String &baseUri) | |
A shortcut to initialize a new instance of this class with properties set to the specified values. More... | |
LoadOptions (const String &password) | |
A shortcut to initialize a new instance of this class with the specified password to load an encrypted document. More... | |
String | get_BaseUri () const |
Gets or sets the string that will be used to resolve relative URIs found in the document into absolute URIs when required. Can be null or empty string. Default is null. More... | |
bool | get_ConvertMetafilesToPng () const |
Gets or sets whether to convert metafile (Wmf or Emf) images to Png image format. More... | |
bool | get_ConvertShapeToOfficeMath () const |
Gets or sets whether to convert shapes with EquationXML to Office Math objects. More... | |
SharedPtr< Encoding > | get_Encoding () const |
Gets or sets the encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. Can be null. Default is null. More... | |
bool | get_FlatOpcXmlMappingOnly () const |
Gets value determining which document formats are allowed to be mapped by XmlMapping. By default only FlatOpc document format is allowed to be mapped. More... | |
SharedPtr< FontSettings > | get_FontSettings () const |
Allows to specify document font settings. More... | |
SharedPtr< LanguagePreferences > | get_LanguagePreferences () const |
Gets language preferences that will be used when document is loading. More... | |
LoadFormat | get_LoadFormat () const |
Specifies the format of the document to be loaded. Default is Auto. More... | |
MsWordVersion | get_MswVersion () const |
Allows to specify that the document loading process should match a specific MS Word version. Default value is Word2019 More... | |
String | get_Password () const |
Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null. More... | |
bool | get_PreserveIncludePictureField () const |
Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false. More... | |
SharedPtr< IDocumentLoadingCallback > | get_ProgressCallback () const |
Called during loading a document and accepts data about loading progress. More... | |
SharedPtr< IResourceLoadingCallback > | get_ResourceLoadingCallback () const |
Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. More... | |
String | get_TempFolder () const |
Allows to use temporary files when reading document. By default this property is null and no temporary files are used. More... | |
bool | get_UpdateDirtyFields () const |
Specifies whether to update the fields with the dirty attribute. More... | |
SharedPtr< IWarningCallback > | get_WarningCallback () const |
Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. More... | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
void | set_BaseUri (const String &value) |
Setter for get_BaseUri. More... | |
void | set_ConvertMetafilesToPng (bool value) |
Setter for get_ConvertMetafilesToPng. More... | |
void | set_ConvertShapeToOfficeMath (bool value) |
Setter for get_ConvertShapeToOfficeMath. More... | |
void | set_Encoding (const SharedPtr< Encoding > &value) |
Setter for get_Encoding. More... | |
void | set_FlatOpcXmlMappingOnly (bool value) |
Sets value determining which document formats are allowed to be mapped by XmlMapping. By default only FlatOpc document format is allowed to be mapped. More... | |
void | set_FontSettings (const SharedPtr< FontSettings > &value) |
Setter for get_FontSettings. More... | |
void | set_LoadFormat (LoadFormat value) |
Setter for get_LoadFormat. More... | |
void | set_MswVersion (MsWordVersion value) |
Setter for get_MswVersion. More... | |
void | set_Password (const String &value) |
Setter for get_Password. More... | |
void | set_PreserveIncludePictureField (bool value) |
Setter for get_PreserveIncludePictureField. More... | |
void | set_ProgressCallback (const SharedPtr< IDocumentLoadingCallback > &value) |
Called during loading a document and accepts data about loading progress. More... | |
void | set_ResourceLoadingCallback (const SharedPtr< IResourceLoadingCallback > &value) |
Setter for get_ResourceLoadingCallback. More... | |
void | set_TempFolder (const String &value) |
Setter for get_TempFolder. More... | |
void | set_UpdateDirtyFields (bool value) |
Setter for get_UpdateDirtyFields. More... | |
void | set_WarningCallback (const SharedPtr< IWarningCallback > &value) |
Setter for get_WarningCallback. More... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
Aspose::Words::Loading::LoadOptions::LoadOptions | ( | ) |
Initializes a new instance of this class with default values.
Shows how to open an HTML document with images from a stream using a base URI.
Aspose::Words::Loading::LoadOptions::LoadOptions | ( | const System::String & | password | ) |
A shortcut to initialize a new instance of this class with the specified password to load an encrypted document.
password | The password to open an encrypted document. Can be null or empty string. |
Shows how to load an encrypted Microsoft Word document.
Aspose::Words::Loading::LoadOptions::LoadOptions | ( | Aspose::Words::LoadFormat | loadFormat, |
const System::String & | password, | ||
const System::String & | baseUri | ||
) |
A shortcut to initialize a new instance of this class with properties set to the specified values.
loadFormat | The format of the document to be loaded. |
password | The password to open an encrypted document. Can be null or empty string. |
baseUri | The string that will be used to resolve relative URIs to absolute. Can be null or empty string. |
Shows how save a web page as a .docx file.
Shows how to specify a base URI when opening an html document.
System::String Aspose::Words::Loading::LoadOptions::get_BaseUri | ( | ) | const |
Gets or sets the string that will be used to resolve relative URIs found in the document into absolute URIs when required. Can be null or empty string. Default is null.
This property is used to resolve relative URIs into absolute in the following cases:
Shows how to open an HTML document with images from a stream using a base URI.
bool Aspose::Words::Loading::LoadOptions::get_ConvertMetafilesToPng | ( | ) | const |
Gets or sets whether to convert metafile (Wmf or Emf) images to Png image format.
Shows how to convert WMF/EMF to PNG during loading document.
bool Aspose::Words::Loading::LoadOptions::get_ConvertShapeToOfficeMath | ( | ) | const |
Gets or sets whether to convert shapes with EquationXML to Office Math objects.
Shows how to convert EquationXML shapes to Office Math objects.
System::SharedPtr<System::Text::Encoding> Aspose::Words::Loading::LoadOptions::get_Encoding | ( | ) | const |
Gets or sets the encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. Can be null. Default is null.
This property is used only when loading HTML, TXT, or CHM documents.
If encoding is not specified inside the document and this property is null
, then the system will try to automatically detect the encoding.
Shows how to set the encoding with which to open a document.
bool Aspose::Words::Loading::LoadOptions::get_FlatOpcXmlMappingOnly | ( | ) | const |
Gets value determining which document formats are allowed to be mapped by XmlMapping. By default only FlatOpc document format is allowed to be mapped.
System::SharedPtr<Aspose::Words::Fonts::FontSettings> Aspose::Words::Loading::LoadOptions::get_FontSettings | ( | ) | const |
Allows to specify document font settings.
When loading some formats, Aspose.Words may require to resolve the fonts. For example, when loading HTML documents Aspose.Words may resolve the fonts to perform font fallback.
If set to null, default static font settings DefaultInstance will be used.
The default value is null.
Shows how to designate font substitutes during loading.
Shows how to apply font substitution settings while loading a document.
System::SharedPtr<Aspose::Words::Loading::LanguagePreferences> Aspose::Words::Loading::LoadOptions::get_LanguagePreferences | ( | ) | const |
Gets language preferences that will be used when document is loading.
Shows how to apply language preferences when loading a document.
Aspose::Words::LoadFormat Aspose::Words::Loading::LoadOptions::get_LoadFormat | ( | ) | const |
Specifies the format of the document to be loaded. Default is Auto.
It is recommended that you specify the Auto value and let Aspose.Words detect the file format automatically. If you know the format of the document you are about to load, you can specify the format explicitly and this will slightly reduce the loading time by the overhead associated with auto detecting the format. If you specify an explicit load format and it will turn out to be wrong, the auto detection will be invoked and a second attempt to load the file will be made.
Shows how to specify a base URI when opening an html document.
Aspose::Words::Settings::MsWordVersion Aspose::Words::Loading::LoadOptions::get_MswVersion | ( | ) | const |
Allows to specify that the document loading process should match a specific MS Word version. Default value is Word2019
Shows how to emulate the loading procedure of a specific Microsoft Word version during document loading.
System::String Aspose::Words::Loading::LoadOptions::get_Password | ( | ) | const |
Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null.
You need to know the password to open an encrypted document. If the document is not encrypted, set this to null or empty string.
Shows how to sign encrypted document file.
bool Aspose::Words::Loading::LoadOptions::get_PreserveIncludePictureField | ( | ) | const |
Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false.
By default, the INCLUDEPICTURE field is converted into a shape object. You can override that if you need the field to be preserved, for example, if you wish to update it programmatically. Note however that this approach is not common for Aspose.Words. Use it on your own risk.
One of the possible use cases may be using a MERGEFIELD as a child field to dynamically change the source path of the picture. In this case you need the INCLUDEPICTURE to be preserved in the model.
Shows how to preserve or discard INCLUDEPICTURE fields when loading a document.
System::SharedPtr<Aspose::Words::Loading::IDocumentLoadingCallback> Aspose::Words::Loading::LoadOptions::get_ProgressCallback | ( | ) | const |
System::SharedPtr<Aspose::Words::Loading::IResourceLoadingCallback> Aspose::Words::Loading::LoadOptions::get_ResourceLoadingCallback | ( | ) | const |
Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.
Shows how to handle external resources when loading Html documents.
System::String Aspose::Words::Loading::LoadOptions::get_TempFolder | ( | ) | const |
Allows to use temporary files when reading document. By default this property is null
and no temporary files are used.
The folder must exist and be writable, otherwise an exception will be thrown.
Aspose.Words automatically deletes all temporary files when reading is complete.
Shows how to load a document using temporary files.
Shows how to use the hard drive instead of memory when loading a document.
bool Aspose::Words::Loading::LoadOptions::get_UpdateDirtyFields | ( | ) | const |
Specifies whether to update the fields with the dirty
attribute.
Shows how to use special property for updating field result.
System::SharedPtr<Aspose::Words::IWarningCallback> Aspose::Words::Loading::LoadOptions::get_WarningCallback | ( | ) | const |
Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss.
Shows how to print and store warnings that occur during document loading.
|
overridevirtual |
|
overridevirtual |
void Aspose::Words::Loading::LoadOptions::set_BaseUri | ( | const System::String & | value | ) |
Setter for Aspose::Words::Loading::LoadOptions::get_BaseUri.
void Aspose::Words::Loading::LoadOptions::set_ConvertMetafilesToPng | ( | bool | value | ) |
void Aspose::Words::Loading::LoadOptions::set_ConvertShapeToOfficeMath | ( | bool | value | ) |
void Aspose::Words::Loading::LoadOptions::set_Encoding | ( | const System::SharedPtr< System::Text::Encoding > & | value | ) |
void Aspose::Words::Loading::LoadOptions::set_FlatOpcXmlMappingOnly | ( | bool | value | ) |
Sets value determining which document formats are allowed to be mapped by XmlMapping. By default only FlatOpc document format is allowed to be mapped.
void Aspose::Words::Loading::LoadOptions::set_FontSettings | ( | const System::SharedPtr< Aspose::Words::Fonts::FontSettings > & | value | ) |
void Aspose::Words::Loading::LoadOptions::set_LoadFormat | ( | Aspose::Words::LoadFormat | value | ) |
void Aspose::Words::Loading::LoadOptions::set_MswVersion | ( | Aspose::Words::Settings::MsWordVersion | value | ) |
void Aspose::Words::Loading::LoadOptions::set_Password | ( | const System::String & | value | ) |
void Aspose::Words::Loading::LoadOptions::set_PreserveIncludePictureField | ( | bool | value | ) |
void Aspose::Words::Loading::LoadOptions::set_ProgressCallback | ( | const System::SharedPtr< Aspose::Words::Loading::IDocumentLoadingCallback > & | value | ) |
void Aspose::Words::Loading::LoadOptions::set_ResourceLoadingCallback | ( | const System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > & | value | ) |
void Aspose::Words::Loading::LoadOptions::set_TempFolder | ( | const System::String & | value | ) |
void Aspose::Words::Loading::LoadOptions::set_UpdateDirtyFields | ( | bool | value | ) |
void Aspose::Words::Loading::LoadOptions::set_WarningCallback | ( | const System::SharedPtr< Aspose::Words::IWarningCallback > & | value | ) |
|
static |