Aspose::Words::LoadOptions Class Reference

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

#include "Aspose.Words.Cpp/Model/Document/LoadOptions.h"

Inherits System::Object.

Inherited by Aspose::Words::HtmlLoadOptions, Aspose::Words::RtfLoadOptions, and Aspose::Words::TxtLoadOptions.

Public Member Functions

Aspose::Words::LoadFormat get_LoadFormat () const
 Specifies the format of the document to be loaded. Default is Aspose::Words::LoadFormat::Auto. More...
 
void set_LoadFormat (Aspose::Words::LoadFormat value)
 Setter for Aspose::Words::LoadOptions::get_LoadFormat. More...
 
System::String get_Password () const
 Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null. More...
 
void set_Password (System::String value)
 Setter for Aspose::Words::LoadOptions::get_Password. More...
 
System::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...
 
void set_BaseUri (System::String value)
 Setter for Aspose::Words::LoadOptions::get_BaseUri. More...
 
System::SharedPtr< System::Text::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...
 
void set_Encoding (System::SharedPtr< System::Text::Encoding > value)
 Setter for Aspose::Words::LoadOptions::get_Encoding. More...
 
System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > get_ResourceLoadingCallback () const
 Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. More...
 
void set_ResourceLoadingCallback (System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > value)
 Setter for Aspose::Words::LoadOptions::get_ResourceLoadingCallback. More...
 
System::SharedPtr< Aspose::Words::IWarningCallback > get_WarningCallback () const
 Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. More...
 
void set_WarningCallback (System::SharedPtr< Aspose::Words::IWarningCallback > value)
 Setter for Aspose::Words::LoadOptions::get_WarningCallback. 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...
 
void set_PreserveIncludePictureField (bool value)
 Setter for Aspose::Words::LoadOptions::get_PreserveIncludePictureField. More...
 
bool get_ConvertShapeToOfficeMath () const
 Gets or sets whether to convert shapes with EquationXML to Office Math objects. More...
 
void set_ConvertShapeToOfficeMath (bool value)
 Setter for Aspose::Words::LoadOptions::get_ConvertShapeToOfficeMath. More...
 
System::SharedPtr< Aspose::Words::Fonts::FontSettingsget_FontSettings () const
 Allows to specify document font settings. More...
 
void set_FontSettings (System::SharedPtr< Aspose::Words::Fonts::FontSettings > value)
 Setter for Aspose::Words::LoadOptions::get_FontSettings. More...
 
bool get_AnnotationsAtBlockLevel () const
 Gets or sets a flag indicating whether cross structure annotation nodes can be added at block/cell/row level. More...
 
void set_AnnotationsAtBlockLevel (bool value)
 Setter for Aspose::Words::LoadOptions::get_AnnotationsAtBlockLevel. More...
 
Aspose::Words::Settings::MsWordVersion get_MswVersion () const
 Allows to specify that the document loading process should match a specific MS Word version. Default value is Aspose::Words::Settings::MsWordVersion::Word2007 More...
 
void set_MswVersion (Aspose::Words::Settings::MsWordVersion value)
 Setter for Aspose::Words::LoadOptions::get_MswVersion. More...
 
bool get_UpdateDirtyFields () const
 Specifies whether to update the fields with the dirty attribute. More...
 
void set_UpdateDirtyFields (bool value)
 Setter for Aspose::Words::LoadOptions::get_UpdateDirtyFields. More...
 
System::SharedPtr< Aspose::Words::LanguagePreferencesget_LanguagePreferences () const
 Gets language preferences that will be used when document is loading. More...
 
 LoadOptions ()
 Initializes a new instance of this class with default values. More...
 
 LoadOptions (System::String password)
 A shortcut to initialize a new instance of this class with the specified password to load an encrypted document. More...
 
 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. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 

Static Public Member Functions

static bool get_AnnotationsAtBlockLevelAsDefault ()
 Gets or sets a default value for the Aspose::Words::LoadOptions::get_AnnotationsAtBlockLevel property. More...
 
static void set_AnnotationsAtBlockLevelAsDefault (bool value)
 Setter for Aspose::Words::LoadOptions::get_AnnotationsAtBlockLevelAsDefault. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Detailed Description

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

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_AnnotationsAtBlockLevel()

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

Gets or sets a flag indicating whether cross structure annotation nodes can be added at block/cell/row level.

◆ get_AnnotationsAtBlockLevelAsDefault()

static bool Aspose::Words::LoadOptions::get_AnnotationsAtBlockLevelAsDefault ( )
static

Gets or sets a default value for the Aspose::Words::LoadOptions::get_AnnotationsAtBlockLevel property.

Allows defining necessary behavior when an instance of Aspose::Words::LoadOptions is not specified on opening a document.

◆ 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 or sets 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 Aspose::Words::Fonts::FontSettings::get_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 Aspose::Words::LoadFormat::Auto.

It is recommended that you specify the Aspose::Words::LoadFormat::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 Aspose::Words::Settings::MsWordVersion::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_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_AnnotationsAtBlockLevel()

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

◆ set_AnnotationsAtBlockLevelAsDefault()

static void Aspose::Words::LoadOptions::set_AnnotationsAtBlockLevelAsDefault ( bool  value)
static

◆ set_BaseUri()

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

◆ set_ConvertShapeToOfficeMath()

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

◆ 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)

◆ set_UpdateDirtyFields()

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

◆ set_WarningCallback()

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