Aspose::Words::LoadOptions Class Reference

Detailed Description

Allows to specify additional options (such as password or base URI) when loading a document into a Document object.

#include <Aspose.Words.Cpp/Model/Document/LoadOptions.h>

+ Inheritance diagram for Aspose::Words::LoadOptions:

Public Member Functions

 LoadOptions ()
 Initializes a new instance of this class with default values. More...
 
 LoadOptions (LoadFormat loadFormat, String password, String baseUri)
 A shortcut to initialize a new instance of this class with properties set to the specified values. More...
 
 LoadOptions (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_ConvertShapeToOfficeMath () const
 Gets whether to convert shapes with EquationXML to Office Math objects. More...
 
SharedPtr< Encodingget_Encoding () const
 Gets or sets the encoding that will be used to load an HTML or TXT document if the encoding is not specified in HTML/TXT. Can be null. Default is null. More...
 
SharedPtr< FontSettingsget_FontSettings () const
 Allows to specify document font settings. More...
 
SharedPtr< LanguagePreferencesget_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 Word2007 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< IResourceLoadingCallbackget_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< IWarningCallbackget_WarningCallback () const
 Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. More...
 
void set_BaseUri (String value)
 Setter for get_BaseUri. More...
 
void set_ConvertShapeToOfficeMath (bool value)
 Sets whether to convert shapes with EquationXML to Office Math objects. More...
 
void set_Encoding (SharedPtr< Encoding > value)
 Setter for get_Encoding. More...
 
void set_FontSettings (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 (String value)
 Setter for get_Password. More...
 
void set_PreserveIncludePictureField (bool value)
 Setter for get_PreserveIncludePictureField. More...
 
void set_ResourceLoadingCallback (SharedPtr< IResourceLoadingCallback > value)
 Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. More...
 
void set_TempFolder (String value)
 Setter for get_TempFolder. More...
 
void set_UpdateDirtyFields (bool value)
 Specifies whether to update the fields with the dirty attribute. More...
 
void set_WarningCallback (SharedPtr< IWarningCallback > value)
 Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. More...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Constructor & Destructor Documentation

◆ LoadOptions() [1/3]

Aspose::Words::LoadOptions::LoadOptions ( )

Initializes a new instance of this class with default values.

◆ LoadOptions() [2/3]

Aspose::Words::LoadOptions::LoadOptions ( System::String  password)

A shortcut to initialize a new instance of this class with the specified password to load an encrypted document.

Parameters
passwordThe password to open an encrypted document. Can be null or empty string.

◆ LoadOptions() [3/3]

Aspose::Words::LoadOptions::LoadOptions ( Aspose::Words::LoadFormat  loadFormat,
System::String  password,
System::String  baseUri 
)

A shortcut to initialize a new instance of this class with properties set to the specified values.

Parameters
loadFormatThe format of the document to be loaded.
passwordThe password to open an encrypted document. Can be null or empty string.
baseUriThe string that will be used to resolve relative URIs to absolute. Can be null or empty string.

Member Function Documentation

◆ get_BaseUri()

System::String Aspose::Words::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:

  1. When loading an HTML document from a stream and the document contains images with relative URIs and does not have a base URI specified in the BASE HTML element.
  2. When saving a document to PDF and other formats, to retrieve images linked using relative URIs so the images can be saved into the output document.

◆ get_ConvertShapeToOfficeMath()

bool Aspose::Words::LoadOptions::get_ConvertShapeToOfficeMath ( ) const

Gets whether to convert shapes with EquationXML to Office Math objects.

◆ get_Encoding()

System::SharedPtr<System::Text::Encoding> Aspose::Words::LoadOptions::get_Encoding ( ) const

Gets or sets the encoding that will be used to load an HTML or TXT document if the encoding is not specified in HTML/TXT. Can be null. Default is null.

This property is used only when loading HTML or TXT documents.

If encoding is not specified in HTML/TXT and this property is null, then the system will try to automatically detect the encoding.

◆ get_FontSettings()

System::SharedPtr<Aspose::Words::Fonts::FontSettings> Aspose::Words::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.

◆ get_LanguagePreferences()

System::SharedPtr<Aspose::Words::LanguagePreferences> Aspose::Words::LoadOptions::get_LanguagePreferences ( ) const

Gets language preferences that will be used when document is loading.

◆ get_LoadFormat()

Aspose::Words::LoadFormat Aspose::Words::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.

◆ get_MswVersion()

Aspose::Words::Settings::MsWordVersion Aspose::Words::LoadOptions::get_MswVersion ( ) const

Allows to specify that the document loading process should match a specific MS Word version. Default value is Word2007

Different Word versions may handle certain aspects of document content and formatting slightly differently during the loading process, which may result in minor differences in Document Object Model.

◆ get_Password()

System::String Aspose::Words::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.

◆ get_PreserveIncludePictureField()

bool Aspose::Words::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.

◆ get_ResourceLoadingCallback()

System::SharedPtr<Aspose::Words::Loading::IResourceLoadingCallback> Aspose::Words::LoadOptions::get_ResourceLoadingCallback ( ) const

Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.

◆ get_TempFolder()

System::String Aspose::Words::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.

◆ get_UpdateDirtyFields()

bool Aspose::Words::LoadOptions::get_UpdateDirtyFields ( ) const

Specifies whether to update the fields with the dirty attribute.

◆ get_WarningCallback()

System::SharedPtr<Aspose::Words::IWarningCallback> Aspose::Words::LoadOptions::get_WarningCallback ( ) const

Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss.

◆ set_BaseUri()

void Aspose::Words::LoadOptions::set_BaseUri ( System::String  value)

◆ set_ConvertShapeToOfficeMath()

void Aspose::Words::LoadOptions::set_ConvertShapeToOfficeMath ( bool  value)

Sets whether to convert shapes with EquationXML to Office Math objects.

◆ set_Encoding()

void Aspose::Words::LoadOptions::set_Encoding ( System::SharedPtr< System::Text::Encoding value)

◆ set_FontSettings()

void Aspose::Words::LoadOptions::set_FontSettings ( System::SharedPtr< Aspose::Words::Fonts::FontSettings value)

◆ set_LoadFormat()

void Aspose::Words::LoadOptions::set_LoadFormat ( Aspose::Words::LoadFormat  value)

◆ set_MswVersion()

void Aspose::Words::LoadOptions::set_MswVersion ( Aspose::Words::Settings::MsWordVersion  value)

◆ set_Password()

void Aspose::Words::LoadOptions::set_Password ( System::String  value)

◆ set_PreserveIncludePictureField()

void Aspose::Words::LoadOptions::set_PreserveIncludePictureField ( bool  value)

◆ set_ResourceLoadingCallback()

void Aspose::Words::LoadOptions::set_ResourceLoadingCallback ( System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback value)

Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.

◆ set_TempFolder()

void Aspose::Words::LoadOptions::set_TempFolder ( System::String  value)

◆ set_UpdateDirtyFields()

void Aspose::Words::LoadOptions::set_UpdateDirtyFields ( bool  value)

Specifies whether to update the fields with the dirty attribute.

◆ set_WarningCallback()

void Aspose::Words::LoadOptions::set_WarningCallback ( System::SharedPtr< Aspose::Words::IWarningCallback value)

Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss.