diff --git a/english/cpp/aspose.words.ai/_index.md b/english/cpp/aspose.words.ai/_index.md index 4597c456658..17410128522 100644 --- a/english/cpp/aspose.words.ai/_index.md +++ b/english/cpp/aspose.words.ai/_index.md @@ -14,7 +14,7 @@ The **Aspose.Words.AI** namespace enables seamless integration with large langua | Class | Description | | --- | --- | -| [AiModel](./aimodel/) | Represents information about a Generative Language Model. | +| [AiModel](./aimodel/) | An abstract class representing the integration with various [AI](./) models within the [Aspose.Words](../aspose.words/). | | [AnthropicAiModel](./anthropicaimodel/) | An abstract class representing the integration with Anthropic’s [AI](./) models within the [Aspose.Words](../aspose.words/). | | [CheckGrammarOptions](./checkgrammaroptions/) | Allows to specify various options while checking grammar of a document using [AI](./). | | [GoogleAiModel](./googleaimodel/) | An abstract class representing the integration with Google’s [AI](./) models within the [Aspose.Words](../aspose.words/). | diff --git a/english/cpp/aspose.words.ai/aimodel/_index.md b/english/cpp/aspose.words.ai/aimodel/_index.md index 5dbbf533357..693d0b650a9 100644 --- a/english/cpp/aspose.words.ai/aimodel/_index.md +++ b/english/cpp/aspose.words.ai/aimodel/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::AI::AiModel class linktitle: AiModel second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::AI::AiModel class. Represents information about a Generative Language Model in C++.' +description: 'Aspose::Words::AI::AiModel class. An abstract class representing the integration with various AI models within the Aspose.Words in C++.' type: docs weight: 1000 url: /cpp/aspose.words.ai/aimodel/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.ai/aimodel/ ## AiModel class -Represents information about a Generative Language Model. +An abstract class representing the integration with various [AI](../) models within the [Aspose.Words](../../aspose.words/). ```cpp class AiModel : public virtual System::Object @@ -20,9 +20,13 @@ class AiModel : public virtual System::Object | Method | Description | | --- | --- | +| virtual [CheckGrammar](./checkgrammar/)(System::SharedPtr\, System::SharedPtr\) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. | | static [Create](./create/)(Aspose::Words::AI::AiModelType) | Creates a new instance of [AiModel](./) class. | | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | +| virtual [Summarize](./summarize/)(System::SharedPtr\, System::SharedPtr\) | Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../) model for content processing. | +| virtual [Summarize](./summarize/)(System::ArrayPtr\\>, System::SharedPtr\) | Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../) model for processing each document in the array. | +| virtual [Translate](./translate/)(System::SharedPtr\, Aspose::Words::AI::Language) | Translates the provided document into the specified target language. This operation leverages the connected [AI](../) model for content translating. | | static [Type](./type/)() | | | [WithApiKey](./withapikey/)(const System::String\&) | Sets a specified API key to the model. | @@ -37,7 +41,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/iaimodeltext/checkgrammar/_index.md b/english/cpp/aspose.words.ai/aimodel/checkgrammar/_index.md similarity index 65% rename from english/cpp/aspose.words.ai/iaimodeltext/checkgrammar/_index.md rename to english/cpp/aspose.words.ai/aimodel/checkgrammar/_index.md index 9fe7948699c..edba1449e6a 100644 --- a/english/cpp/aspose.words.ai/iaimodeltext/checkgrammar/_index.md +++ b/english/cpp/aspose.words.ai/aimodel/checkgrammar/_index.md @@ -1,19 +1,19 @@ --- -title: Aspose::Words::AI::IAiModelText::CheckGrammar method +title: Aspose::Words::AI::AiModel::CheckGrammar method linktitle: CheckGrammar second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::AI::IAiModelText::CheckGrammar method. Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document in C++.' +description: 'Aspose::Words::AI::AiModel::CheckGrammar method. Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document in C++.' type: docs -weight: 1500 -url: /cpp/aspose.words.ai/iaimodeltext/checkgrammar/ +weight: 2500 +url: /cpp/aspose.words.ai/aimodel/checkgrammar/ --- -## IAiModelText::CheckGrammar method +## AiModel::CheckGrammar method Checks grammar of the provided document. This operation leverages the connected [AI](../../) model for checking grammar of document. ```cpp -virtual System::SharedPtr Aspose::Words::AI::IAiModelText::CheckGrammar(System::SharedPtr sourceDocument, System::SharedPtr options)=0 +virtual System::SharedPtr Aspose::Words::AI::AiModel::CheckGrammar(System::SharedPtr sourceDocument, System::SharedPtr options=nullptr) ``` @@ -36,7 +36,7 @@ auto doc = System::MakeObject(get_MyDir() + u"Big docum System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI generative language models. -System::SharedPtr model = System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)); +System::SharedPtr model = Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey); auto grammarOptions = System::MakeObject(); grammarOptions->set_ImproveStylistics(true); @@ -49,6 +49,6 @@ proofedDoc->Save(get_ArtifactsDir() + u"AI.AiGrammar.docx"); * Class [Document](../../../aspose.words/document/) * Class [CheckGrammarOptions](../../checkgrammaroptions/) -* Interface [IAiModelText](../) +* Class [AiModel](../) * Namespace [Aspose::Words::AI](../../) * Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/aimodel/create/_index.md b/english/cpp/aspose.words.ai/aimodel/create/_index.md index e36d083c6d1..a5abe1c50e1 100644 --- a/english/cpp/aspose.words.ai/aimodel/create/_index.md +++ b/english/cpp/aspose.words.ai/aimodel/create/_index.md @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/aimodel/summarize/_index.md b/english/cpp/aspose.words.ai/aimodel/summarize/_index.md new file mode 100644 index 00000000000..f98f87a788e --- /dev/null +++ b/english/cpp/aspose.words.ai/aimodel/summarize/_index.md @@ -0,0 +1,109 @@ +--- +title: Aspose::Words::AI::AiModel::Summarize method +linktitle: Summarize +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::AiModel::Summarize method. Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array in C++.' +type: docs +weight: 4334 +url: /cpp/aspose.words.ai/aimodel/summarize/ +--- +## AiModel::Summarize(System::ArrayPtr\\>, System::SharedPtr\) method + + +Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../../) model for processing each document in the array. + +```cpp +virtual System::SharedPtr Aspose::Words::AI::AiModel::Summarize(System::ArrayPtr> sourceDocuments, System::SharedPtr options=nullptr)=0 +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocuments | System::ArrayPtr\\> | An array of documents to be summarized. | +| options | System::SharedPtr\ | Optional settings to control the summary length and other parameters | + +### ReturnValue + +A summarized version of the document's content. + +## Examples + + + +Shows how to summarize text using OpenAI and [Google](../../../aspose.words.ai.google/) models. +```cpp +auto firstDoc = System::MakeObject(get_MyDir() + u"Big document.docx"); +auto secondDoc = System::MakeObject(get_MyDir() + u"Document.docx"); + +System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); +// Use OpenAI or Google generative language models. +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); + +auto options = System::MakeObject(); + +options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short); +System::SharedPtr oneDocumentSummary = model->Summarize(firstDoc, options); +oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx"); + +options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long); +System::SharedPtr multiDocumentSummary = model->Summarize(System::MakeArray>({firstDoc, secondDoc}), options); +multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx"); +``` + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [AiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) +## AiModel::Summarize(System::SharedPtr\, System::SharedPtr\) method + + +Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../../) model for content processing. + +```cpp +virtual System::SharedPtr Aspose::Words::AI::AiModel::Summarize(System::SharedPtr sourceDocument, System::SharedPtr options=nullptr)=0 +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocument | System::SharedPtr\ | The document to be summarized. | +| options | System::SharedPtr\ | Optional settings to control the summary length and other parameters. | + +### ReturnValue + +A summarized version of the document's content. + +## Examples + + + +Shows how to summarize text using OpenAI and [Google](../../../aspose.words.ai.google/) models. +```cpp +auto firstDoc = System::MakeObject(get_MyDir() + u"Big document.docx"); +auto secondDoc = System::MakeObject(get_MyDir() + u"Document.docx"); + +System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); +// Use OpenAI or Google generative language models. +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); + +auto options = System::MakeObject(); + +options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short); +System::SharedPtr oneDocumentSummary = model->Summarize(firstDoc, options); +oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx"); + +options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long); +System::SharedPtr multiDocumentSummary = model->Summarize(System::MakeArray>({firstDoc, secondDoc}), options); +multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx"); +``` + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [AiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/aimodel/translate/_index.md b/english/cpp/aspose.words.ai/aimodel/translate/_index.md new file mode 100644 index 00000000000..eada932bb36 --- /dev/null +++ b/english/cpp/aspose.words.ai/aimodel/translate/_index.md @@ -0,0 +1,51 @@ +--- +title: Aspose::Words::AI::AiModel::Translate method +linktitle: Translate +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::AiModel::Translate method. Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating in C++.' +type: docs +weight: 4667 +url: /cpp/aspose.words.ai/aimodel/translate/ +--- +## AiModel::Translate method + + +Translates the provided document into the specified target language. This operation leverages the connected [AI](../../) model for content translating. + +```cpp +virtual System::SharedPtr Aspose::Words::AI::AiModel::Translate(System::SharedPtr sourceDocument, Aspose::Words::AI::Language targetLanguage)=0 +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocument | System::SharedPtr\ | The document to be translated. | +| targetLanguage | Aspose::Words::AI::Language | The language into which the document will be translated. | + +### ReturnValue + +A new [Document](../../../aspose.words/document/) object containing the translated document. + +## Examples + + + +Shows how to translate text using [Google](../../../aspose.words.ai.google/) models. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Document.docx"); + +System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); +// Use Google generative language models. +System::SharedPtr model = Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gemini15Flash)->WithApiKey(apiKey); + +System::SharedPtr translatedDoc = model->Translate(doc, Aspose::Words::AI::Language::Arabic); +translatedDoc->Save(get_ArtifactsDir() + u"AI.AiTranslate.docx"); +``` + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Enum [Language](../../language/) +* Class [AiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/aimodel/withapikey/_index.md b/english/cpp/aspose.words.ai/aimodel/withapikey/_index.md index 6734c2ac05d..3b1a0645853 100644 --- a/english/cpp/aspose.words.ai/aimodel/withapikey/_index.md +++ b/english/cpp/aspose.words.ai/aimodel/withapikey/_index.md @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/aimodeltype/_index.md b/english/cpp/aspose.words.ai/aimodeltype/_index.md index 09e22733d5b..b9a6164179a 100644 --- a/english/cpp/aspose.words.ai/aimodeltype/_index.md +++ b/english/cpp/aspose.words.ai/aimodeltype/_index.md @@ -45,7 +45,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/anthropicaimodel/_index.md b/english/cpp/aspose.words.ai/anthropicaimodel/_index.md index e2910b6df62..0bab0710f23 100644 --- a/english/cpp/aspose.words.ai/anthropicaimodel/_index.md +++ b/english/cpp/aspose.words.ai/anthropicaimodel/_index.md @@ -21,9 +21,13 @@ class AnthropicAiModel : public Aspose::Words::AI::AiModel, | Method | Description | | --- | --- | +| virtual [CheckGrammar](../aimodel/checkgrammar/)(System::SharedPtr\, System::SharedPtr\) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. | | static [Create](../aimodel/create/)(Aspose::Words::AI::AiModelType) | Creates a new instance of [AiModel](../aimodel/) class. | | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | +| [Summarize](./summarize/)(System::SharedPtr\, System::SharedPtr\) override | Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../) model for content processing. | +| [Summarize](./summarize/)(System::ArrayPtr\\>, System::SharedPtr\) override | Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../) model for processing each document in the array. | +| [Translate](./translate/)(System::SharedPtr\, Aspose::Words::AI::Language) override | Translates the provided document into the specified target language. This operation leverages the connected [AI](../) model for content translating. | | static [Type](./type/)() | | | [WithApiKey](../aimodel/withapikey/)(const System::String\&) | Sets a specified API key to the model. | ## See Also diff --git a/english/cpp/aspose.words.ai/anthropicaimodel/summarize/_index.md b/english/cpp/aspose.words.ai/anthropicaimodel/summarize/_index.md new file mode 100644 index 00000000000..59c09fbe03a --- /dev/null +++ b/english/cpp/aspose.words.ai/anthropicaimodel/summarize/_index.md @@ -0,0 +1,61 @@ +--- +title: Aspose::Words::AI::AnthropicAiModel::Summarize method +linktitle: Summarize +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::AnthropicAiModel::Summarize method. Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array in C++.' +type: docs +weight: 4000 +url: /cpp/aspose.words.ai/anthropicaimodel/summarize/ +--- +## AnthropicAiModel::Summarize(System::ArrayPtr\\>, System::SharedPtr\) method + + +Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../../) model for processing each document in the array. + +```cpp +System::SharedPtr Aspose::Words::AI::AnthropicAiModel::Summarize(System::ArrayPtr> sourceDocuments, System::SharedPtr options=nullptr) override +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocuments | System::ArrayPtr\\> | An array of documents to be summarized. | +| options | System::SharedPtr\ | Optional settings to control the summary length and other parameters | + +### ReturnValue + +A summarized version of the document's content. + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [AnthropicAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) +## AnthropicAiModel::Summarize(System::SharedPtr\, System::SharedPtr\) method + + +Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../../) model for content processing. + +```cpp +System::SharedPtr Aspose::Words::AI::AnthropicAiModel::Summarize(System::SharedPtr sourceDocument, System::SharedPtr options=nullptr) override +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocument | System::SharedPtr\ | The document to be summarized. | +| options | System::SharedPtr\ | Optional settings to control the summary length and other parameters. | + +### ReturnValue + +A summarized version of the document's content. + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [AnthropicAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/anthropicaimodel/translate/_index.md b/english/cpp/aspose.words.ai/anthropicaimodel/translate/_index.md new file mode 100644 index 00000000000..ad47165d5d1 --- /dev/null +++ b/english/cpp/aspose.words.ai/anthropicaimodel/translate/_index.md @@ -0,0 +1,35 @@ +--- +title: Aspose::Words::AI::AnthropicAiModel::Translate method +linktitle: Translate +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::AnthropicAiModel::Translate method. Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating in C++.' +type: docs +weight: 5000 +url: /cpp/aspose.words.ai/anthropicaimodel/translate/ +--- +## AnthropicAiModel::Translate method + + +Translates the provided document into the specified target language. This operation leverages the connected [AI](../../) model for content translating. + +```cpp +System::SharedPtr Aspose::Words::AI::AnthropicAiModel::Translate(System::SharedPtr sourceDocument, Aspose::Words::AI::Language targetLanguage) override +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocument | System::SharedPtr\ | The document to be translated. | +| targetLanguage | Aspose::Words::AI::Language | The language into which the document will be translated. | + +### ReturnValue + +A new [Document](../../../aspose.words/document/) object containing the translated document. + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Enum [Language](../../language/) +* Class [AnthropicAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/checkgrammaroptions/_index.md b/english/cpp/aspose.words.ai/checkgrammaroptions/_index.md index f18d2352602..c711c6c8c0b 100644 --- a/english/cpp/aspose.words.ai/checkgrammaroptions/_index.md +++ b/english/cpp/aspose.words.ai/checkgrammaroptions/_index.md @@ -23,12 +23,12 @@ class CheckGrammarOptions : public System::Object | [CheckGrammarOptions](./checkgrammaroptions/)() | | | [get_ImproveStylistics](./get_improvestylistics/)() const | Allows to specify either [AI](../) will try to improve stylistics of the text being proofed. Default value is **false**. | | [get_MakeRevisions](./get_makerevisions/)() const | Allows to specify either final or revised document to be returned with proofed text. Default value is **false**. | -| [get_PreserveFormatting](./get_preserveformatting/)() const | Allows to specify either [CheckGrammar()](../iaimodeltext/checkgrammar/) will try to preserve layout and formatting of the original document, or not. Default value is **true**. | +| [get_PreserveFormatting](./get_preserveformatting/)() const | Allows to specify either [CheckGrammar()](../) will try to preserve layout and formatting of the original document, or not. Default value is **true**. | | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | | [set_ImproveStylistics](./set_improvestylistics/)(bool) | Allows to specify either [AI](../) will try to improve stylistics of the text being proofed. Default value is **false**. | | [set_MakeRevisions](./set_makerevisions/)(bool) | Allows to specify either final or revised document to be returned with proofed text. Default value is **false**. | -| [set_PreserveFormatting](./set_preserveformatting/)(bool) | Allows to specify either [CheckGrammar()](../iaimodeltext/checkgrammar/) will try to preserve layout and formatting of the original document, or not. Default value is **true**. | +| [set_PreserveFormatting](./set_preserveformatting/)(bool) | Allows to specify either [CheckGrammar()](../) will try to preserve layout and formatting of the original document, or not. Default value is **true**. | | static [Type](./type/)() | | ## Examples @@ -41,7 +41,7 @@ auto doc = System::MakeObject(get_MyDir() + u"Big docum System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI generative language models. -System::SharedPtr model = System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)); +System::SharedPtr model = Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey); auto grammarOptions = System::MakeObject(); grammarOptions->set_ImproveStylistics(true); diff --git a/english/cpp/aspose.words.ai/checkgrammaroptions/get_preserveformatting/_index.md b/english/cpp/aspose.words.ai/checkgrammaroptions/get_preserveformatting/_index.md index caa7c2c33de..971fcedc58a 100644 --- a/english/cpp/aspose.words.ai/checkgrammaroptions/get_preserveformatting/_index.md +++ b/english/cpp/aspose.words.ai/checkgrammaroptions/get_preserveformatting/_index.md @@ -10,7 +10,7 @@ url: /cpp/aspose.words.ai/checkgrammaroptions/get_preserveformatting/ ## CheckGrammarOptions::get_PreserveFormatting method -Allows to specify either [CheckGrammar()](../../iaimodeltext/checkgrammar/) will try to preserve layout and formatting of the original document, or not. Default value is **true**. +Allows to specify either [CheckGrammar()](../) will try to preserve layout and formatting of the original document, or not. Default value is **true**. ```cpp bool Aspose::Words::AI::CheckGrammarOptions::get_PreserveFormatting() const diff --git a/english/cpp/aspose.words.ai/checkgrammaroptions/set_preserveformatting/_index.md b/english/cpp/aspose.words.ai/checkgrammaroptions/set_preserveformatting/_index.md index 4729c701e97..2bd3b753185 100644 --- a/english/cpp/aspose.words.ai/checkgrammaroptions/set_preserveformatting/_index.md +++ b/english/cpp/aspose.words.ai/checkgrammaroptions/set_preserveformatting/_index.md @@ -10,7 +10,7 @@ url: /cpp/aspose.words.ai/checkgrammaroptions/set_preserveformatting/ ## CheckGrammarOptions::set_PreserveFormatting method -Allows to specify either [CheckGrammar()](../../iaimodeltext/checkgrammar/) will try to preserve layout and formatting of the original document, or not. Default value is **true**. +Allows to specify either [CheckGrammar()](../) will try to preserve layout and formatting of the original document, or not. Default value is **true**. ```cpp void Aspose::Words::AI::CheckGrammarOptions::set_PreserveFormatting(bool value) diff --git a/english/cpp/aspose.words.ai/googleaimodel/_index.md b/english/cpp/aspose.words.ai/googleaimodel/_index.md index c7b37ef6f75..d7bc42dd029 100644 --- a/english/cpp/aspose.words.ai/googleaimodel/_index.md +++ b/english/cpp/aspose.words.ai/googleaimodel/_index.md @@ -21,9 +21,14 @@ class GoogleAiModel : public Aspose::Words::AI::AiModel, | Method | Description | | --- | --- | +| virtual [CheckGrammar](../aimodel/checkgrammar/)(System::SharedPtr\, System::SharedPtr\) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. | | static [Create](../aimodel/create/)(Aspose::Words::AI::AiModelType) | Creates a new instance of [AiModel](../aimodel/) class. | | [GetType](./gettype/)() const override | | +| [GoogleAiModel](./googleaimodel/)() | | | [Is](./is/)(const System::TypeInfo\&) const override | | +| [Summarize](./summarize/)(System::SharedPtr\, System::SharedPtr\) override | Summarizes specified [Document](../../aspose.words/document/) object. | +| [Summarize](./summarize/)(System::ArrayPtr\\>, System::SharedPtr\) override | Summarizes specified [Document](../../aspose.words/document/) objects. | +| [Translate](./translate/)(System::SharedPtr\, Aspose::Words::AI::Language) override | Translates a specified document. | | static [Type](./type/)() | | | [WithApiKey](../aimodel/withapikey/)(const System::String\&) | Sets a specified API key to the model. | @@ -38,7 +43,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/googleaimodel/googleaimodel/_index.md b/english/cpp/aspose.words.ai/googleaimodel/googleaimodel/_index.md new file mode 100644 index 00000000000..5e2d395dbad --- /dev/null +++ b/english/cpp/aspose.words.ai/googleaimodel/googleaimodel/_index.md @@ -0,0 +1,23 @@ +--- +title: Aspose::Words::AI::GoogleAiModel::GoogleAiModel constructor +linktitle: GoogleAiModel +second_title: Aspose.Words for C++ API Reference +description: 'How to use GoogleAiModel constructor of Aspose::Words::AI::GoogleAiModel class in C++.' +type: docs +weight: 1500 +url: /cpp/aspose.words.ai/googleaimodel/googleaimodel/ +--- +## GoogleAiModel::GoogleAiModel constructor + + + + +```cpp +Aspose::Words::AI::GoogleAiModel::GoogleAiModel() +``` + +## See Also + +* Class [GoogleAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/googleaimodel/summarize/_index.md b/english/cpp/aspose.words.ai/googleaimodel/summarize/_index.md new file mode 100644 index 00000000000..b1e3720951c --- /dev/null +++ b/english/cpp/aspose.words.ai/googleaimodel/summarize/_index.md @@ -0,0 +1,41 @@ +--- +title: Aspose::Words::AI::GoogleAiModel::Summarize method +linktitle: Summarize +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::GoogleAiModel::Summarize method. Summarizes specified Document objects in C++.' +type: docs +weight: 4000 +url: /cpp/aspose.words.ai/googleaimodel/summarize/ +--- +## GoogleAiModel::Summarize(System::ArrayPtr\\>, System::SharedPtr\) method + + +Summarizes specified [Document](../../../aspose.words/document/) objects. + +```cpp +System::SharedPtr Aspose::Words::AI::GoogleAiModel::Summarize(System::ArrayPtr> docs, System::SharedPtr options=nullptr) override +``` + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [GoogleAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) +## GoogleAiModel::Summarize(System::SharedPtr\, System::SharedPtr\) method + + +Summarizes specified [Document](../../../aspose.words/document/) object. + +```cpp +System::SharedPtr Aspose::Words::AI::GoogleAiModel::Summarize(System::SharedPtr doc, System::SharedPtr options=nullptr) override +``` + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [GoogleAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/googleaimodel/translate/_index.md b/english/cpp/aspose.words.ai/googleaimodel/translate/_index.md new file mode 100644 index 00000000000..f9dac4eb2c3 --- /dev/null +++ b/english/cpp/aspose.words.ai/googleaimodel/translate/_index.md @@ -0,0 +1,25 @@ +--- +title: Aspose::Words::AI::GoogleAiModel::Translate method +linktitle: Translate +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::GoogleAiModel::Translate method. Translates a specified document in C++.' +type: docs +weight: 5000 +url: /cpp/aspose.words.ai/googleaimodel/translate/ +--- +## GoogleAiModel::Translate method + + +Translates a specified document. + +```cpp +System::SharedPtr Aspose::Words::AI::GoogleAiModel::Translate(System::SharedPtr doc, Aspose::Words::AI::Language language) override +``` + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Enum [Language](../../language/) +* Class [GoogleAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/iaimodeltext/_index.md b/english/cpp/aspose.words.ai/iaimodeltext/_index.md index 89f94863664..04dae9eaa77 100644 --- a/english/cpp/aspose.words.ai/iaimodeltext/_index.md +++ b/english/cpp/aspose.words.ai/iaimodeltext/_index.md @@ -20,38 +20,12 @@ class IAiModelText : public virtual System::Object | Method | Description | | --- | --- | -| virtual [CheckGrammar](./checkgrammar/)(System::SharedPtr\, System::SharedPtr\) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. | | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | | virtual [Summarize](./summarize/)(System::SharedPtr\, System::SharedPtr\) | Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../) model for content processing. | | virtual [Summarize](./summarize/)(System::ArrayPtr\\>, System::SharedPtr\) | Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../) model for processing each document in the array. | | virtual [Translate](./translate/)(System::SharedPtr\, Aspose::Words::AI::Language) | Translates the provided document into the specified target language. This operation leverages the connected [AI](../) model for content translating. | | static [Type](./type/)() | | - -## Examples - - - -Shows how to summarize text using OpenAI and [Google](../../aspose.words.ai.google/) models. -```cpp -auto firstDoc = System::MakeObject(get_MyDir() + u"Big document.docx"); -auto secondDoc = System::MakeObject(get_MyDir() + u"Document.docx"); - -System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); -// Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); - -auto options = System::MakeObject(); - -options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short); -System::SharedPtr oneDocumentSummary = model->Summarize(firstDoc, options); -oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx"); - -options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long); -System::SharedPtr multiDocumentSummary = model->Summarize(System::MakeArray>({firstDoc, secondDoc}), options); -multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx"); -``` - ## See Also * Namespace [Aspose::Words::AI](../) diff --git a/english/cpp/aspose.words.ai/iaimodeltext/summarize/_index.md b/english/cpp/aspose.words.ai/iaimodeltext/summarize/_index.md index 76bccc5161f..fa2f309353b 100644 --- a/english/cpp/aspose.words.ai/iaimodeltext/summarize/_index.md +++ b/english/cpp/aspose.words.ai/iaimodeltext/summarize/_index.md @@ -13,7 +13,7 @@ url: /cpp/aspose.words.ai/iaimodeltext/summarize/ Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../../) model for processing each document in the array. ```cpp -virtual System::SharedPtr Aspose::Words::AI::IAiModelText::Summarize(System::ArrayPtr> sourceDocuments, System::SharedPtr options)=0 +virtual System::SharedPtr Aspose::Words::AI::IAiModelText::Summarize(System::ArrayPtr> sourceDocuments, System::SharedPtr options=nullptr)=0 ``` @@ -26,30 +26,6 @@ virtual System::SharedPtr Aspose::Words::AI::IAiModelTe A summarized version of the document's content. -## Examples - - - -Shows how to summarize text using OpenAI and [Google](../../../aspose.words.ai.google/) models. -```cpp -auto firstDoc = System::MakeObject(get_MyDir() + u"Big document.docx"); -auto secondDoc = System::MakeObject(get_MyDir() + u"Document.docx"); - -System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); -// Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); - -auto options = System::MakeObject(); - -options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short); -System::SharedPtr oneDocumentSummary = model->Summarize(firstDoc, options); -oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx"); - -options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long); -System::SharedPtr multiDocumentSummary = model->Summarize(System::MakeArray>({firstDoc, secondDoc}), options); -multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx"); -``` - ## See Also * Class [Document](../../../aspose.words/document/) @@ -63,7 +39,7 @@ multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx"); Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../../) model for content processing. ```cpp -virtual System::SharedPtr Aspose::Words::AI::IAiModelText::Summarize(System::SharedPtr sourceDocument, System::SharedPtr options)=0 +virtual System::SharedPtr Aspose::Words::AI::IAiModelText::Summarize(System::SharedPtr sourceDocument, System::SharedPtr options=nullptr)=0 ``` @@ -76,30 +52,6 @@ virtual System::SharedPtr Aspose::Words::AI::IAiModelTe A summarized version of the document's content. -## Examples - - - -Shows how to summarize text using OpenAI and [Google](../../../aspose.words.ai.google/) models. -```cpp -auto firstDoc = System::MakeObject(get_MyDir() + u"Big document.docx"); -auto secondDoc = System::MakeObject(get_MyDir() + u"Document.docx"); - -System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); -// Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); - -auto options = System::MakeObject(); - -options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short); -System::SharedPtr oneDocumentSummary = model->Summarize(firstDoc, options); -oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx"); - -options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long); -System::SharedPtr multiDocumentSummary = model->Summarize(System::MakeArray>({firstDoc, secondDoc}), options); -multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx"); -``` - ## See Also * Class [Document](../../../aspose.words/document/) diff --git a/english/cpp/aspose.words.ai/iaimodeltext/translate/_index.md b/english/cpp/aspose.words.ai/iaimodeltext/translate/_index.md index 640e985d481..51b55e250b8 100644 --- a/english/cpp/aspose.words.ai/iaimodeltext/translate/_index.md +++ b/english/cpp/aspose.words.ai/iaimodeltext/translate/_index.md @@ -26,22 +26,6 @@ virtual System::SharedPtr Aspose::Words::AI::IAiModelTe A new [Document](../../../aspose.words/document/) object containing the translated document. -## Examples - - - -Shows how to translate text using [Google](../../../aspose.words.ai.google/) models. -```cpp -auto doc = System::MakeObject(get_MyDir() + u"Document.docx"); - -System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); -// Use Google generative language models. -System::SharedPtr model = System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gemini15Flash)->WithApiKey(apiKey)); - -System::SharedPtr translatedDoc = model->Translate(doc, (Aspose::Words::AI::Language)Aspose::Language::Arabic); -translatedDoc->Save(get_ArtifactsDir() + u"AI.AiTranslate.docx"); -``` - ## See Also * Class [Document](../../../aspose.words/document/) diff --git a/english/cpp/aspose.words.ai/language/_index.md b/english/cpp/aspose.words.ai/language/_index.md index 52dbc8966a3..a957e05582c 100644 --- a/english/cpp/aspose.words.ai/language/_index.md +++ b/english/cpp/aspose.words.ai/language/_index.md @@ -336,9 +336,9 @@ auto doc = System::MakeObject(get_MyDir() + u"Document. System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use Google generative language models. -System::SharedPtr model = System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gemini15Flash)->WithApiKey(apiKey)); +System::SharedPtr model = Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gemini15Flash)->WithApiKey(apiKey); -System::SharedPtr translatedDoc = model->Translate(doc, (Aspose::Words::AI::Language)Aspose::Language::Arabic); +System::SharedPtr translatedDoc = model->Translate(doc, Aspose::Words::AI::Language::Arabic); translatedDoc->Save(get_ArtifactsDir() + u"AI.AiTranslate.docx"); ``` diff --git a/english/cpp/aspose.words.ai/openaimodel/_index.md b/english/cpp/aspose.words.ai/openaimodel/_index.md index 10072eef2ba..d50a6152da6 100644 --- a/english/cpp/aspose.words.ai/openaimodel/_index.md +++ b/english/cpp/aspose.words.ai/openaimodel/_index.md @@ -21,9 +21,13 @@ class OpenAiModel : public Aspose::Words::AI::AiModel, | Method | Description | | --- | --- | +| virtual [CheckGrammar](../aimodel/checkgrammar/)(System::SharedPtr\, System::SharedPtr\) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. | | static [Create](../aimodel/create/)(Aspose::Words::AI::AiModelType) | Creates a new instance of [AiModel](../aimodel/) class. | | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | +| [Summarize](./summarize/)(System::SharedPtr\, System::SharedPtr\) override | Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../) model for content processing. | +| [Summarize](./summarize/)(System::ArrayPtr\\>, System::SharedPtr\) override | Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../) model for processing each document in the array. | +| [Translate](./translate/)(System::SharedPtr\, Aspose::Words::AI::Language) override | Translates the provided document into the specified target language. This operation leverages the connected [AI](../) model for content translating. | | static [Type](./type/)() | | | [WithApiKey](../aimodel/withapikey/)(const System::String\&) | Sets a specified API key to the model. | | [WithOrganization](./withorganization/)(const System::String\&) | Sets a specified Organization to the model. | @@ -40,7 +44,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/openaimodel/summarize/_index.md b/english/cpp/aspose.words.ai/openaimodel/summarize/_index.md new file mode 100644 index 00000000000..4bb97289dfe --- /dev/null +++ b/english/cpp/aspose.words.ai/openaimodel/summarize/_index.md @@ -0,0 +1,61 @@ +--- +title: Aspose::Words::AI::OpenAiModel::Summarize method +linktitle: Summarize +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::OpenAiModel::Summarize method. Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array in C++.' +type: docs +weight: 3334 +url: /cpp/aspose.words.ai/openaimodel/summarize/ +--- +## OpenAiModel::Summarize(System::ArrayPtr\\>, System::SharedPtr\) method + + +Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected [AI](../../) model for processing each document in the array. + +```cpp +System::SharedPtr Aspose::Words::AI::OpenAiModel::Summarize(System::ArrayPtr> sourceDocuments, System::SharedPtr options=nullptr) override +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocuments | System::ArrayPtr\\> | An array of documents to be summarized. | +| options | System::SharedPtr\ | Optional settings to control the summary length and other parameters | + +### ReturnValue + +A summarized version of the document's content. + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [OpenAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) +## OpenAiModel::Summarize(System::SharedPtr\, System::SharedPtr\) method + + +Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected [AI](../../) model for content processing. + +```cpp +System::SharedPtr Aspose::Words::AI::OpenAiModel::Summarize(System::SharedPtr sourceDocument, System::SharedPtr options=nullptr) override +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocument | System::SharedPtr\ | The document to be summarized. | +| options | System::SharedPtr\ | Optional settings to control the summary length and other parameters. | + +### ReturnValue + +A summarized version of the document's content. + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Class [SummarizeOptions](../../summarizeoptions/) +* Class [OpenAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/openaimodel/translate/_index.md b/english/cpp/aspose.words.ai/openaimodel/translate/_index.md new file mode 100644 index 00000000000..dcd7243dfcb --- /dev/null +++ b/english/cpp/aspose.words.ai/openaimodel/translate/_index.md @@ -0,0 +1,35 @@ +--- +title: Aspose::Words::AI::OpenAiModel::Translate method +linktitle: Translate +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::AI::OpenAiModel::Translate method. Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating in C++.' +type: docs +weight: 3667 +url: /cpp/aspose.words.ai/openaimodel/translate/ +--- +## OpenAiModel::Translate method + + +Translates the provided document into the specified target language. This operation leverages the connected [AI](../../) model for content translating. + +```cpp +System::SharedPtr Aspose::Words::AI::OpenAiModel::Translate(System::SharedPtr sourceDocument, Aspose::Words::AI::Language targetLanguage) override +``` + + +| Parameter | Type | Description | +| --- | --- | --- | +| sourceDocument | System::SharedPtr\ | The document to be translated. | +| targetLanguage | Aspose::Words::AI::Language | The language into which the document will be translated. | + +### ReturnValue + +A new [Document](../../../aspose.words/document/) object containing the translated document. + +## See Also + +* Class [Document](../../../aspose.words/document/) +* Enum [Language](../../language/) +* Class [OpenAiModel](../) +* Namespace [Aspose::Words::AI](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.ai/openaimodel/withorganization/_index.md b/english/cpp/aspose.words.ai/openaimodel/withorganization/_index.md index 41514b4e16c..94470f72715 100644 --- a/english/cpp/aspose.words.ai/openaimodel/withorganization/_index.md +++ b/english/cpp/aspose.words.ai/openaimodel/withorganization/_index.md @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/openaimodel/withproject/_index.md b/english/cpp/aspose.words.ai/openaimodel/withproject/_index.md index fddbe0829e3..497c7234d7d 100644 --- a/english/cpp/aspose.words.ai/openaimodel/withproject/_index.md +++ b/english/cpp/aspose.words.ai/openaimodel/withproject/_index.md @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/summarizeoptions/_index.md b/english/cpp/aspose.words.ai/summarizeoptions/_index.md index 86efd89d852..21f61618d17 100644 --- a/english/cpp/aspose.words.ai/summarizeoptions/_index.md +++ b/english/cpp/aspose.words.ai/summarizeoptions/_index.md @@ -38,7 +38,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/summarizeoptions/get_summarylength/_index.md b/english/cpp/aspose.words.ai/summarizeoptions/get_summarylength/_index.md index 8ad4cffd080..1b286c574f0 100644 --- a/english/cpp/aspose.words.ai/summarizeoptions/get_summarylength/_index.md +++ b/english/cpp/aspose.words.ai/summarizeoptions/get_summarylength/_index.md @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/summarizeoptions/summarizeoptions/_index.md b/english/cpp/aspose.words.ai/summarizeoptions/summarizeoptions/_index.md index 8a7bb33f53a..64c55eed3b2 100644 --- a/english/cpp/aspose.words.ai/summarizeoptions/summarizeoptions/_index.md +++ b/english/cpp/aspose.words.ai/summarizeoptions/summarizeoptions/_index.md @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.ai/summarylength/_index.md b/english/cpp/aspose.words.ai/summarylength/_index.md index c8d5a85733b..97f38e021a5 100644 --- a/english/cpp/aspose.words.ai/summarylength/_index.md +++ b/english/cpp/aspose.words.ai/summarylength/_index.md @@ -38,7 +38,7 @@ auto secondDoc = System::MakeObject(get_MyDir() + u"Doc System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY"); // Use OpenAI or Google generative language models. -System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); +System::SharedPtr model = (System::ExplicitCast(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project"); auto options = System::MakeObject(); diff --git a/english/cpp/aspose.words.buildingblocks/glossarydocument/_index.md b/english/cpp/aspose.words.buildingblocks/glossarydocument/_index.md index c9b54c1ceef..d9589440548 100644 --- a/english/cpp/aspose.words.buildingblocks/glossarydocument/_index.md +++ b/english/cpp/aspose.words.buildingblocks/glossarydocument/_index.md @@ -83,7 +83,7 @@ class GlossaryDocument : public Aspose::Words::DocumentBase | [set_PageColor](../../aspose.words/documentbase/set_pagecolor/)(System::Drawing::Color) | Setter for [Aspose::Words::DocumentBase::get_PageColor](../../aspose.words/documentbase/get_pagecolor/). | | [set_PrevNode](../../aspose.words/node/set_prevnode/)(const System::SharedPtr\\&) | | | [set_ResourceLoadingCallback](../../aspose.words/documentbase/set_resourceloadingcallback/)(const System::SharedPtr\\&) | Allows to control how external resources are loaded. | -| [set_WarningCallback](../../aspose.words/documentbase/set_warningcallback/)(const System::SharedPtr\\&) | Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss. | +| [set_WarningCallback](../../aspose.words/documentbase/set_warningcallback/)(const System::SharedPtr\\&) | Setter for [Aspose::Words::DocumentBase::get_WarningCallback](../../aspose.words/documentbase/get_warningcallback/). | | [SetParent](../../aspose.words/node/setparent/)(const System::SharedPtr\\&) | | | [SetTemplateWeakPtr](../../aspose.words/compositenode/settemplateweakptr/)(uint32_t) override | | | [ToString](../../aspose.words/node/tostring/)(Aspose::Words::SaveFormat) | Exports the content of the node into a string in the specified format. | diff --git a/english/cpp/aspose.words.drawing/imagetype/_index.md b/english/cpp/aspose.words.drawing/imagetype/_index.md index 436cc76f00e..d19cb628f9b 100644 --- a/english/cpp/aspose.words.drawing/imagetype/_index.md +++ b/english/cpp/aspose.words.drawing/imagetype/_index.md @@ -46,6 +46,15 @@ System::SharedPtr imgShape = builder->InsertImage ASSERT_EQ(Aspose::Words::Drawing::ImageType::Jpeg, imgShape->get_ImageData()->get_ImageType()); ``` + +Shows how to read WebP image. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Document with WebP image.docx"); + +auto shape = System::ExplicitCast(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true)); +ASSERT_EQ(Aspose::Words::Drawing::ImageType::WebP, shape->get_ImageData()->get_ImageType()); +``` + ## See Also * Namespace [Aspose::Words::Drawing](../) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/_index.md index 52150ea919e..e7f777a5d6a 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/_index.md @@ -25,15 +25,15 @@ class FieldBibliography : public Aspose::Words::Fields::Field, | [get_End](../field/get_end/)() const | Gets the node that represents the field end. | | [get_FieldEnd](../field/get_fieldend/)() const | Gets the node that represents the field end. | | [get_FieldStart](../field/get_fieldstart/)() const | Gets the node that represents the start of the field. | -| [get_FilterLanguageId](./get_filterlanguageid/)() | Gets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language. | +| [get_FilterLanguageId](./get_filterlanguageid/)() | Gets or sets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language. | | [get_Format](../field/get_format/)() | Gets a [FieldFormat](../fieldformat/) object that provides typed access to field's formatting. | -| [get_FormatLanguageId](./get_formatlanguageid/)() | Gets the language ID that is used to format the bibliographic sources in the document. | +| [get_FormatLanguageId](./get_formatlanguageid/)() | Gets or sets the language ID that is used to format the bibliographic sources in the document. | | [get_IsDirty](../field/get_isdirty/)() | Gets or sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document. | | [get_IsLocked](../field/get_islocked/)() | Gets or sets whether the field is locked (should not recalculate its result). | | [get_LocaleId](../field/get_localeid/)() | Gets or sets the LCID of the field. | | [get_Result](../field/get_result/)() | Gets or sets text that is between the field separator and field end. | | [get_Separator](../field/get_separator/)() | Gets the node that represents the field separator. Can be **null**. | -| [get_SourceTag](./get_sourcetag/)() | Gets a value so that only the sources with matching Tag element value are displayed in the bibliography. | +| [get_SourceTag](./get_sourcetag/)() | Gets or sets a value so that only the sources with matching Tag element value are displayed in the bibliography. | | [get_Start](../field/get_start/)() const | Gets the node that represents the start of the field. | | virtual [get_Type](../field/get_type/)() const | Gets the Microsoft Word field type. | | [GetFieldCode](../field/getfieldcode/)() | Returns text between field start and field separator (or field end if there is no separator). Both field code and field result of child fields are included. | @@ -41,17 +41,73 @@ class FieldBibliography : public Aspose::Words::Fields::Field, | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | | [Remove](../field/remove/)() | Removes the field from the document. Returns a node right after the field. If the field's end is the last child of its parent node, returns its parent paragraph. If the field is already removed, returns **null**. | -| [set_FilterLanguageId](./set_filterlanguageid/)(const System::String\&) | Sets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language. | -| [set_FormatLanguageId](./set_formatlanguageid/)(const System::String\&) | Sets the language ID that is used to format the bibliographic sources in the document. | +| [set_FilterLanguageId](./set_filterlanguageid/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId](./get_filterlanguageid/). | +| [set_FormatLanguageId](./set_formatlanguageid/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId](./get_formatlanguageid/). | | [set_IsDirty](../field/set_isdirty/)(bool) | Setter for [Aspose::Words::Fields::Field::get_IsDirty](../field/get_isdirty/). | | [set_IsLocked](../field/set_islocked/)(bool) | Setter for [Aspose::Words::Fields::Field::get_IsLocked](../field/get_islocked/). | | [set_LocaleId](../field/set_localeid/)(int32_t) | Setter for [Aspose::Words::Fields::Field::get_LocaleId](../field/get_localeid/). | | [set_Result](../field/set_result/)(const System::String\&) | Setter for [Aspose::Words::Fields::Field::get_Result](../field/get_result/). | -| [set_SourceTag](./set_sourcetag/)(const System::String\&) | Sets a value so that only the sources with matching Tag element value are displayed in the bibliography. | +| [set_SourceTag](./set_sourcetag/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldBibliography::get_SourceTag](./get_sourcetag/). | | static [Type](./type/)() | | | [Unlink](../field/unlink/)() | Performs the field unlink. | | [Update](../field/update/)() | Performs the field update. Throws if the field is being updated already. | | [Update](../field/update/)(bool) | Performs a field update. Throws if the field is being updated already. | + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [Field](../field/) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/get_filterlanguageid/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/get_filterlanguageid/_index.md index 5f987472837..d57ba3731c0 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/get_filterlanguageid/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/get_filterlanguageid/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId method linktitle: get_FilterLanguageId second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId method. Gets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language in C++.' +description: 'Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId method. Gets or sets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language in C++.' type: docs weight: 1500 url: /cpp/aspose.words.fields/fieldbibliography/get_filterlanguageid/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldbibliography/get_filterlanguageid/ ## FieldBibliography::get_FilterLanguageId method -Gets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language. +Gets or sets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language. ```cpp System::String Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldBibliography](../) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/get_formatlanguageid/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/get_formatlanguageid/_index.md index e71ecbcc897..e8e61f591f9 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/get_formatlanguageid/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/get_formatlanguageid/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId method linktitle: get_FormatLanguageId second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId method. Gets the language ID that is used to format the bibliographic sources in the document in C++.' +description: 'Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId method. Gets or sets the language ID that is used to format the bibliographic sources in the document in C++.' type: docs weight: 2000 url: /cpp/aspose.words.fields/fieldbibliography/get_formatlanguageid/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldbibliography/get_formatlanguageid/ ## FieldBibliography::get_FormatLanguageId method -Gets the language ID that is used to format the bibliographic sources in the document. +Gets or sets the language ID that is used to format the bibliographic sources in the document. ```cpp System::String Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldBibliography](../) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/get_sourcetag/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/get_sourcetag/_index.md index a491011c463..c99dfe676bc 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/get_sourcetag/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/get_sourcetag/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldBibliography::get_SourceTag method linktitle: get_SourceTag second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldBibliography::get_SourceTag method. Gets a value so that only the sources with matching Tag element value are displayed in the bibliography in C++.' +description: 'Aspose::Words::Fields::FieldBibliography::get_SourceTag method. Gets or sets a value so that only the sources with matching Tag element value are displayed in the bibliography in C++.' type: docs weight: 2500 url: /cpp/aspose.words.fields/fieldbibliography/get_sourcetag/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldbibliography/get_sourcetag/ ## FieldBibliography::get_SourceTag method -Gets a value so that only the sources with matching Tag element value are displayed in the bibliography. +Gets or sets a value so that only the sources with matching Tag element value are displayed in the bibliography. ```cpp System::String Aspose::Words::Fields::FieldBibliography::get_SourceTag() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldBibliography](../) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/set_filterlanguageid/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/set_filterlanguageid/_index.md index 028ca1e0b04..3711be773e7 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/set_filterlanguageid/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/set_filterlanguageid/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldBibliography::set_FilterLanguageId method linktitle: set_FilterLanguageId second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldBibliography::set_FilterLanguageId method. Sets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language in C++.' +description: 'Aspose::Words::Fields::FieldBibliography::set_FilterLanguageId method. Setter for Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId in C++.' type: docs weight: 4500 url: /cpp/aspose.words.fields/fieldbibliography/set_filterlanguageid/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldbibliography/set_filterlanguageid/ ## FieldBibliography::set_FilterLanguageId method -Sets the language ID that is used to filter the bibliographic data to only the sources in the document that use that language. +Setter for [Aspose::Words::Fields::FieldBibliography::get_FilterLanguageId](../get_filterlanguageid/). ```cpp void Aspose::Words::Fields::FieldBibliography::set_FilterLanguageId(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/set_formatlanguageid/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/set_formatlanguageid/_index.md index 4911d201e00..ef325bf11d6 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/set_formatlanguageid/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/set_formatlanguageid/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldBibliography::set_FormatLanguageId method linktitle: set_FormatLanguageId second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldBibliography::set_FormatLanguageId method. Sets the language ID that is used to format the bibliographic sources in the document in C++.' +description: 'Aspose::Words::Fields::FieldBibliography::set_FormatLanguageId method. Setter for Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId in C++.' type: docs weight: 5000 url: /cpp/aspose.words.fields/fieldbibliography/set_formatlanguageid/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldbibliography/set_formatlanguageid/ ## FieldBibliography::set_FormatLanguageId method -Sets the language ID that is used to format the bibliographic sources in the document. +Setter for [Aspose::Words::Fields::FieldBibliography::get_FormatLanguageId](../get_formatlanguageid/). ```cpp void Aspose::Words::Fields::FieldBibliography::set_FormatLanguageId(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldbibliography/set_sourcetag/_index.md b/english/cpp/aspose.words.fields/fieldbibliography/set_sourcetag/_index.md index 7e904583510..f5146957718 100644 --- a/english/cpp/aspose.words.fields/fieldbibliography/set_sourcetag/_index.md +++ b/english/cpp/aspose.words.fields/fieldbibliography/set_sourcetag/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldBibliography::set_SourceTag method linktitle: set_SourceTag second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldBibliography::set_SourceTag method. Sets a value so that only the sources with matching Tag element value are displayed in the bibliography in C++.' +description: 'Aspose::Words::Fields::FieldBibliography::set_SourceTag method. Setter for Aspose::Words::Fields::FieldBibliography::get_SourceTag in C++.' type: docs weight: 6000 url: /cpp/aspose.words.fields/fieldbibliography/set_sourcetag/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldbibliography/set_sourcetag/ ## FieldBibliography::set_SourceTag method -Sets a value so that only the sources with matching Tag element value are displayed in the bibliography. +Setter for [Aspose::Words::Fields::FieldBibliography::get_SourceTag](../get_sourcetag/). ```cpp void Aspose::Words::Fields::FieldBibliography::set_SourceTag(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/_index.md b/english/cpp/aspose.words.fields/fieldcitation/_index.md index d7eb3d02b78..fbc1f78e297 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/_index.md @@ -21,51 +21,107 @@ class FieldCitation : public Aspose::Words::Fields::Field, | Method | Description | | --- | --- | -| [get_AnotherSourceTag](./get_anothersourcetag/)() | Gets a value that matches the **Tag** element's value of another source to be included in the citation. | +| [get_AnotherSourceTag](./get_anothersourcetag/)() | Gets or sets a value that matches the **Tag** element's value of another source to be included in the citation. | | [get_DisplayResult](../field/get_displayresult/)() | Gets the text that represents the displayed field result. | | [get_End](../field/get_end/)() const | Gets the node that represents the field end. | | [get_FieldEnd](../field/get_fieldend/)() const | Gets the node that represents the field end. | | [get_FieldStart](../field/get_fieldstart/)() const | Gets the node that represents the start of the field. | | [get_Format](../field/get_format/)() | Gets a [FieldFormat](../fieldformat/) object that provides typed access to field's formatting. | -| [get_FormatLanguageId](./get_formatlanguageid/)() | Gets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document. | +| [get_FormatLanguageId](./get_formatlanguageid/)() | Gets or sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document. | | [get_IsDirty](../field/get_isdirty/)() | Gets or sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document. | | [get_IsLocked](../field/get_islocked/)() | Gets or sets whether the field is locked (should not recalculate its result). | | [get_LocaleId](../field/get_localeid/)() | Gets or sets the LCID of the field. | -| [get_PageNumber](./get_pagenumber/)() | Gets a page number associated with the citation. | -| [get_Prefix](./get_prefix/)() | Gets a prefix that is prepended to the citation. | +| [get_PageNumber](./get_pagenumber/)() | Gets or sets a page number associated with the citation. | +| [get_Prefix](./get_prefix/)() | Gets or sets a prefix that is prepended to the citation. | | [get_Result](../field/get_result/)() | Gets or sets text that is between the field separator and field end. | | [get_Separator](../field/get_separator/)() | Gets the node that represents the field separator. Can be **null**. | -| [get_SourceTag](./get_sourcetag/)() | Gets a value that matches the **Tag** element's value of the source to insert. | +| [get_SourceTag](./get_sourcetag/)() | Gets or sets a value that matches the **Tag** element's value of the source to insert. | | [get_Start](../field/get_start/)() const | Gets the node that represents the start of the field. | -| [get_Suffix](./get_suffix/)() | Gets a suffix that is appended to the citation. | -| [get_SuppressAuthor](./get_suppressauthor/)() | Gets whether the author information is suppressed from the citation. | -| [get_SuppressTitle](./get_suppresstitle/)() | Gets whether the title information is suppressed from the citation. | -| [get_SuppressYear](./get_suppressyear/)() | Gets whether the year information is suppressed from the citation. | +| [get_Suffix](./get_suffix/)() | Gets or sets a suffix that is appended to the citation. | +| [get_SuppressAuthor](./get_suppressauthor/)() | Gets or sets whether the author information is suppressed from the citation. | +| [get_SuppressTitle](./get_suppresstitle/)() | Gets or sets whether the title information is suppressed from the citation. | +| [get_SuppressYear](./get_suppressyear/)() | Gets or sets whether the year information is suppressed from the citation. | | virtual [get_Type](../field/get_type/)() const | Gets the Microsoft Word field type. | -| [get_VolumeNumber](./get_volumenumber/)() | Gets a volume number associated with the citation. | +| [get_VolumeNumber](./get_volumenumber/)() | Gets or sets a volume number associated with the citation. | | [GetFieldCode](../field/getfieldcode/)() | Returns text between field start and field separator (or field end if there is no separator). Both field code and field result of child fields are included. | | [GetFieldCode](../field/getfieldcode/)(bool) | Returns text between field start and field separator (or field end if there is no separator). | | [GetType](./gettype/)() const override | | | [Is](./is/)(const System::TypeInfo\&) const override | | | [Remove](../field/remove/)() | Removes the field from the document. Returns a node right after the field. If the field's end is the last child of its parent node, returns its parent paragraph. If the field is already removed, returns **null**. | -| [set_AnotherSourceTag](./set_anothersourcetag/)(const System::String\&) | Sets a value that matches the **Tag** element's value of another source to be included in the citation. | -| [set_FormatLanguageId](./set_formatlanguageid/)(const System::String\&) | Sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document. | +| [set_AnotherSourceTag](./set_anothersourcetag/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag](./get_anothersourcetag/). | +| [set_FormatLanguageId](./set_formatlanguageid/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_FormatLanguageId](./get_formatlanguageid/). | | [set_IsDirty](../field/set_isdirty/)(bool) | Setter for [Aspose::Words::Fields::Field::get_IsDirty](../field/get_isdirty/). | | [set_IsLocked](../field/set_islocked/)(bool) | Setter for [Aspose::Words::Fields::Field::get_IsLocked](../field/get_islocked/). | | [set_LocaleId](../field/set_localeid/)(int32_t) | Setter for [Aspose::Words::Fields::Field::get_LocaleId](../field/get_localeid/). | -| [set_PageNumber](./set_pagenumber/)(const System::String\&) | Sets a page number associated with the citation. | -| [set_Prefix](./set_prefix/)(const System::String\&) | Sets a prefix that is prepended to the citation. | +| [set_PageNumber](./set_pagenumber/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_PageNumber](./get_pagenumber/). | +| [set_Prefix](./set_prefix/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_Prefix](./get_prefix/). | | [set_Result](../field/set_result/)(const System::String\&) | Setter for [Aspose::Words::Fields::Field::get_Result](../field/get_result/). | -| [set_SourceTag](./set_sourcetag/)(const System::String\&) | Sets a value that matches the **Tag** element's value of the source to insert. | -| [set_Suffix](./set_suffix/)(const System::String\&) | Sets a suffix that is appended to the citation. | -| [set_SuppressAuthor](./set_suppressauthor/)(bool) | Sets whether the author information is suppressed from the citation. | -| [set_SuppressTitle](./set_suppresstitle/)(bool) | Sets whether the title information is suppressed from the citation. | -| [set_SuppressYear](./set_suppressyear/)(bool) | Sets whether the year information is suppressed from the citation. | -| [set_VolumeNumber](./set_volumenumber/)(const System::String\&) | Sets a volume number associated with the citation. | +| [set_SourceTag](./set_sourcetag/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_SourceTag](./get_sourcetag/). | +| [set_Suffix](./set_suffix/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_Suffix](./get_suffix/). | +| [set_SuppressAuthor](./set_suppressauthor/)(bool) | Setter for [Aspose::Words::Fields::FieldCitation::get_SuppressAuthor](./get_suppressauthor/). | +| [set_SuppressTitle](./set_suppresstitle/)(bool) | Setter for [Aspose::Words::Fields::FieldCitation::get_SuppressTitle](./get_suppresstitle/). | +| [set_SuppressYear](./set_suppressyear/)(bool) | Setter for [Aspose::Words::Fields::FieldCitation::get_SuppressYear](./get_suppressyear/). | +| [set_VolumeNumber](./set_volumenumber/)(const System::String\&) | Setter for [Aspose::Words::Fields::FieldCitation::get_VolumeNumber](./get_volumenumber/). | | static [Type](./type/)() | | | [Unlink](../field/unlink/)() | Performs the field unlink. | | [Update](../field/update/)() | Performs the field update. Throws if the field is being updated already. | | [Update](../field/update/)(bool) | Performs a field update. Throws if the field is being updated already. | + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [Field](../field/) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_anothersourcetag/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_anothersourcetag/_index.md index 5aa65d59a83..f4c449eb1c6 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_anothersourcetag/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_anothersourcetag/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag method linktitle: get_AnotherSourceTag second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag method. Gets a value that matches the Tag element''s value of another source to be included in the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag method. Gets or sets a value that matches the Tag element''s value of another source to be included in the citation in C++.' type: docs weight: 2000 url: /cpp/aspose.words.fields/fieldcitation/get_anothersourcetag/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_anothersourcetag/ ## FieldCitation::get_AnotherSourceTag method -Gets a value that matches the **Tag** element's value of another source to be included in the citation. +Gets or sets a value that matches the **Tag** element's value of another source to be included in the citation. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_formatlanguageid/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_formatlanguageid/_index.md index 372d95f44c5..9360efce9af 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_formatlanguageid/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_formatlanguageid/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_FormatLanguageId method linktitle: get_FormatLanguageId second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_FormatLanguageId method. Gets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_FormatLanguageId method. Gets or sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document in C++.' type: docs weight: 3000 url: /cpp/aspose.words.fields/fieldcitation/get_formatlanguageid/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_formatlanguageid/ ## FieldCitation::get_FormatLanguageId method -Gets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document. +Gets or sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_FormatLanguageId() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_pagenumber/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_pagenumber/_index.md index 0c26653de1b..db6b999d44d 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_pagenumber/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_pagenumber/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_PageNumber method linktitle: get_PageNumber second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_PageNumber method. Gets a page number associated with the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_PageNumber method. Gets or sets a page number associated with the citation in C++.' type: docs weight: 4000 url: /cpp/aspose.words.fields/fieldcitation/get_pagenumber/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_pagenumber/ ## FieldCitation::get_PageNumber method -Gets a page number associated with the citation. +Gets or sets a page number associated with the citation. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_PageNumber() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_prefix/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_prefix/_index.md index ca075eca1d4..f5fb13dec04 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_prefix/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_prefix/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_Prefix method linktitle: get_Prefix second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_Prefix method. Gets a prefix that is prepended to the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_Prefix method. Gets or sets a prefix that is prepended to the citation in C++.' type: docs weight: 5000 url: /cpp/aspose.words.fields/fieldcitation/get_prefix/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_prefix/ ## FieldCitation::get_Prefix method -Gets a prefix that is prepended to the citation. +Gets or sets a prefix that is prepended to the citation. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_Prefix() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_sourcetag/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_sourcetag/_index.md index ed317eaab59..94dcb86b54f 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_sourcetag/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_sourcetag/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_SourceTag method linktitle: get_SourceTag second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_SourceTag method. Gets a value that matches the Tag element''s value of the source to insert in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_SourceTag method. Gets or sets a value that matches the Tag element''s value of the source to insert in C++.' type: docs weight: 6000 url: /cpp/aspose.words.fields/fieldcitation/get_sourcetag/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_sourcetag/ ## FieldCitation::get_SourceTag method -Gets a value that matches the **Tag** element's value of the source to insert. +Gets or sets a value that matches the **Tag** element's value of the source to insert. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_SourceTag() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_suffix/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_suffix/_index.md index 3b22db5192c..354e8db4601 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_suffix/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_suffix/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_Suffix method linktitle: get_Suffix second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_Suffix method. Gets a suffix that is appended to the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_Suffix method. Gets or sets a suffix that is appended to the citation in C++.' type: docs weight: 7000 url: /cpp/aspose.words.fields/fieldcitation/get_suffix/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_suffix/ ## FieldCitation::get_Suffix method -Gets a suffix that is appended to the citation. +Gets or sets a suffix that is appended to the citation. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_Suffix() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_suppressauthor/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_suppressauthor/_index.md index 6d42ed9accb..258d0d3088d 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_suppressauthor/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_suppressauthor/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_SuppressAuthor method linktitle: get_SuppressAuthor second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_SuppressAuthor method. Gets whether the author information is suppressed from the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_SuppressAuthor method. Gets or sets whether the author information is suppressed from the citation in C++.' type: docs weight: 8000 url: /cpp/aspose.words.fields/fieldcitation/get_suppressauthor/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_suppressauthor/ ## FieldCitation::get_SuppressAuthor method -Gets whether the author information is suppressed from the citation. +Gets or sets whether the author information is suppressed from the citation. ```cpp bool Aspose::Words::Fields::FieldCitation::get_SuppressAuthor() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_suppresstitle/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_suppresstitle/_index.md index 07e2f665bbe..10f248caafb 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_suppresstitle/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_suppresstitle/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_SuppressTitle method linktitle: get_SuppressTitle second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_SuppressTitle method. Gets whether the title information is suppressed from the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_SuppressTitle method. Gets or sets whether the title information is suppressed from the citation in C++.' type: docs weight: 9000 url: /cpp/aspose.words.fields/fieldcitation/get_suppresstitle/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_suppresstitle/ ## FieldCitation::get_SuppressTitle method -Gets whether the title information is suppressed from the citation. +Gets or sets whether the title information is suppressed from the citation. ```cpp bool Aspose::Words::Fields::FieldCitation::get_SuppressTitle() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_suppressyear/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_suppressyear/_index.md index fce5498d492..9d36c356792 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_suppressyear/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_suppressyear/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_SuppressYear method linktitle: get_SuppressYear second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_SuppressYear method. Gets whether the year information is suppressed from the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_SuppressYear method. Gets or sets whether the year information is suppressed from the citation in C++.' type: docs weight: 10000 url: /cpp/aspose.words.fields/fieldcitation/get_suppressyear/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_suppressyear/ ## FieldCitation::get_SuppressYear method -Gets whether the year information is suppressed from the citation. +Gets or sets whether the year information is suppressed from the citation. ```cpp bool Aspose::Words::Fields::FieldCitation::get_SuppressYear() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/get_volumenumber/_index.md b/english/cpp/aspose.words.fields/fieldcitation/get_volumenumber/_index.md index 4537671084a..ad654f7cce8 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/get_volumenumber/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/get_volumenumber/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::get_VolumeNumber method linktitle: get_VolumeNumber second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::get_VolumeNumber method. Gets a volume number associated with the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::get_VolumeNumber method. Gets or sets a volume number associated with the citation in C++.' type: docs weight: 11000 url: /cpp/aspose.words.fields/fieldcitation/get_volumenumber/ @@ -10,12 +10,68 @@ url: /cpp/aspose.words.fields/fieldcitation/get_volumenumber/ ## FieldCitation::get_VolumeNumber method -Gets a volume number associated with the citation. +Gets or sets a volume number associated with the citation. ```cpp System::String Aspose::Words::Fields::FieldCitation::get_VolumeNumber() ``` + +## Examples + + + +Shows how to work with CITATION and BIBLIOGRAPHY fields. +```cpp +// Open a document containing bibliographical sources that we can find in +// Microsoft Word via References -> Citations & Bibliography -> Manage Sources. +auto doc = System::MakeObject(get_MyDir() + u"Bibliography.docx"); + +auto builder = System::MakeObject(doc); +builder->Write(u"Text to be cited with one source."); + +// Create a citation with just the page number and the author of the referenced book. +auto fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); + +// We refer to sources using their tag names. +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_PageNumber(u"85"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(true); +fieldCitation->set_SuppressYear(true); + +ASSERT_EQ(u" CITATION Book1 \\p 85 \\t \\y", fieldCitation->GetFieldCode()); + +// Create a more detailed citation which cites two sources. +builder->InsertParagraph(); +builder->Write(u"Text to be cited with two sources."); +fieldCitation = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldCitation, true)); +fieldCitation->set_SourceTag(u"Book1"); +fieldCitation->set_AnotherSourceTag(u"Book2"); +fieldCitation->set_FormatLanguageId(u"en-US"); +fieldCitation->set_PageNumber(u"19"); +fieldCitation->set_Prefix(u"Prefix "); +fieldCitation->set_Suffix(u" Suffix"); +fieldCitation->set_SuppressAuthor(false); +fieldCitation->set_SuppressTitle(false); +fieldCitation->set_SuppressYear(false); +fieldCitation->set_VolumeNumber(u"VII"); + +ASSERT_EQ(u" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation->GetFieldCode()); + +// We can use a BIBLIOGRAPHY field to display all the sources within the document. +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +auto fieldBibliography = System::ExplicitCast(builder->InsertField(Aspose::Words::Fields::FieldType::FieldBibliography, true)); +fieldBibliography->set_FormatLanguageId(u"5129"); +fieldBibliography->set_FilterLanguageId(u"5129"); +fieldBibliography->set_SourceTag(u"Book2"); + +ASSERT_EQ(u" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography->GetFieldCode()); + +doc->UpdateFields(); +doc->Save(get_ArtifactsDir() + u"Field.CITATION.docx"); +``` + ## See Also * Class [FieldCitation](../) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_anothersourcetag/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_anothersourcetag/_index.md index 2d536c13269..8717696b8f3 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_anothersourcetag/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_anothersourcetag/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_AnotherSourceTag method linktitle: set_AnotherSourceTag second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_AnotherSourceTag method. Sets a value that matches the Tag element''s value of another source to be included in the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_AnotherSourceTag method. Setter for Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag in C++.' type: docs weight: 14000 url: /cpp/aspose.words.fields/fieldcitation/set_anothersourcetag/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_anothersourcetag/ ## FieldCitation::set_AnotherSourceTag method -Sets a value that matches the **Tag** element's value of another source to be included in the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_AnotherSourceTag](../get_anothersourcetag/). ```cpp void Aspose::Words::Fields::FieldCitation::set_AnotherSourceTag(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_formatlanguageid/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_formatlanguageid/_index.md index a4540c1fcbd..7d1e6566edb 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_formatlanguageid/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_formatlanguageid/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_FormatLanguageId method linktitle: set_FormatLanguageId second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_FormatLanguageId method. Sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_FormatLanguageId method. Setter for Aspose::Words::Fields::FieldCitation::get_FormatLanguageId in C++.' type: docs weight: 15000 url: /cpp/aspose.words.fields/fieldcitation/set_formatlanguageid/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_formatlanguageid/ ## FieldCitation::set_FormatLanguageId method -Sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document. +Setter for [Aspose::Words::Fields::FieldCitation::get_FormatLanguageId](../get_formatlanguageid/). ```cpp void Aspose::Words::Fields::FieldCitation::set_FormatLanguageId(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_pagenumber/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_pagenumber/_index.md index da72c3cba27..fe0dae63bb6 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_pagenumber/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_pagenumber/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_PageNumber method linktitle: set_PageNumber second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_PageNumber method. Sets a page number associated with the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_PageNumber method. Setter for Aspose::Words::Fields::FieldCitation::get_PageNumber in C++.' type: docs weight: 16000 url: /cpp/aspose.words.fields/fieldcitation/set_pagenumber/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_pagenumber/ ## FieldCitation::set_PageNumber method -Sets a page number associated with the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_PageNumber](../get_pagenumber/). ```cpp void Aspose::Words::Fields::FieldCitation::set_PageNumber(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_prefix/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_prefix/_index.md index a1aabcb3cf0..ad6b28caca5 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_prefix/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_prefix/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_Prefix method linktitle: set_Prefix second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_Prefix method. Sets a prefix that is prepended to the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_Prefix method. Setter for Aspose::Words::Fields::FieldCitation::get_Prefix in C++.' type: docs weight: 17000 url: /cpp/aspose.words.fields/fieldcitation/set_prefix/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_prefix/ ## FieldCitation::set_Prefix method -Sets a prefix that is prepended to the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_Prefix](../get_prefix/). ```cpp void Aspose::Words::Fields::FieldCitation::set_Prefix(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_sourcetag/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_sourcetag/_index.md index f4d530226c7..fc2ed1e1a1e 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_sourcetag/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_sourcetag/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_SourceTag method linktitle: set_SourceTag second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_SourceTag method. Sets a value that matches the Tag element''s value of the source to insert in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_SourceTag method. Setter for Aspose::Words::Fields::FieldCitation::get_SourceTag in C++.' type: docs weight: 18000 url: /cpp/aspose.words.fields/fieldcitation/set_sourcetag/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_sourcetag/ ## FieldCitation::set_SourceTag method -Sets a value that matches the **Tag** element's value of the source to insert. +Setter for [Aspose::Words::Fields::FieldCitation::get_SourceTag](../get_sourcetag/). ```cpp void Aspose::Words::Fields::FieldCitation::set_SourceTag(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_suffix/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_suffix/_index.md index e5bc2aca933..ab6fc80a6aa 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_suffix/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_suffix/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_Suffix method linktitle: set_Suffix second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_Suffix method. Sets a suffix that is appended to the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_Suffix method. Setter for Aspose::Words::Fields::FieldCitation::get_Suffix in C++.' type: docs weight: 19000 url: /cpp/aspose.words.fields/fieldcitation/set_suffix/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_suffix/ ## FieldCitation::set_Suffix method -Sets a suffix that is appended to the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_Suffix](../get_suffix/). ```cpp void Aspose::Words::Fields::FieldCitation::set_Suffix(const System::String &value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_suppressauthor/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_suppressauthor/_index.md index 1565dfbfb67..433cb425c94 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_suppressauthor/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_suppressauthor/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_SuppressAuthor method linktitle: set_SuppressAuthor second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_SuppressAuthor method. Sets whether the author information is suppressed from the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_SuppressAuthor method. Setter for Aspose::Words::Fields::FieldCitation::get_SuppressAuthor in C++.' type: docs weight: 20000 url: /cpp/aspose.words.fields/fieldcitation/set_suppressauthor/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_suppressauthor/ ## FieldCitation::set_SuppressAuthor method -Sets whether the author information is suppressed from the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_SuppressAuthor](../get_suppressauthor/). ```cpp void Aspose::Words::Fields::FieldCitation::set_SuppressAuthor(bool value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_suppresstitle/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_suppresstitle/_index.md index 2acb0ce0c64..6bb16ae0330 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_suppresstitle/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_suppresstitle/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_SuppressTitle method linktitle: set_SuppressTitle second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_SuppressTitle method. Sets whether the title information is suppressed from the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_SuppressTitle method. Setter for Aspose::Words::Fields::FieldCitation::get_SuppressTitle in C++.' type: docs weight: 21000 url: /cpp/aspose.words.fields/fieldcitation/set_suppresstitle/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_suppresstitle/ ## FieldCitation::set_SuppressTitle method -Sets whether the title information is suppressed from the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_SuppressTitle](../get_suppresstitle/). ```cpp void Aspose::Words::Fields::FieldCitation::set_SuppressTitle(bool value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_suppressyear/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_suppressyear/_index.md index 813aff9e826..134d819caad 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_suppressyear/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_suppressyear/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_SuppressYear method linktitle: set_SuppressYear second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_SuppressYear method. Sets whether the year information is suppressed from the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_SuppressYear method. Setter for Aspose::Words::Fields::FieldCitation::get_SuppressYear in C++.' type: docs weight: 22000 url: /cpp/aspose.words.fields/fieldcitation/set_suppressyear/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_suppressyear/ ## FieldCitation::set_SuppressYear method -Sets whether the year information is suppressed from the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_SuppressYear](../get_suppressyear/). ```cpp void Aspose::Words::Fields::FieldCitation::set_SuppressYear(bool value) diff --git a/english/cpp/aspose.words.fields/fieldcitation/set_volumenumber/_index.md b/english/cpp/aspose.words.fields/fieldcitation/set_volumenumber/_index.md index 9a90fb2c17e..5eac24b3808 100644 --- a/english/cpp/aspose.words.fields/fieldcitation/set_volumenumber/_index.md +++ b/english/cpp/aspose.words.fields/fieldcitation/set_volumenumber/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Fields::FieldCitation::set_VolumeNumber method linktitle: set_VolumeNumber second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Fields::FieldCitation::set_VolumeNumber method. Sets a volume number associated with the citation in C++.' +description: 'Aspose::Words::Fields::FieldCitation::set_VolumeNumber method. Setter for Aspose::Words::Fields::FieldCitation::get_VolumeNumber in C++.' type: docs weight: 23000 url: /cpp/aspose.words.fields/fieldcitation/set_volumenumber/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.fields/fieldcitation/set_volumenumber/ ## FieldCitation::set_VolumeNumber method -Sets a volume number associated with the citation. +Setter for [Aspose::Words::Fields::FieldCitation::get_VolumeNumber](../get_volumenumber/). ```cpp void Aspose::Words::Fields::FieldCitation::set_VolumeNumber(const System::String &value) diff --git a/english/cpp/aspose.words.fonts/fontinfosubstitutionrule/_index.md b/english/cpp/aspose.words.fonts/fontinfosubstitutionrule/_index.md index 35e828bcdee..01367183ca6 100644 --- a/english/cpp/aspose.words.fonts/fontinfosubstitutionrule/_index.md +++ b/english/cpp/aspose.words.fonts/fontinfosubstitutionrule/_index.md @@ -25,6 +25,41 @@ class FontInfoSubstitutionRule : public Aspose::Words::Fonts::FontSubstitutionRu | [Is](./is/)(const System::TypeInfo\&) const override | | | virtual [set_Enabled](../fontsubstitutionrule/set_enabled/)(bool) | Setter for [Aspose::Words::Fonts::FontSubstitutionRule::get_Enabled](../fontsubstitutionrule/get_enabled/). | | static [Type](./type/)() | | + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [FontSubstitutionRule](../fontsubstitutionrule/) diff --git a/english/cpp/aspose.words.fonts/fontsettings/_index.md b/english/cpp/aspose.words.fonts/fontsettings/_index.md index 18c31d324d1..758d765a418 100644 --- a/english/cpp/aspose.words.fonts/fontsettings/_index.md +++ b/english/cpp/aspose.words.fonts/fontsettings/_index.md @@ -100,7 +100,7 @@ ASSERT_TRUE(newFontSources[0]->GetAvailableFonts()->LINQ_Any(static_castGetAvailableFonts()->get_Count()); + ASSERT_EQ(30, newFontSources[0]->GetAvailableFonts()->get_Count()); ASSERT_TRUE(newFontSources[0]->GetAvailableFonts()->LINQ_Any(static_cast, bool>>(static_cast f)>>([](System::SharedPtr f) -> bool { return f->get_FullFontName() == u"Amethysta"; @@ -176,7 +176,7 @@ ASSERT_TRUE(newFontSources[0]->GetAvailableFonts()->LINQ_Any(static_castGetAvailableFonts()->get_Count()); + ASSERT_EQ(11, newFontSources[1]->GetAvailableFonts()->get_Count()); ASSERT_TRUE(newFontSources[1]->GetAvailableFonts()->LINQ_Any(static_cast, bool>>(static_cast f)>>([](System::SharedPtr f) -> bool { return f->get_FullFontName() == u"Junction Light"; diff --git a/english/cpp/aspose.words.fonts/fontsettings/setfontsfolder/_index.md b/english/cpp/aspose.words.fonts/fontsettings/setfontsfolder/_index.md index d6c542d5588..b108bc47b52 100644 --- a/english/cpp/aspose.words.fonts/fontsettings/setfontsfolder/_index.md +++ b/english/cpp/aspose.words.fonts/fontsettings/setfontsfolder/_index.md @@ -79,7 +79,7 @@ ASSERT_TRUE(newFontSources[0]->GetAvailableFonts()->LINQ_Any(static_castGetAvailableFonts()->get_Count()); + ASSERT_EQ(30, newFontSources[0]->GetAvailableFonts()->get_Count()); ASSERT_TRUE(newFontSources[0]->GetAvailableFonts()->LINQ_Any(static_cast, bool>>(static_cast f)>>([](System::SharedPtr f) -> bool { return f->get_FullFontName() == u"Amethysta"; diff --git a/english/cpp/aspose.words.fonts/fontsettings/setfontsfolders/_index.md b/english/cpp/aspose.words.fonts/fontsettings/setfontsfolders/_index.md index 6b380aa3304..7d45e225212 100644 --- a/english/cpp/aspose.words.fonts/fontsettings/setfontsfolders/_index.md +++ b/english/cpp/aspose.words.fonts/fontsettings/setfontsfolders/_index.md @@ -86,7 +86,7 @@ ASSERT_TRUE(newFontSources[0]->GetAvailableFonts()->LINQ_Any(static_castGetAvailableFonts()->get_Count()); + ASSERT_EQ(11, newFontSources[1]->GetAvailableFonts()->get_Count()); ASSERT_TRUE(newFontSources[1]->GetAvailableFonts()->LINQ_Any(static_cast, bool>>(static_cast f)>>([](System::SharedPtr f) -> bool { return f->get_FullFontName() == u"Junction Light"; diff --git a/english/cpp/aspose.words.fonts/fontsubstitutionsettings/get_fontinfosubstitution/_index.md b/english/cpp/aspose.words.fonts/fontsubstitutionsettings/get_fontinfosubstitution/_index.md index 0da073815b0..8fcdfed7210 100644 --- a/english/cpp/aspose.words.fonts/fontsubstitutionsettings/get_fontinfosubstitution/_index.md +++ b/english/cpp/aspose.words.fonts/fontsubstitutionsettings/get_fontinfosubstitution/_index.md @@ -16,6 +16,41 @@ url: /cpp/aspose.words.fonts/fontsubstitutionsettings/get_fontinfosubstitution/ System::SharedPtr Aspose::Words::Fonts::FontSubstitutionSettings::get_FontInfoSubstitution() const ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [FontInfoSubstitutionRule](../../fontinfosubstitutionrule/) diff --git a/english/cpp/aspose.words.layout/layoutoptions/_index.md b/english/cpp/aspose.words.layout/layoutoptions/_index.md index b26801aaf9d..94b56d8787a 100644 --- a/english/cpp/aspose.words.layout/layoutoptions/_index.md +++ b/english/cpp/aspose.words.layout/layoutoptions/_index.md @@ -24,7 +24,7 @@ class LayoutOptions : public System::Object | [get_CommentDisplayMode](./get_commentdisplaymode/)() const | Gets or sets the way comments are rendered. Default value is [ShowInBalloons](../commentdisplaymode/). | | [get_ContinuousSectionPageNumberingRestart](./get_continuoussectionpagenumberingrestart/)() const | Gets or sets the mode of behavior for computing page numbers when a continuous section restarts the page numbering. | | [get_IgnorePrinterMetrics](./get_ignoreprintermetrics/)() const | Gets or sets indication of whether the "Use printer metrics to lay out document" compatibility option is ignored. Default is **true**. | -| [get_KeepOriginalFontMetrics](./get_keeporiginalfontmetrics/)() const | Gets an indication of whether the original font metrics should be used after font substitution. Default is **true**. | +| [get_KeepOriginalFontMetrics](./get_keeporiginalfontmetrics/)() const | Gets or sets an indication of whether the original font metrics should be used after font substitution. Default is **true**. | | [get_RevisionOptions](./get_revisionoptions/)() const | Gets revision options. | | [get_ShowHiddenText](./get_showhiddentext/)() const | Gets or sets indication of whether hidden text in the document is rendered. Default is **false**. | | [get_ShowParagraphMarks](./get_showparagraphmarks/)() const | Gets or sets indication of whether paragraph marks are rendered. Default is **false**. | @@ -36,7 +36,7 @@ class LayoutOptions : public System::Object | [set_CommentDisplayMode](./set_commentdisplaymode/)(Aspose::Words::Layout::CommentDisplayMode) | Setter for [Aspose::Words::Layout::LayoutOptions::get_CommentDisplayMode](./get_commentdisplaymode/). | | [set_ContinuousSectionPageNumberingRestart](./set_continuoussectionpagenumberingrestart/)(Aspose::Words::Layout::ContinuousSectionRestart) | Setter for [Aspose::Words::Layout::LayoutOptions::get_ContinuousSectionPageNumberingRestart](./get_continuoussectionpagenumberingrestart/). | | [set_IgnorePrinterMetrics](./set_ignoreprintermetrics/)(bool) | Setter for [Aspose::Words::Layout::LayoutOptions::get_IgnorePrinterMetrics](./get_ignoreprintermetrics/). | -| [set_KeepOriginalFontMetrics](./set_keeporiginalfontmetrics/)(bool) | Sets an indication of whether the original font metrics should be used after font substitution. Default is **true**. | +| [set_KeepOriginalFontMetrics](./set_keeporiginalfontmetrics/)(bool) | Setter for [Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics](./get_keeporiginalfontmetrics/). | | [set_ShowHiddenText](./set_showhiddentext/)(bool) | Setter for [Aspose::Words::Layout::LayoutOptions::get_ShowHiddenText](./get_showhiddentext/). | | [set_ShowParagraphMarks](./set_showparagraphmarks/)(bool) | Setter for [Aspose::Words::Layout::LayoutOptions::get_ShowParagraphMarks](./get_showparagraphmarks/). | | [set_TextShaperFactory](./set_textshaperfactory/)(const System::SharedPtr\\&) | Sets [ITextShaperFactory](../) implementation used for Advanced Typography rendering features. | diff --git a/english/cpp/aspose.words.layout/layoutoptions/get_keeporiginalfontmetrics/_index.md b/english/cpp/aspose.words.layout/layoutoptions/get_keeporiginalfontmetrics/_index.md index 525c8637419..646c3622737 100644 --- a/english/cpp/aspose.words.layout/layoutoptions/get_keeporiginalfontmetrics/_index.md +++ b/english/cpp/aspose.words.layout/layoutoptions/get_keeporiginalfontmetrics/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics method linktitle: get_KeepOriginalFontMetrics second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics method. Gets an indication of whether the original font metrics should be used after font substitution. Default is true in C++.' +description: 'Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics method. Gets or sets an indication of whether the original font metrics should be used after font substitution. Default is true in C++.' type: docs weight: 6500 url: /cpp/aspose.words.layout/layoutoptions/get_keeporiginalfontmetrics/ @@ -10,12 +10,47 @@ url: /cpp/aspose.words.layout/layoutoptions/get_keeporiginalfontmetrics/ ## LayoutOptions::get_KeepOriginalFontMetrics method -Gets an indication of whether the original font metrics should be used after font substitution. Default is **true**. +Gets or sets an indication of whether the original font metrics should be used after font substitution. Default is **true**. ```cpp bool Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics() const ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [LayoutOptions](../) diff --git a/english/cpp/aspose.words.layout/layoutoptions/set_keeporiginalfontmetrics/_index.md b/english/cpp/aspose.words.layout/layoutoptions/set_keeporiginalfontmetrics/_index.md index 55e47d54635..61bd3e03f51 100644 --- a/english/cpp/aspose.words.layout/layoutoptions/set_keeporiginalfontmetrics/_index.md +++ b/english/cpp/aspose.words.layout/layoutoptions/set_keeporiginalfontmetrics/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Layout::LayoutOptions::set_KeepOriginalFontMetrics method linktitle: set_KeepOriginalFontMetrics second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Layout::LayoutOptions::set_KeepOriginalFontMetrics method. Sets an indication of whether the original font metrics should be used after font substitution. Default is true in C++.' +description: 'Aspose::Words::Layout::LayoutOptions::set_KeepOriginalFontMetrics method. Setter for Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics in C++.' type: docs weight: 16500 url: /cpp/aspose.words.layout/layoutoptions/set_keeporiginalfontmetrics/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.layout/layoutoptions/set_keeporiginalfontmetrics/ ## LayoutOptions::set_KeepOriginalFontMetrics method -Sets an indication of whether the original font metrics should be used after font substitution. Default is **true**. +Setter for [Aspose::Words::Layout::LayoutOptions::get_KeepOriginalFontMetrics](../get_keeporiginalfontmetrics/). ```cpp void Aspose::Words::Layout::LayoutOptions::set_KeepOriginalFontMetrics(bool value) diff --git a/english/cpp/aspose.words.loading/documentdirection/_index.md b/english/cpp/aspose.words.loading/documentdirection/_index.md index 9fc4415c610..48b8a5156e9 100644 --- a/english/cpp/aspose.words.loading/documentdirection/_index.md +++ b/english/cpp/aspose.words.loading/documentdirection/_index.md @@ -24,6 +24,33 @@ enum class DocumentDirection | RightToLeft | 1 | Right to left direction. | | Auto | 2 | Auto-detect direction. | + +## Examples + + + +Shows how to detect plaintext document text direction. +```cpp +// Create a "TxtLoadOptions" object, which we can pass to a document's constructor +// to modify how we load a plaintext document. +auto loadOptions = System::MakeObject(); + +// Set the "DocumentDirection" property to "DocumentDirection.Auto" automatically detects +// the direction of every paragraph of text that Aspose.Words loads from plaintext. +// Each paragraph's "Bidi" property will store its direction. +loadOptions->set_DocumentDirection(Aspose::Words::Loading::DocumentDirection::Auto); + +// Detect Hebrew text as right-to-left. +auto doc = System::MakeObject(get_MyDir() + u"Hebrew text.txt", loadOptions); + +ASSERT_TRUE(doc->get_FirstSection()->get_Body()->get_FirstParagraph()->get_ParagraphFormat()->get_Bidi()); + +// Detect English text as right-to-left. +doc = System::MakeObject(get_MyDir() + u"English text.txt", loadOptions); + +ASSERT_FALSE(doc->get_FirstSection()->get_Body()->get_FirstParagraph()->get_ParagraphFormat()->get_Bidi()); +``` + ## See Also * Namespace [Aspose::Words::Loading](../) diff --git a/english/cpp/aspose.words.loading/loadoptions/loadoptions/_index.md b/english/cpp/aspose.words.loading/loadoptions/loadoptions/_index.md index 7491c059238..bbb7af4ea34 100644 --- a/english/cpp/aspose.words.loading/loadoptions/loadoptions/_index.md +++ b/english/cpp/aspose.words.loading/loadoptions/loadoptions/_index.md @@ -67,29 +67,6 @@ Aspose::Words::Loading::LoadOptions::LoadOptions(Aspose::Words::LoadFormat loadF -Shows how save a web page as a .docx file. -```cpp -const System::String url = u"https://products.aspose.com/words/"; - -{ - auto client = System::MakeObject(); - auto bytes = client->DownloadData(url); - { - auto stream = System::MakeObject(bytes); - // The URL is used again as a baseUri to ensure that any relative image paths are retrieved correctly. - auto options = System::MakeObject(Aspose::Words::LoadFormat::Html, u"", url); - - // Load the HTML document from stream and pass the LoadOptions object. - auto doc = System::MakeObject(stream, options); - - // At this stage, we can read and edit the document's contents and then save it to the local file system. - - doc->Save(get_ArtifactsDir() + u"Document.InsertHtmlFromWebPage.docx"); - } -} -``` - - Shows how to specify a base URI when opening an html document. ```cpp // Suppose we want to load an .html document that contains an image linked by a relative URI diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/_index.md index 370e429165d..947c7008e78 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/_index.md @@ -30,13 +30,13 @@ class PdfLoadOptions : public Aspose::Words::Loading::LoadOptions | [get_LanguagePreferences](../loadoptions/get_languagepreferences/)() const | Gets language preferences that will be used when document is loading. | | [get_LoadFormat](../loadoptions/get_loadformat/)() const | Specifies the format of the document to be loaded. Default is [Auto](../../aspose.words/loadformat/). | | [get_MswVersion](../loadoptions/get_mswversion/)() const | Allows to specify that the document loading process should match a specific MS Word version. Default value is [Word2019](../../aspose.words.settings/mswordversion/) | -| [get_PageCount](./get_pagecount/)() const | Gets the number of pages to read. Default is MaxValue which means all pages of the document will be read. | -| [get_PageIndex](./get_pageindex/)() const | Gets the 0-based index of the first page to read. Default is 0. | +| [get_PageCount](./get_pagecount/)() const | Gets or sets the number of pages to read. Default is MaxValue which means all pages of the document will be read. | +| [get_PageIndex](./get_pageindex/)() const | Gets or sets the 0-based index of the first page to read. Default is 0. | | [get_Password](../loadoptions/get_password/)() const | Gets or sets the password for opening an encrypted document. Can be **null** or empty string. Default is **null**. | | [get_PreserveIncludePictureField](../loadoptions/get_preserveincludepicturefield/)() const | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is **false**. | | [get_ProgressCallback](../loadoptions/get_progresscallback/)() const | Called during loading a document and accepts data about loading progress. | | [get_ResourceLoadingCallback](../loadoptions/get_resourceloadingcallback/)() const | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. | -| [get_SkipPdfImages](./get_skippdfimages/)() const | Gets the flag indicating whether images must be skipped while loading PDF document. Default is **false**. | +| [get_SkipPdfImages](./get_skippdfimages/)() const | Gets or sets the flag indicating whether images must be skipped while loading PDF document. Default is **false**. | | [get_TempFolder](../loadoptions/get_tempfolder/)() const | Allows to use temporary files when reading document. By default this property is **null** and no temporary files are used. | | [get_UpdateDirtyFields](../loadoptions/get_updatedirtyfields/)() const | Specifies whether to update the fields with the **dirty** attribute. | | [get_UseSystemLcid](../loadoptions/get_usesystemlcid/)() const | Gets or sets whether to use LCID value obtained from Windows registry to determine page setup default margins. | @@ -55,18 +55,43 @@ class PdfLoadOptions : public Aspose::Words::Loading::LoadOptions | [set_IgnoreOleData](../loadoptions/set_ignoreoledata/)(bool) | Setter for [Aspose::Words::Loading::LoadOptions::get_IgnoreOleData](../loadoptions/get_ignoreoledata/). | | [set_LoadFormat](../loadoptions/set_loadformat/)(Aspose::Words::LoadFormat) | Setter for [Aspose::Words::Loading::LoadOptions::get_LoadFormat](../loadoptions/get_loadformat/). | | [set_MswVersion](../loadoptions/set_mswversion/)(Aspose::Words::Settings::MsWordVersion) | Setter for [Aspose::Words::Loading::LoadOptions::get_MswVersion](../loadoptions/get_mswversion/). | -| [set_PageCount](./set_pagecount/)(int32_t) | Sets the number of pages to read. Default is MaxValue which means all pages of the document will be read. | -| [set_PageIndex](./set_pageindex/)(int32_t) | Sets the 0-based index of the first page to read. Default is 0. | +| [set_PageCount](./set_pagecount/)(int32_t) | Setter for [Aspose::Words::Loading::PdfLoadOptions::get_PageCount](./get_pagecount/). | +| [set_PageIndex](./set_pageindex/)(int32_t) | Setter for [Aspose::Words::Loading::PdfLoadOptions::get_PageIndex](./get_pageindex/). | | [set_Password](../loadoptions/set_password/)(const System::String\&) | Setter for [Aspose::Words::Loading::LoadOptions::get_Password](../loadoptions/get_password/). | | [set_PreserveIncludePictureField](../loadoptions/set_preserveincludepicturefield/)(bool) | Setter for [Aspose::Words::Loading::LoadOptions::get_PreserveIncludePictureField](../loadoptions/get_preserveincludepicturefield/). | | [set_ProgressCallback](../loadoptions/set_progresscallback/)(const System::SharedPtr\\&) | Called during loading a document and accepts data about loading progress. | | [set_ResourceLoadingCallback](../loadoptions/set_resourceloadingcallback/)(const System::SharedPtr\\&) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. | -| [set_SkipPdfImages](./set_skippdfimages/)(bool) | Sets the flag indicating whether images must be skipped while loading PDF document. Default is **false**. | +| [set_SkipPdfImages](./set_skippdfimages/)(bool) | Setter for [Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages](./get_skippdfimages/). | | [set_TempFolder](../loadoptions/set_tempfolder/)(const System::String\&) | Setter for [Aspose::Words::Loading::LoadOptions::get_TempFolder](../loadoptions/get_tempfolder/). | | [set_UpdateDirtyFields](../loadoptions/set_updatedirtyfields/)(bool) | Setter for [Aspose::Words::Loading::LoadOptions::get_UpdateDirtyFields](../loadoptions/get_updatedirtyfields/). | | [set_UseSystemLcid](../loadoptions/set_usesystemlcid/)(bool) | Setter for [Aspose::Words::Loading::LoadOptions::get_UseSystemLcid](../loadoptions/get_usesystemlcid/). | | [set_WarningCallback](../loadoptions/set_warningcallback/)(const System::SharedPtr\\&) | Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. | | static [Type](./type/)() | | + +## Examples + + + +Shows how to skip images during loading PDF files. +```cpp +auto options = System::MakeObject(); +options->set_SkipPdfImages(isSkipPdfImages); +options->set_PageIndex(0); +options->set_PageCount(1); + +auto doc = System::MakeObject(get_MyDir() + u"Images.pdf", options); +System::SharedPtr shapeCollection = doc->GetChildNodes(Aspose::Words::NodeType::Shape, true); + +if (isSkipPdfImages) +{ + ASSERT_EQ(shapeCollection->get_Count(), 0); +} +else +{ + ASSERT_NE(shapeCollection->get_Count(), 0); +} +``` + ## See Also * Class [LoadOptions](../loadoptions/) diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/get_pagecount/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/get_pagecount/_index.md index 1c36d2a1f9f..10b17d6dde9 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/get_pagecount/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/get_pagecount/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Loading::PdfLoadOptions::get_PageCount method linktitle: get_PageCount second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Loading::PdfLoadOptions::get_PageCount method. Gets the number of pages to read. Default is MaxValue which means all pages of the document will be read in C++.' +description: 'Aspose::Words::Loading::PdfLoadOptions::get_PageCount method. Gets or sets the number of pages to read. Default is MaxValue which means all pages of the document will be read in C++.' type: docs weight: 3000 url: /cpp/aspose.words.loading/pdfloadoptions/get_pagecount/ @@ -10,12 +10,37 @@ url: /cpp/aspose.words.loading/pdfloadoptions/get_pagecount/ ## PdfLoadOptions::get_PageCount method -Gets the number of pages to read. Default is MaxValue which means all pages of the document will be read. +Gets or sets the number of pages to read. Default is MaxValue which means all pages of the document will be read. ```cpp int32_t Aspose::Words::Loading::PdfLoadOptions::get_PageCount() const ``` + +## Examples + + + +Shows how to skip images during loading PDF files. +```cpp +auto options = System::MakeObject(); +options->set_SkipPdfImages(isSkipPdfImages); +options->set_PageIndex(0); +options->set_PageCount(1); + +auto doc = System::MakeObject(get_MyDir() + u"Images.pdf", options); +System::SharedPtr shapeCollection = doc->GetChildNodes(Aspose::Words::NodeType::Shape, true); + +if (isSkipPdfImages) +{ + ASSERT_EQ(shapeCollection->get_Count(), 0); +} +else +{ + ASSERT_NE(shapeCollection->get_Count(), 0); +} +``` + ## See Also * Class [PdfLoadOptions](../) diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/get_pageindex/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/get_pageindex/_index.md index 924b2084933..704073945ac 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/get_pageindex/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/get_pageindex/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Loading::PdfLoadOptions::get_PageIndex method linktitle: get_PageIndex second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Loading::PdfLoadOptions::get_PageIndex method. Gets the 0-based index of the first page to read. Default is 0 in C++.' +description: 'Aspose::Words::Loading::PdfLoadOptions::get_PageIndex method. Gets or sets the 0-based index of the first page to read. Default is 0 in C++.' type: docs weight: 4000 url: /cpp/aspose.words.loading/pdfloadoptions/get_pageindex/ @@ -10,12 +10,37 @@ url: /cpp/aspose.words.loading/pdfloadoptions/get_pageindex/ ## PdfLoadOptions::get_PageIndex method -Gets the 0-based index of the first page to read. Default is 0. +Gets or sets the 0-based index of the first page to read. Default is 0. ```cpp int32_t Aspose::Words::Loading::PdfLoadOptions::get_PageIndex() const ``` + +## Examples + + + +Shows how to skip images during loading PDF files. +```cpp +auto options = System::MakeObject(); +options->set_SkipPdfImages(isSkipPdfImages); +options->set_PageIndex(0); +options->set_PageCount(1); + +auto doc = System::MakeObject(get_MyDir() + u"Images.pdf", options); +System::SharedPtr shapeCollection = doc->GetChildNodes(Aspose::Words::NodeType::Shape, true); + +if (isSkipPdfImages) +{ + ASSERT_EQ(shapeCollection->get_Count(), 0); +} +else +{ + ASSERT_NE(shapeCollection->get_Count(), 0); +} +``` + ## See Also * Class [PdfLoadOptions](../) diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/get_skippdfimages/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/get_skippdfimages/_index.md index 3e9743334f9..f0fbe8bb17e 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/get_skippdfimages/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/get_skippdfimages/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages method linktitle: get_SkipPdfImages second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages method. Gets the flag indicating whether images must be skipped while loading PDF document. Default is false in C++.' +description: 'Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages method. Gets or sets the flag indicating whether images must be skipped while loading PDF document. Default is false in C++.' type: docs weight: 5000 url: /cpp/aspose.words.loading/pdfloadoptions/get_skippdfimages/ @@ -10,12 +10,37 @@ url: /cpp/aspose.words.loading/pdfloadoptions/get_skippdfimages/ ## PdfLoadOptions::get_SkipPdfImages method -Gets the flag indicating whether images must be skipped while loading PDF document. Default is **false**. +Gets or sets the flag indicating whether images must be skipped while loading PDF document. Default is **false**. ```cpp bool Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages() const ``` + +## Examples + + + +Shows how to skip images during loading PDF files. +```cpp +auto options = System::MakeObject(); +options->set_SkipPdfImages(isSkipPdfImages); +options->set_PageIndex(0); +options->set_PageCount(1); + +auto doc = System::MakeObject(get_MyDir() + u"Images.pdf", options); +System::SharedPtr shapeCollection = doc->GetChildNodes(Aspose::Words::NodeType::Shape, true); + +if (isSkipPdfImages) +{ + ASSERT_EQ(shapeCollection->get_Count(), 0); +} +else +{ + ASSERT_NE(shapeCollection->get_Count(), 0); +} +``` + ## See Also * Class [PdfLoadOptions](../) diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/set_pagecount/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/set_pagecount/_index.md index b5837dbfa0d..9c9dc393f29 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/set_pagecount/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/set_pagecount/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Loading::PdfLoadOptions::set_PageCount method linktitle: set_PageCount second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Loading::PdfLoadOptions::set_PageCount method. Sets the number of pages to read. Default is MaxValue which means all pages of the document will be read in C++.' +description: 'Aspose::Words::Loading::PdfLoadOptions::set_PageCount method. Setter for Aspose::Words::Loading::PdfLoadOptions::get_PageCount in C++.' type: docs weight: 8000 url: /cpp/aspose.words.loading/pdfloadoptions/set_pagecount/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.loading/pdfloadoptions/set_pagecount/ ## PdfLoadOptions::set_PageCount method -Sets the number of pages to read. Default is MaxValue which means all pages of the document will be read. +Setter for [Aspose::Words::Loading::PdfLoadOptions::get_PageCount](../get_pagecount/). ```cpp void Aspose::Words::Loading::PdfLoadOptions::set_PageCount(int32_t value) diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/set_pageindex/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/set_pageindex/_index.md index a135f702c90..a07b4192398 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/set_pageindex/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/set_pageindex/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Loading::PdfLoadOptions::set_PageIndex method linktitle: set_PageIndex second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Loading::PdfLoadOptions::set_PageIndex method. Sets the 0-based index of the first page to read. Default is 0 in C++.' +description: 'Aspose::Words::Loading::PdfLoadOptions::set_PageIndex method. Setter for Aspose::Words::Loading::PdfLoadOptions::get_PageIndex in C++.' type: docs weight: 9000 url: /cpp/aspose.words.loading/pdfloadoptions/set_pageindex/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.loading/pdfloadoptions/set_pageindex/ ## PdfLoadOptions::set_PageIndex method -Sets the 0-based index of the first page to read. Default is 0. +Setter for [Aspose::Words::Loading::PdfLoadOptions::get_PageIndex](../get_pageindex/). ```cpp void Aspose::Words::Loading::PdfLoadOptions::set_PageIndex(int32_t value) diff --git a/english/cpp/aspose.words.loading/pdfloadoptions/set_skippdfimages/_index.md b/english/cpp/aspose.words.loading/pdfloadoptions/set_skippdfimages/_index.md index 24b13b68d32..83c06e75595 100644 --- a/english/cpp/aspose.words.loading/pdfloadoptions/set_skippdfimages/_index.md +++ b/english/cpp/aspose.words.loading/pdfloadoptions/set_skippdfimages/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Loading::PdfLoadOptions::set_SkipPdfImages method linktitle: set_SkipPdfImages second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Loading::PdfLoadOptions::set_SkipPdfImages method. Sets the flag indicating whether images must be skipped while loading PDF document. Default is false in C++.' +description: 'Aspose::Words::Loading::PdfLoadOptions::set_SkipPdfImages method. Setter for Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages in C++.' type: docs weight: 10000 url: /cpp/aspose.words.loading/pdfloadoptions/set_skippdfimages/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.loading/pdfloadoptions/set_skippdfimages/ ## PdfLoadOptions::set_SkipPdfImages method -Sets the flag indicating whether images must be skipped while loading PDF document. Default is **false**. +Setter for [Aspose::Words::Loading::PdfLoadOptions::get_SkipPdfImages](../get_skippdfimages/). ```cpp void Aspose::Words::Loading::PdfLoadOptions::set_SkipPdfImages(bool value) diff --git a/english/cpp/aspose.words.replacing/replacingargs/_index.md b/english/cpp/aspose.words.replacing/replacingargs/_index.md index bac20f3cd24..4564827d1cf 100644 --- a/english/cpp/aspose.words.replacing/replacingargs/_index.md +++ b/english/cpp/aspose.words.replacing/replacingargs/_index.md @@ -23,6 +23,7 @@ class ReplacingArgs : public System::Object | [get_GroupIndex](./get_groupindex/)() const | Identifies, by index, a captured group in the [Match](./get_match/) that is to be replaced with the [Replacement](./get_replacement/) string. | | [get_GroupName](./get_groupname/)() const | Identifies, by name, a captured group in the [Match](./get_match/) that is to be replaced with the [Replacement](./get_replacement/) string. | | [get_Match](./get_match/)() const | The **Match** resulting from a single regular expression match during a **Replace**. | +| [get_MatchEndNode](./get_matchendnode/)() const | Gets the node that contains the end of the match. | | [get_MatchNode](./get_matchnode/)() const | Gets the node that contains the beginning of the match. | | [get_MatchOffset](./get_matchoffset/)() const | Gets the zero-based starting position of the match from the start of the node that contains the beginning of the match. | | [get_Replacement](./get_replacement/)() const | Gets the replacement string. | diff --git a/english/cpp/aspose.words.replacing/replacingargs/get_matchendnode/_index.md b/english/cpp/aspose.words.replacing/replacingargs/get_matchendnode/_index.md new file mode 100644 index 00000000000..ddb6f058e05 --- /dev/null +++ b/english/cpp/aspose.words.replacing/replacingargs/get_matchendnode/_index.md @@ -0,0 +1,24 @@ +--- +title: Aspose::Words::Replacing::ReplacingArgs::get_MatchEndNode method +linktitle: get_MatchEndNode +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::Replacing::ReplacingArgs::get_MatchEndNode method. Gets the node that contains the end of the match in C++.' +type: docs +weight: 4500 +url: /cpp/aspose.words.replacing/replacingargs/get_matchendnode/ +--- +## ReplacingArgs::get_MatchEndNode method + + +Gets the node that contains the end of the match. + +```cpp +const System::SharedPtr & Aspose::Words::Replacing::ReplacingArgs::get_MatchEndNode() const +``` + +## See Also + +* Class [Node](../../../aspose.words/node/) +* Class [ReplacingArgs](../) +* Namespace [Aspose::Words::Replacing](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.replacing/replacingargs/get_matchnode/_index.md b/english/cpp/aspose.words.replacing/replacingargs/get_matchnode/_index.md index b03e91b47fe..5bc36bda688 100644 --- a/english/cpp/aspose.words.replacing/replacingargs/get_matchnode/_index.md +++ b/english/cpp/aspose.words.replacing/replacingargs/get_matchnode/_index.md @@ -13,7 +13,7 @@ url: /cpp/aspose.words.replacing/replacingargs/get_matchnode/ Gets the node that contains the beginning of the match. ```cpp -System::SharedPtr Aspose::Words::Replacing::ReplacingArgs::get_MatchNode() const +const System::SharedPtr & Aspose::Words::Replacing::ReplacingArgs::get_MatchNode() const ``` ## See Also diff --git a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/_index.md b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/_index.md index 17989dedf33..9e9f0251b86 100644 --- a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/_index.md +++ b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/_index.md @@ -73,7 +73,7 @@ class HtmlFixedSaveOptions : public Aspose::Words::Saving::FixedPageSaveOptions | [Is](./is/)(const System::TypeInfo\&) const override | | | [set_AllowEmbeddingPostScriptFonts](../saveoptions/set_allowembeddingpostscriptfonts/)(bool) | Setter for [Aspose::Words::Saving::SaveOptions::get_AllowEmbeddingPostScriptFonts](../saveoptions/get_allowembeddingpostscriptfonts/). | | [set_ColorMode](../fixedpagesaveoptions/set_colormode/)(Aspose::Words::Saving::ColorMode) | Sets a value determining how colors are rendered. | -| [set_CssClassNamesPrefix](./set_cssclassnamesprefix/)(const System::String\&) | Specifies prefix which is added to all class names in style.css file. Default value is **%"aw"**. | +| [set_CssClassNamesPrefix](./set_cssclassnamesprefix/)(const System::String\&) | Setter for [Aspose::Words::Saving::HtmlFixedSaveOptions::get_CssClassNamesPrefix](./get_cssclassnamesprefix/). | | [set_CustomTimeZoneInfo](../saveoptions/set_customtimezoneinfo/)(const System::SharedPtr\\&) | Setter for [Aspose::Words::Saving::SaveOptions::get_CustomTimeZoneInfo](../saveoptions/get_customtimezoneinfo/). | | [set_DefaultTemplate](../saveoptions/set_defaulttemplate/)(const System::String\&) | Setter for [Aspose::Words::Saving::SaveOptions::get_DefaultTemplate](../saveoptions/get_defaulttemplate/). | | [set_Dml3DEffectsRenderingMode](../saveoptions/set_dml3deffectsrenderingmode/)(Aspose::Words::Saving::Dml3DEffectsRenderingMode) | Sets a value determining how 3D effects are rendered. | diff --git a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_cssclassnamesprefix/_index.md b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_cssclassnamesprefix/_index.md index 25106252530..2efcc3db589 100644 --- a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_cssclassnamesprefix/_index.md +++ b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_cssclassnamesprefix/_index.md @@ -16,6 +16,30 @@ Specifies prefix which is added to all class names in style.css file. Default va System::String Aspose::Words::Saving::HtmlFixedSaveOptions::get_CssClassNamesPrefix() const ``` + +## Examples + + + +Shows how to place CSS into a separate file and add a prefix to all of its CSS class names. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Bookmarks.docx"); + +auto htmlFixedSaveOptions = System::MakeObject(); +htmlFixedSaveOptions->set_CssClassNamesPrefix(u"myprefix"); +htmlFixedSaveOptions->set_SaveFontFaceCssSeparately(true); + +doc->Save(get_ArtifactsDir() + u"HtmlFixedSaveOptions.AddCssClassNamesPrefix.html", htmlFixedSaveOptions); + +System::String outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlFixedSaveOptions.AddCssClassNamesPrefix.html"); + +ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, System::String(u"
") + u"
" + u"")->get_Success()); + +outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlFixedSaveOptions.AddCssClassNamesPrefix/styles.css"); + +ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, System::String(u".myprefixdiv { position:absolute; } ") + u".myprefixspan { position:absolute; white-space:pre; color:#000000; font-size:12pt; }")->get_Success()); +``` + ## See Also * Class [HtmlFixedSaveOptions](../) diff --git a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_encoding/_index.md b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_encoding/_index.md index ffe3c957d3e..c770b99bf0e 100644 --- a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_encoding/_index.md +++ b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_encoding/_index.md @@ -31,7 +31,7 @@ builder->Writeln(u"Hello World!"); // The default encoding is UTF-8. If we want to represent our document using a different encoding, // we can use a SaveOptions object to set a specific encoding. auto htmlFixedSaveOptions = System::MakeObject(); -htmlFixedSaveOptions->set_Encoding(System::Text::Encoding::GetEncoding(u"ASCII")); +htmlFixedSaveOptions->set_Encoding(System::Text::Encoding::get_ASCII()); ASSERT_EQ(u"US-ASCII", htmlFixedSaveOptions->get_Encoding()->get_EncodingName()); diff --git a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_optimizeoutput/_index.md b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_optimizeoutput/_index.md index 05d31df170b..b2aae5b8fd6 100644 --- a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_optimizeoutput/_index.md +++ b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_optimizeoutput/_index.md @@ -16,6 +16,24 @@ Flag indicates whether it is required to optimize output. If this flag is set re bool Aspose::Words::Saving::HtmlFixedSaveOptions::get_OptimizeOutput() override ``` + +## Examples + + + +Shows how to simplify a document when saving it to HTML by removing various redundant objects. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Rendering.docx"); + +auto saveOptions = System::MakeObject(); +saveOptions->set_OptimizeOutput(optimizeOutput); + +doc->Save(get_ArtifactsDir() + u"HtmlFixedSaveOptions.OptimizeGraphicsOutput.html", saveOptions); + +// The size of the optimized version of the document is almost a third of the size of the unoptimized document. +ASSERT_NEAR(optimizeOutput ? 60385 : 191000, System::MakeObject(get_ArtifactsDir() + u"HtmlFixedSaveOptions.OptimizeGraphicsOutput.html")->get_Length(), 200); +``` + ## See Also * Class [HtmlFixedSaveOptions](../) diff --git a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_savefontfacecssseparately/_index.md b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_savefontfacecssseparately/_index.md index ede7e6023d6..7f0000596c2 100644 --- a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_savefontfacecssseparately/_index.md +++ b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/get_savefontfacecssseparately/_index.md @@ -16,6 +16,30 @@ Flag indicates whether "@font-face" CSS rules should be placed into a separate f bool Aspose::Words::Saving::HtmlFixedSaveOptions::get_SaveFontFaceCssSeparately() const ``` + +## Examples + + + +Shows how to place CSS into a separate file and add a prefix to all of its CSS class names. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Bookmarks.docx"); + +auto htmlFixedSaveOptions = System::MakeObject(); +htmlFixedSaveOptions->set_CssClassNamesPrefix(u"myprefix"); +htmlFixedSaveOptions->set_SaveFontFaceCssSeparately(true); + +doc->Save(get_ArtifactsDir() + u"HtmlFixedSaveOptions.AddCssClassNamesPrefix.html", htmlFixedSaveOptions); + +System::String outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlFixedSaveOptions.AddCssClassNamesPrefix.html"); + +ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, System::String(u"
") + u"
" + u"")->get_Success()); + +outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlFixedSaveOptions.AddCssClassNamesPrefix/styles.css"); + +ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, System::String(u".myprefixdiv { position:absolute; } ") + u".myprefixspan { position:absolute; white-space:pre; color:#000000; font-size:12pt; }")->get_Success()); +``` + ## See Also * Class [HtmlFixedSaveOptions](../) diff --git a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/set_cssclassnamesprefix/_index.md b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/set_cssclassnamesprefix/_index.md index 99bd58611e2..c2e474e56ac 100644 --- a/english/cpp/aspose.words.saving/htmlfixedsaveoptions/set_cssclassnamesprefix/_index.md +++ b/english/cpp/aspose.words.saving/htmlfixedsaveoptions/set_cssclassnamesprefix/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::Saving::HtmlFixedSaveOptions::set_CssClassNamesPrefix method linktitle: set_CssClassNamesPrefix second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Saving::HtmlFixedSaveOptions::set_CssClassNamesPrefix method. Specifies prefix which is added to all class names in style.css file. Default value is %"aw" in C++.' +description: 'Aspose::Words::Saving::HtmlFixedSaveOptions::set_CssClassNamesPrefix method. Setter for Aspose::Words::Saving::HtmlFixedSaveOptions::get_CssClassNamesPrefix in C++.' type: docs weight: 23000 url: /cpp/aspose.words.saving/htmlfixedsaveoptions/set_cssclassnamesprefix/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words.saving/htmlfixedsaveoptions/set_cssclassnamesprefix/ ## HtmlFixedSaveOptions::set_CssClassNamesPrefix method -Specifies prefix which is added to all class names in style.css file. Default value is **%"aw"**. +Setter for [Aspose::Words::Saving::HtmlFixedSaveOptions::get_CssClassNamesPrefix](../get_cssclassnamesprefix/). ```cpp void Aspose::Words::Saving::HtmlFixedSaveOptions::set_CssClassNamesPrefix(const System::String &value) diff --git a/english/cpp/aspose.words.saving/htmlsaveoptions/get_exportxhtmltransitional/_index.md b/english/cpp/aspose.words.saving/htmlsaveoptions/get_exportxhtmltransitional/_index.md index 2d35c497a3e..74f7d93fe28 100644 --- a/english/cpp/aspose.words.saving/htmlsaveoptions/get_exportxhtmltransitional/_index.md +++ b/english/cpp/aspose.words.saving/htmlsaveoptions/get_exportxhtmltransitional/_index.md @@ -55,10 +55,11 @@ doc->Save(get_ArtifactsDir() + u"HtmlSaveOptions.ExportXhtmlTransitional.html", // Our document will only contain a DOCTYPE declaration heading if we have set the "ExportXhtmlTransitional" flag to "true". System::String outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlSaveOptions.ExportXhtmlTransitional.html"); +System::String newLine = System::Environment::get_NewLine(); if (showDoctypeDeclaration) { - ASSERT_TRUE(outDocContents.Contains(System::String(u"\r\n") + u"\r\n" + u"")); + ASSERT_TRUE(outDocContents.Contains(System::String::Format(u"{0}", newLine) + System::String::Format(u"{0}", newLine) + u"")); } else { diff --git a/english/cpp/aspose.words.saving/htmlsaveoptions/get_htmlversion/_index.md b/english/cpp/aspose.words.saving/htmlsaveoptions/get_htmlversion/_index.md index 6be1dd4de02..8494f0f2d87 100644 --- a/english/cpp/aspose.words.saving/htmlsaveoptions/get_htmlversion/_index.md +++ b/english/cpp/aspose.words.saving/htmlsaveoptions/get_htmlversion/_index.md @@ -68,10 +68,11 @@ doc->Save(get_ArtifactsDir() + u"HtmlSaveOptions.ExportXhtmlTransitional.html", // Our document will only contain a DOCTYPE declaration heading if we have set the "ExportXhtmlTransitional" flag to "true". System::String outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlSaveOptions.ExportXhtmlTransitional.html"); +System::String newLine = System::Environment::get_NewLine(); if (showDoctypeDeclaration) { - ASSERT_TRUE(outDocContents.Contains(System::String(u"\r\n") + u"\r\n" + u"")); + ASSERT_TRUE(outDocContents.Contains(System::String::Format(u"{0}", newLine) + System::String::Format(u"{0}", newLine) + u"")); } else { diff --git a/english/cpp/aspose.words.saving/htmlsaveoptions/get_scaleimagetoshapesize/_index.md b/english/cpp/aspose.words.saving/htmlsaveoptions/get_scaleimagetoshapesize/_index.md index ae768d29ecf..afb5864c506 100644 --- a/english/cpp/aspose.words.saving/htmlsaveoptions/get_scaleimagetoshapesize/_index.md +++ b/english/cpp/aspose.words.saving/htmlsaveoptions/get_scaleimagetoshapesize/_index.md @@ -29,6 +29,34 @@ In general, browsers do quick and poor quality scaling. As a result, you will no In addition to shapes containing individual raster images, this option also affects group shapes consisting of raster images. If [ScaleImageToShapeSize](./) is **false** and a group shape contains raster images whose intrinsic resolution is higher than the value specified in [ImageResolution](../get_imageresolution/), Aspose.Words will increase rendering resolution for that group. This allows to better preserve quality of grouped high resolution images when saving to HTML. +## Examples + + + +Shows how to disable the scaling of images to their parent shape dimensions when saving to .html. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Insert a shape which contains an image, and then make that shape considerably smaller than the image. +System::SharedPtr imageShape = builder->InsertImage(get_ImageDir() + u"Transparent background logo.png"); +imageShape->set_Width(50); +imageShape->set_Height(50); + +// Saving a document that contains shapes with images to HTML will create an image file in the local file system +// for each such shape. The output HTML document will use tags to link to and display these images. +// When we save the document to HTML, we can pass a SaveOptions object to determine +// whether to scale all images that are inside shapes to the sizes of their shapes. +// Setting the "ScaleImageToShapeSize" flag to "true" will shrink every image +// to the size of the shape that contains it, so that no saved images will be larger than the document requires them to be. +// Setting the "ScaleImageToShapeSize" flag to "false" will preserve these images' original sizes, +// which will take up more space in exchange for preserving image quality. +auto options = System::MakeObject(); +options->set_ScaleImageToShapeSize(scaleImageToShapeSize); + +doc->Save(get_ArtifactsDir() + u"HtmlSaveOptions.ScaleImageToShapeSize.html", options); +``` + ## See Also * Class [HtmlSaveOptions](../) diff --git a/english/cpp/aspose.words.saving/htmlversion/_index.md b/english/cpp/aspose.words.saving/htmlversion/_index.md index eec576a40ca..9017c70ad94 100644 --- a/english/cpp/aspose.words.saving/htmlversion/_index.md +++ b/english/cpp/aspose.words.saving/htmlversion/_index.md @@ -75,10 +75,11 @@ doc->Save(get_ArtifactsDir() + u"HtmlSaveOptions.ExportXhtmlTransitional.html", // Our document will only contain a DOCTYPE declaration heading if we have set the "ExportXhtmlTransitional" flag to "true". System::String outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlSaveOptions.ExportXhtmlTransitional.html"); +System::String newLine = System::Environment::get_NewLine(); if (showDoctypeDeclaration) { - ASSERT_TRUE(outDocContents.Contains(System::String(u"\r\n") + u"\r\n" + u"")); + ASSERT_TRUE(outDocContents.Contains(System::String::Format(u"{0}", newLine) + System::String::Format(u"{0}", newLine) + u"")); } else { diff --git a/english/cpp/aspose.words.saving/imagecolormode/_index.md b/english/cpp/aspose.words.saving/imagecolormode/_index.md index 160d9d2c412..8ebcea767c7 100644 --- a/english/cpp/aspose.words.saving/imagecolormode/_index.md +++ b/english/cpp/aspose.words.saving/imagecolormode/_index.md @@ -24,6 +24,34 @@ enum class ImageColorMode | Grayscale | 1 | The pages of the document will be rendered as grayscale images. | | BlackAndWhite | 2 | The pages of the document will be rendered as black and white images. | + +## Examples + + + +Shows how to set a color mode when rendering documents. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->get_ParagraphFormat()->set_Style(doc->get_Styles()->idx_get(u"Heading 1")); +builder->Writeln(u"Hello world!"); +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// When we save the document as an image, we can pass a SaveOptions object to +// select a color mode for the image that the saving operation will generate. +// If we set the "ImageColorMode" property to "ImageColorMode.BlackAndWhite", +// the saving operation will apply grayscale color reduction while rendering the document. +// If we set the "ImageColorMode" property to "ImageColorMode.Grayscale", +// the saving operation will render the document into a monochrome image. +// If we set the "ImageColorMode" property to "None", the saving operation will apply the default method +// and preserve all the document's colors in the output image. +auto imageSaveOptions = System::MakeObject(Aspose::Words::SaveFormat::Png); +imageSaveOptions->set_ImageColorMode(imageColorMode); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.ColorMode.png", imageSaveOptions); +``` + ## See Also * Namespace [Aspose::Words::Saving](../) diff --git a/english/cpp/aspose.words.saving/imagepixelformat/_index.md b/english/cpp/aspose.words.saving/imagepixelformat/_index.md index 383ec25ef51..20484214df5 100644 --- a/english/cpp/aspose.words.saving/imagepixelformat/_index.md +++ b/english/cpp/aspose.words.saving/imagepixelformat/_index.md @@ -32,6 +32,32 @@ enum class ImagePixelFormat | Format64BppPArgb | 9 | 64 bits per pixel, ARGB, premultiplied alpha. | | Format1bppIndexed | 10 | 1 bit per pixel, Indexed. | + +## Examples + + + +Shows how to select a bit-per-pixel rate with which to render a document to an image. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->get_ParagraphFormat()->set_Style(doc->get_Styles()->idx_get(u"Heading 1")); +builder->Writeln(u"Hello world!"); +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// When we save the document as an image, we can pass a SaveOptions object to +// select a pixel format for the image that the saving operation will generate. +// Various bit per pixel rates will affect the quality and file size of the generated image. +auto imageSaveOptions = System::MakeObject(Aspose::Words::SaveFormat::Png); +imageSaveOptions->set_PixelFormat(imagePixelFormat); + +// We can clone ImageSaveOptions instances. +ASPOSE_ASSERT_NE(imageSaveOptions, imageSaveOptions->Clone()); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.PixelFormat.png", imageSaveOptions); +``` + ## See Also * Namespace [Aspose::Words::Saving](../) diff --git a/english/cpp/aspose.words.saving/imagesaveoptions/clone/_index.md b/english/cpp/aspose.words.saving/imagesaveoptions/clone/_index.md index 7a666772679..586990cfb71 100644 --- a/english/cpp/aspose.words.saving/imagesaveoptions/clone/_index.md +++ b/english/cpp/aspose.words.saving/imagesaveoptions/clone/_index.md @@ -16,6 +16,32 @@ Creates a deep clone of this object. System::SharedPtr Aspose::Words::Saving::ImageSaveOptions::Clone() ``` + +## Examples + + + +Shows how to select a bit-per-pixel rate with which to render a document to an image. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->get_ParagraphFormat()->set_Style(doc->get_Styles()->idx_get(u"Heading 1")); +builder->Writeln(u"Hello world!"); +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// When we save the document as an image, we can pass a SaveOptions object to +// select a pixel format for the image that the saving operation will generate. +// Various bit per pixel rates will affect the quality and file size of the generated image. +auto imageSaveOptions = System::MakeObject(Aspose::Words::SaveFormat::Png); +imageSaveOptions->set_PixelFormat(imagePixelFormat); + +// We can clone ImageSaveOptions instances. +ASPOSE_ASSERT_NE(imageSaveOptions, imageSaveOptions->Clone()); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.PixelFormat.png", imageSaveOptions); +``` + ## See Also * Class [ImageSaveOptions](../) diff --git a/english/cpp/aspose.words.saving/imagesaveoptions/get_imagecolormode/_index.md b/english/cpp/aspose.words.saving/imagesaveoptions/get_imagecolormode/_index.md index 43d0b622216..1872774f008 100644 --- a/english/cpp/aspose.words.saving/imagesaveoptions/get_imagecolormode/_index.md +++ b/english/cpp/aspose.words.saving/imagesaveoptions/get_imagecolormode/_index.md @@ -21,7 +21,35 @@ Aspose::Words::Saving::ImageColorMode Aspose::Words::Saving::ImageSaveOptions::g This property has effect only when saving to raster image formats. -The default value is [None](../../imagecolormode/). +The default value is [None](../../imagecolormode/). + +## Examples + + + +Shows how to set a color mode when rendering documents. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->get_ParagraphFormat()->set_Style(doc->get_Styles()->idx_get(u"Heading 1")); +builder->Writeln(u"Hello world!"); +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// When we save the document as an image, we can pass a SaveOptions object to +// select a color mode for the image that the saving operation will generate. +// If we set the "ImageColorMode" property to "ImageColorMode.BlackAndWhite", +// the saving operation will apply grayscale color reduction while rendering the document. +// If we set the "ImageColorMode" property to "ImageColorMode.Grayscale", +// the saving operation will render the document into a monochrome image. +// If we set the "ImageColorMode" property to "None", the saving operation will apply the default method +// and preserve all the document's colors in the output image. +auto imageSaveOptions = System::MakeObject(Aspose::Words::SaveFormat::Png); +imageSaveOptions->set_ImageColorMode(imageColorMode); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.ColorMode.png", imageSaveOptions); +``` + ## See Also * Enum [ImageColorMode](../../imagecolormode/) diff --git a/english/cpp/aspose.words.saving/imagesaveoptions/get_pagelayout/_index.md b/english/cpp/aspose.words.saving/imagesaveoptions/get_pagelayout/_index.md index 1a6a8963951..1aa1377ee07 100644 --- a/english/cpp/aspose.words.saving/imagesaveoptions/get_pagelayout/_index.md +++ b/english/cpp/aspose.words.saving/imagesaveoptions/get_pagelayout/_index.md @@ -40,8 +40,8 @@ auto options = System::MakeObject(Aspos options->set_PageLayout(Aspose::Words::Saving::MultiPageLayout::Grid(3, 10.0f, 10.0f)); // Alternative layouts: -// options.MultiPageLayout = MultiPageLayout.Horizontal(10); -// options.MultiPageLayout = MultiPageLayout.Vertical(10); +// options.PageLayout = MultiPageLayout.Horizontal(10); +// options.PageLayout = MultiPageLayout.Vertical(10); // Customize the background and border. options->get_PageLayout()->set_BackColor(System::Drawing::Color::get_LightGray()); diff --git a/english/cpp/aspose.words.saving/imagesaveoptions/get_pixelformat/_index.md b/english/cpp/aspose.words.saving/imagesaveoptions/get_pixelformat/_index.md index 72cd610503a..26ca0617093 100644 --- a/english/cpp/aspose.words.saving/imagesaveoptions/get_pixelformat/_index.md +++ b/english/cpp/aspose.words.saving/imagesaveoptions/get_pixelformat/_index.md @@ -23,7 +23,33 @@ This property has effect only when saving to raster image formats. The default value is [Format32BppArgb](../../imagepixelformat/). -Pixel format of the output image may differ from the set value because of work of GDI+. +Pixel format of the output image may differ from the set value because of work of GDI+. + +## Examples + + + +Shows how to select a bit-per-pixel rate with which to render a document to an image. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->get_ParagraphFormat()->set_Style(doc->get_Styles()->idx_get(u"Heading 1")); +builder->Writeln(u"Hello world!"); +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// When we save the document as an image, we can pass a SaveOptions object to +// select a pixel format for the image that the saving operation will generate. +// Various bit per pixel rates will affect the quality and file size of the generated image. +auto imageSaveOptions = System::MakeObject(Aspose::Words::SaveFormat::Png); +imageSaveOptions->set_PixelFormat(imagePixelFormat); + +// We can clone ImageSaveOptions instances. +ASPOSE_ASSERT_NE(imageSaveOptions, imageSaveOptions->Clone()); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.PixelFormat.png", imageSaveOptions); +``` + ## See Also * Enum [ImagePixelFormat](../../imagepixelformat/) diff --git a/english/cpp/aspose.words.saving/imagesaveoptions/get_tiffcompression/_index.md b/english/cpp/aspose.words.saving/imagesaveoptions/get_tiffcompression/_index.md index 918098a3617..3d3730e5782 100644 --- a/english/cpp/aspose.words.saving/imagesaveoptions/get_tiffcompression/_index.md +++ b/english/cpp/aspose.words.saving/imagesaveoptions/get_tiffcompression/_index.md @@ -21,7 +21,33 @@ Aspose::Words::Saving::TiffCompression Aspose::Words::Saving::ImageSaveOptions:: Has effect only when saving to TIFF. -The default value is [Lzw](../../tiffcompression/). +The default value is [Lzw](../../tiffcompression/). + +## Examples + + + +Shows how to select the compression scheme to apply to a document that we convert into a TIFF image. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// Create an "ImageSaveOptions" object which we can pass to the document's "Save" method +// to modify the way in which that method renders the document into an image. +auto options = System::MakeObject(Aspose::Words::SaveFormat::Tiff); +// Set the "TiffCompression" property to "TiffCompression.None" to apply no compression while saving, +// which may result in a very large output file. +// Set the "TiffCompression" property to "TiffCompression.Rle" to apply RLE compression +// Set the "TiffCompression" property to "TiffCompression.Lzw" to apply LZW compression. +// Set the "TiffCompression" property to "TiffCompression.Ccitt3" to apply CCITT3 compression. +// Set the "TiffCompression" property to "TiffCompression.Ccitt4" to apply CCITT4 compression. +options->set_TiffCompression(tiffCompression); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.TiffImageCompression.tiff", options); +``` + ## See Also * Enum [TiffCompression](../../tiffcompression/) diff --git a/english/cpp/aspose.words.saving/multipagelayout/_index.md b/english/cpp/aspose.words.saving/multipagelayout/_index.md index 35076041675..ea07e55344d 100644 --- a/english/cpp/aspose.words.saving/multipagelayout/_index.md +++ b/english/cpp/aspose.words.saving/multipagelayout/_index.md @@ -50,8 +50,8 @@ auto options = System::MakeObject(Aspos options->set_PageLayout(Aspose::Words::Saving::MultiPageLayout::Grid(3, 10.0f, 10.0f)); // Alternative layouts: -// options.MultiPageLayout = MultiPageLayout.Horizontal(10); -// options.MultiPageLayout = MultiPageLayout.Vertical(10); +// options.PageLayout = MultiPageLayout.Horizontal(10); +// options.PageLayout = MultiPageLayout.Vertical(10); // Customize the background and border. options->get_PageLayout()->set_BackColor(System::Drawing::Color::get_LightGray()); diff --git a/english/cpp/aspose.words.saving/pdfsaveoptions/_index.md b/english/cpp/aspose.words.saving/pdfsaveoptions/_index.md index 06de2339569..cffd143044a 100644 --- a/english/cpp/aspose.words.saving/pdfsaveoptions/_index.md +++ b/english/cpp/aspose.words.saving/pdfsaveoptions/_index.md @@ -40,7 +40,6 @@ class PdfSaveOptions : public Aspose::Words::Saving::FixedPageSaveOptions | [get_DmlEffectsRenderingMode](./get_dmleffectsrenderingmode/)() override | Gets or sets a value determining how DrawingML effects are rendered. | | [get_DmlRenderingMode](../saveoptions/get_dmlrenderingmode/)() const | Gets or sets a value determining how DrawingML shapes are rendered. | | [get_DownsampleOptions](./get_downsampleoptions/)() const | Allows to specify downsample options. | -| [get_EmbedAttachments](./get_embedattachments/)() | Gets or sets a value determining whether or not to embed attachments to the PDF document. | | [get_EmbedFullFonts](./get_embedfullfonts/)() const | Controls how fonts are embedded into the resulting PDF documents. | | [get_EncryptionDetails](./get_encryptiondetails/)() const | Gets or sets the details for encrypting the output PDF document. | | [get_ExportDocumentStructure](./get_exportdocumentstructure/)() const | Gets or sets a value determining whether or not to export document structure. | @@ -104,7 +103,6 @@ class PdfSaveOptions : public Aspose::Words::Saving::FixedPageSaveOptions | [set_DmlEffectsRenderingMode](./set_dmleffectsrenderingmode/)(Aspose::Words::Saving::DmlEffectsRenderingMode) override | Setter for [Aspose::Words::Saving::PdfSaveOptions::get_DmlEffectsRenderingMode](./get_dmleffectsrenderingmode/). | | [set_DmlRenderingMode](../saveoptions/set_dmlrenderingmode/)(Aspose::Words::Saving::DmlRenderingMode) | Setter for [Aspose::Words::Saving::SaveOptions::get_DmlRenderingMode](../saveoptions/get_dmlrenderingmode/). | | [set_DownsampleOptions](./set_downsampleoptions/)(const System::SharedPtr\\&) | Allows to specify downsample options. | -| [set_EmbedAttachments](./set_embedattachments/)(bool) | Setter for [Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments](./get_embedattachments/). | | [set_EmbedFullFonts](./set_embedfullfonts/)(bool) | Setter for [Aspose::Words::Saving::PdfSaveOptions::get_EmbedFullFonts](./get_embedfullfonts/). | | [set_EncryptionDetails](./set_encryptiondetails/)(const System::SharedPtr\\&) | Setter for [Aspose::Words::Saving::PdfSaveOptions::get_EncryptionDetails](./get_encryptiondetails/). | | [set_ExportDocumentStructure](./set_exportdocumentstructure/)(bool) | Setter for [Aspose::Words::Saving::PdfSaveOptions::get_ExportDocumentStructure](./get_exportdocumentstructure/). | diff --git a/english/cpp/aspose.words.saving/pdfsaveoptions/get_embedattachments/_index.md b/english/cpp/aspose.words.saving/pdfsaveoptions/get_embedattachments/_index.md deleted file mode 100644 index e06d811f977..00000000000 --- a/english/cpp/aspose.words.saving/pdfsaveoptions/get_embedattachments/_index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments method -linktitle: get_EmbedAttachments -second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments method. Gets or sets a value determining whether or not to embed attachments to the PDF document in C++.' -type: docs -weight: 13000 -url: /cpp/aspose.words.saving/pdfsaveoptions/get_embedattachments/ ---- -## PdfSaveOptions::get_EmbedAttachments method - - -Gets or sets a value determining whether or not to embed attachments to the PDF document. - -```cpp -bool Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments() -``` - -## Remarks - - -Default value is **false** and attachments are not embedded. - -When the value is **true** attachments are embedded to the PDF document. - -PDF/A-1, PDF/A-2 and PDF/A-4 (not level F) standards do not allow embedded files. **false** value will be used automatically. - -Embedding attachments is not supported when encryption is enabled. **false** value will be used automatically. -## See Also - -* Class [PdfSaveOptions](../) -* Namespace [Aspose::Words::Saving](../../) -* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.saving/pdfsaveoptions/set_embedattachments/_index.md b/english/cpp/aspose.words.saving/pdfsaveoptions/set_embedattachments/_index.md deleted file mode 100644 index 68b51e4bbee..00000000000 --- a/english/cpp/aspose.words.saving/pdfsaveoptions/set_embedattachments/_index.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Aspose::Words::Saving::PdfSaveOptions::set_EmbedAttachments method -linktitle: set_EmbedAttachments -second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::Saving::PdfSaveOptions::set_EmbedAttachments method. Setter for Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments in C++.' -type: docs -weight: 46000 -url: /cpp/aspose.words.saving/pdfsaveoptions/set_embedattachments/ ---- -## PdfSaveOptions::set_EmbedAttachments method - - -Setter for [Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments](../get_embedattachments/). - -```cpp -void Aspose::Words::Saving::PdfSaveOptions::set_EmbedAttachments(bool value) -``` - -## See Also - -* Class [PdfSaveOptions](../) -* Namespace [Aspose::Words::Saving](../../) -* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.saving/saveoptions/get_prettyformat/_index.md b/english/cpp/aspose.words.saving/saveoptions/get_prettyformat/_index.md index 5b98b0e951d..bb0f73d130c 100644 --- a/english/cpp/aspose.words.saving/saveoptions/get_prettyformat/_index.md +++ b/english/cpp/aspose.words.saving/saveoptions/get_prettyformat/_index.md @@ -39,9 +39,10 @@ doc->Save(get_ArtifactsDir() + u"HtmlSaveOptions.PrettyFormat.html", htmlOptions // Enabling pretty format makes the raw html code more readable by adding tab stop and new line characters. System::String html = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlSaveOptions.PrettyFormat.html"); +System::String newLine = System::Environment::get_NewLine(); if (usePrettyFormat) { - ASSERT_EQ(System::String(u"\r\n") + u"\t\r\n" + u"\t\t\r\n" + u"\t\t\r\n" + System::String::Format(u"\t\t\r\n", Aspose::Words::BuildVersionInfo::get_Product(), Aspose::Words::BuildVersionInfo::get_Version()) + u"\t\t\r\n" + u"\t\t\r\n" + u"\t\r\n" + u"\t\r\n" + u"\t\t
\r\n" + u"\t\t\t

\r\n" + u"\t\t\t\tHello world!\r\n" + u"\t\t\t

\r\n" + u"\t\t\t

\r\n" + u"\t\t\t\t \r\n" + u"\t\t\t

\r\n" + u"\t\t
\r\n" + u"\t\r\n", html); + ASSERT_EQ(System::String::Format(u"{0}", newLine) + System::String::Format(u"\t{0}", newLine) + System::String::Format(u"\t\t{0}", newLine) + System::String::Format(u"\t\t{0}", newLine) + System::String::Format(u"\t\t{2}", Aspose::Words::BuildVersionInfo::get_Product(), Aspose::Words::BuildVersionInfo::get_Version(), newLine) + System::String::Format(u"\t\t{0}", newLine) + System::String::Format(u"\t\t{0}", newLine) + System::String::Format(u"\t{0}", newLine) + System::String::Format(u"\t{0}", newLine) + System::String::Format(u"\t\t
{0}", newLine) + System::String::Format(u"\t\t\t

{0}", newLine) + System::String::Format(u"\t\t\t\tHello world!{0}", newLine) + System::String::Format(u"\t\t\t

{0}", newLine) + System::String::Format(u"\t\t\t

{0}", newLine) + System::String::Format(u"\t\t\t\t {0}", newLine) + System::String::Format(u"\t\t\t

{0}", newLine) + System::String::Format(u"\t\t
{0}", newLine) + System::String::Format(u"\t{0}", newLine), html); } else { diff --git a/english/cpp/aspose.words.saving/tiffcompression/_index.md b/english/cpp/aspose.words.saving/tiffcompression/_index.md index 6d5419204b3..5a9e4dc9c2a 100644 --- a/english/cpp/aspose.words.saving/tiffcompression/_index.md +++ b/english/cpp/aspose.words.saving/tiffcompression/_index.md @@ -26,6 +26,32 @@ enum class TiffCompression | Ccitt3 | 3 | Specifies the CCITT3 compression scheme. | | Ccitt4 | 4 | Specifies the CCITT4 compression scheme. | + +## Examples + + + +Shows how to select the compression scheme to apply to a document that we convert into a TIFF image. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// Create an "ImageSaveOptions" object which we can pass to the document's "Save" method +// to modify the way in which that method renders the document into an image. +auto options = System::MakeObject(Aspose::Words::SaveFormat::Tiff); +// Set the "TiffCompression" property to "TiffCompression.None" to apply no compression while saving, +// which may result in a very large output file. +// Set the "TiffCompression" property to "TiffCompression.Rle" to apply RLE compression +// Set the "TiffCompression" property to "TiffCompression.Lzw" to apply LZW compression. +// Set the "TiffCompression" property to "TiffCompression.Ccitt3" to apply CCITT3 compression. +// Set the "TiffCompression" property to "TiffCompression.Ccitt4" to apply CCITT4 compression. +options->set_TiffCompression(tiffCompression); + +doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.TiffImageCompression.tiff", options); +``` + ## See Also * Namespace [Aspose::Words::Saving](../) diff --git a/english/cpp/aspose.words.saving/txtexportheadersfootersmode/_index.md b/english/cpp/aspose.words.saving/txtexportheadersfootersmode/_index.md index 326fdaa5a89..4deafabc6d2 100644 --- a/english/cpp/aspose.words.saving/txtexportheadersfootersmode/_index.md +++ b/english/cpp/aspose.words.saving/txtexportheadersfootersmode/_index.md @@ -68,18 +68,19 @@ doc->Save(get_ArtifactsDir() + u"TxtSaveOptions.ExportHeadersFooters.txt", saveO System::String docText = System::IO::File::ReadAllText(get_ArtifactsDir() + u"TxtSaveOptions.ExportHeadersFooters.txt"); +System::String newLine = System::Environment::get_NewLine(); switch (txtExportHeadersFootersMode) { case Aspose::Words::Saving::TxtExportHeadersFootersMode::AllAtEnd: - ASSERT_EQ(System::String(u"Page 1\r\n") + u"Page 2\r\n" + u"Page 3\r\n" + u"Even header\r\n\r\n" + u"Primary header\r\n\r\n" + u"Even footer\r\n\r\n" + u"Primary footer\r\n\r\n", docText); + ASSERT_EQ(System::String::Format(u"Page 1{0}", newLine) + System::String::Format(u"Page 2{0}", newLine) + System::String::Format(u"Page 3{0}", newLine) + System::String::Format(u"Even header{0}{1}", newLine, newLine) + System::String::Format(u"Primary header{0}{1}", newLine, newLine) + System::String::Format(u"Even footer{0}{1}", newLine, newLine) + System::String::Format(u"Primary footer{0}{1}", newLine, newLine), docText); break; case Aspose::Words::Saving::TxtExportHeadersFootersMode::PrimaryOnly: - ASSERT_EQ(System::String(u"Primary header\r\n") + u"Page 1\r\n" + u"Page 2\r\n" + u"Page 3\r\n" + u"Primary footer\r\n", docText); + ASSERT_EQ(System::String::Format(u"Primary header{0}", newLine) + System::String::Format(u"Page 1{0}", newLine) + System::String::Format(u"Page 2{0}", newLine) + System::String::Format(u"Page 3{0}", newLine) + System::String::Format(u"Primary footer{0}", newLine), docText); break; case Aspose::Words::Saving::TxtExportHeadersFootersMode::None: - ASSERT_EQ(System::String(u"Page 1\r\n") + u"Page 2\r\n" + u"Page 3\r\n", docText); + ASSERT_EQ(System::String::Format(u"Page 1{0}", newLine) + System::String::Format(u"Page 2{0}", newLine) + System::String::Format(u"Page 3{0}", newLine), docText); break; } diff --git a/english/cpp/aspose.words.saving/txtsaveoptions/get_simplifylistlabels/_index.md b/english/cpp/aspose.words.saving/txtsaveoptions/get_simplifylistlabels/_index.md index be03541308f..12e058a30ec 100644 --- a/english/cpp/aspose.words.saving/txtsaveoptions/get_simplifylistlabels/_index.md +++ b/english/cpp/aspose.words.saving/txtsaveoptions/get_simplifylistlabels/_index.md @@ -51,13 +51,14 @@ doc->Save(get_ArtifactsDir() + u"TxtSaveOptions.SimplifyListLabels.txt", txtSave System::String docText = System::IO::File::ReadAllText(get_ArtifactsDir() + u"TxtSaveOptions.SimplifyListLabels.txt"); +System::String newLine = System::Environment::get_NewLine(); if (simplifyListLabels) { - ASSERT_EQ(System::String(u"* Item 1\r\n") + u" > Item 2\r\n" + u" + Item 3\r\n" + u" - Item 4\r\n" + u" o Item 5\r\n", docText); + ASSERT_EQ(System::String::Format(u"* Item 1{0}", newLine) + System::String::Format(u" > Item 2{0}", newLine) + System::String::Format(u" + Item 3{0}", newLine) + System::String::Format(u" - Item 4{0}", newLine) + System::String::Format(u" o Item 5{0}", newLine), docText); } else { - ASSERT_EQ(System::String(u"· Item 1\r\n") + u"o Item 2\r\n" + u"§ Item 3\r\n" + u"· Item 4\r\n" + u"o Item 5\r\n", docText); + ASSERT_EQ(System::String::Format(u"· Item 1{0}", newLine) + System::String::Format(u"o Item 2{0}", newLine) + System::String::Format(u"§ Item 3{0}", newLine) + System::String::Format(u"· Item 4{0}", newLine) + System::String::Format(u"o Item 5{0}", newLine), docText); } ``` diff --git a/english/cpp/aspose.words.saving/txtsaveoptionsbase/get_exportheadersfootersmode/_index.md b/english/cpp/aspose.words.saving/txtsaveoptionsbase/get_exportheadersfootersmode/_index.md index eaf5d1c0421..4654f987fff 100644 --- a/english/cpp/aspose.words.saving/txtsaveoptionsbase/get_exportheadersfootersmode/_index.md +++ b/english/cpp/aspose.words.saving/txtsaveoptionsbase/get_exportheadersfootersmode/_index.md @@ -60,18 +60,19 @@ doc->Save(get_ArtifactsDir() + u"TxtSaveOptions.ExportHeadersFooters.txt", saveO System::String docText = System::IO::File::ReadAllText(get_ArtifactsDir() + u"TxtSaveOptions.ExportHeadersFooters.txt"); +System::String newLine = System::Environment::get_NewLine(); switch (txtExportHeadersFootersMode) { case Aspose::Words::Saving::TxtExportHeadersFootersMode::AllAtEnd: - ASSERT_EQ(System::String(u"Page 1\r\n") + u"Page 2\r\n" + u"Page 3\r\n" + u"Even header\r\n\r\n" + u"Primary header\r\n\r\n" + u"Even footer\r\n\r\n" + u"Primary footer\r\n\r\n", docText); + ASSERT_EQ(System::String::Format(u"Page 1{0}", newLine) + System::String::Format(u"Page 2{0}", newLine) + System::String::Format(u"Page 3{0}", newLine) + System::String::Format(u"Even header{0}{1}", newLine, newLine) + System::String::Format(u"Primary header{0}{1}", newLine, newLine) + System::String::Format(u"Even footer{0}{1}", newLine, newLine) + System::String::Format(u"Primary footer{0}{1}", newLine, newLine), docText); break; case Aspose::Words::Saving::TxtExportHeadersFootersMode::PrimaryOnly: - ASSERT_EQ(System::String(u"Primary header\r\n") + u"Page 1\r\n" + u"Page 2\r\n" + u"Page 3\r\n" + u"Primary footer\r\n", docText); + ASSERT_EQ(System::String::Format(u"Primary header{0}", newLine) + System::String::Format(u"Page 1{0}", newLine) + System::String::Format(u"Page 2{0}", newLine) + System::String::Format(u"Page 3{0}", newLine) + System::String::Format(u"Primary footer{0}", newLine), docText); break; case Aspose::Words::Saving::TxtExportHeadersFootersMode::None: - ASSERT_EQ(System::String(u"Page 1\r\n") + u"Page 2\r\n" + u"Page 3\r\n", docText); + ASSERT_EQ(System::String::Format(u"Page 1{0}", newLine) + System::String::Format(u"Page 2{0}", newLine) + System::String::Format(u"Page 3{0}", newLine), docText); break; } diff --git a/english/cpp/aspose.words.saving/wordml2003saveoptions/_index.md b/english/cpp/aspose.words.saving/wordml2003saveoptions/_index.md index 28995a33cb3..755da3f0030 100644 --- a/english/cpp/aspose.words.saving/wordml2003saveoptions/_index.md +++ b/english/cpp/aspose.words.saving/wordml2003saveoptions/_index.md @@ -94,10 +94,10 @@ options->set_PrettyFormat(prettyFormat); doc->Save(get_ArtifactsDir() + u"WordML2003SaveOptions.PrettyFormat.xml", options); System::String fileContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"WordML2003SaveOptions.PrettyFormat.xml"); - +System::String newLine = System::Environment::get_NewLine(); if (prettyFormat) { - ASSERT_TRUE(fileContents.Contains(System::String(u"\r\n\t\t") + u"1\r\n\t\t" + u"0\r\n\t\t" + u"1\r\n\t\t" + u"0\r\n\t\t" + u"0\r\n\t\t" + u"1\r\n\t\t" + u"1\r\n\t\t" + u"0\r\n\t\t" + u"11.5606\r\n\t" + u"")); + ASSERT_TRUE(fileContents.Contains(System::String::Format(u"{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"11.5606{0}\t", newLine) + u"")); } else { diff --git a/english/cpp/aspose.words.saving/wordml2003saveoptions/get_saveformat/_index.md b/english/cpp/aspose.words.saving/wordml2003saveoptions/get_saveformat/_index.md index 9b78b49370b..c621f79cb8e 100644 --- a/english/cpp/aspose.words.saving/wordml2003saveoptions/get_saveformat/_index.md +++ b/english/cpp/aspose.words.saving/wordml2003saveoptions/get_saveformat/_index.md @@ -41,10 +41,10 @@ options->set_PrettyFormat(prettyFormat); doc->Save(get_ArtifactsDir() + u"WordML2003SaveOptions.PrettyFormat.xml", options); System::String fileContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"WordML2003SaveOptions.PrettyFormat.xml"); - +System::String newLine = System::Environment::get_NewLine(); if (prettyFormat) { - ASSERT_TRUE(fileContents.Contains(System::String(u"\r\n\t\t") + u"1\r\n\t\t" + u"0\r\n\t\t" + u"1\r\n\t\t" + u"0\r\n\t\t" + u"0\r\n\t\t" + u"1\r\n\t\t" + u"1\r\n\t\t" + u"0\r\n\t\t" + u"11.5606\r\n\t" + u"")); + ASSERT_TRUE(fileContents.Contains(System::String::Format(u"{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"1{0}\t\t", newLine) + System::String::Format(u"0{0}\t\t", newLine) + System::String::Format(u"11.5606{0}\t", newLine) + u"")); } else { diff --git a/english/cpp/aspose.words.tables/row/_index.md b/english/cpp/aspose.words.tables/row/_index.md index 0910220412a..067bb5769c9 100644 --- a/english/cpp/aspose.words.tables/row/_index.md +++ b/english/cpp/aspose.words.tables/row/_index.md @@ -35,6 +35,7 @@ class Row : public Aspose::Words::CompositeNode, | [get_FirstCell](./get_firstcell/)() | Returns the first [Cell](../cell/) in the row. | | [get_FirstChild](../../aspose.words/compositenode/get_firstchild/)() const | Gets the first child of the node. | | [get_HasChildNodes](../../aspose.words/compositenode/get_haschildnodes/)() | Returns **true** if this node has any child nodes. | +| [get_Hidden](./get_hidden/)() | Gets or sets a flag indicating whether this row is hidden or not. | | [get_IsComposite](../../aspose.words/compositenode/get_iscomposite/)() override | Returns **true** as this node can have child nodes. | | [get_IsFirstRow](./get_isfirstrow/)() | True if this is the first row in a table; false otherwise. | | [get_IsLastRow](./get_islastrow/)() | True if this is the last row in a table; false otherwise. | @@ -75,6 +76,7 @@ class Row : public Aspose::Words::CompositeNode, | [SelectNodes](../../aspose.words/compositenode/selectnodes/)(const System::String\&) | Selects a list of nodes matching the XPath expression. | | [SelectSingleNode](../../aspose.words/compositenode/selectsinglenode/)(const System::String\&) | Selects the first [Node](../../aspose.words/node/) that matches the XPath expression. | | [set_CustomNodeId](../../aspose.words/node/set_customnodeid/)(int32_t) | Setter for [Aspose::Words::Node::get_CustomNodeId](../../aspose.words/node/get_customnodeid/). | +| [set_Hidden](./set_hidden/)(bool) | Setter for [Aspose::Words::Tables::Row::get_Hidden](./get_hidden/). | | [set_NextNode](../../aspose.words/node/set_nextnode/)(const System::SharedPtr\\&) | | | [set_PrevNode](../../aspose.words/node/set_prevnode/)(const System::SharedPtr\\&) | | | [SetParent](../../aspose.words/node/setparent/)(const System::SharedPtr\\&) | | diff --git a/english/cpp/aspose.words.tables/row/get_hidden/_index.md b/english/cpp/aspose.words.tables/row/get_hidden/_index.md new file mode 100644 index 00000000000..f5b91f29449 --- /dev/null +++ b/english/cpp/aspose.words.tables/row/get_hidden/_index.md @@ -0,0 +1,54 @@ +--- +title: Aspose::Words::Tables::Row::get_Hidden method +linktitle: get_Hidden +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::Tables::Row::get_Hidden method. Gets or sets a flag indicating whether this row is hidden or not in C++.' +type: docs +weight: 6500 +url: /cpp/aspose.words.tables/row/get_hidden/ +--- +## Row::get_Hidden method + + +Gets or sets a flag indicating whether this row is hidden or not. + +```cpp +bool Aspose::Words::Tables::Row::get_Hidden() +``` + + +## Examples + + + +Shows how to hide a table row. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Tables.docx"); + +System::SharedPtr row = doc->get_FirstSection()->get_Body()->get_Tables()->idx_get(0)->get_FirstRow(); +row->set_Hidden(true); + +doc->Save(get_ArtifactsDir() + u"Table.HiddenRow.docx"); + +doc = System::MakeObject(get_ArtifactsDir() + u"Table.HiddenRow.docx"); + +row = doc->get_FirstSection()->get_Body()->get_Tables()->idx_get(0)->get_FirstRow(); +ASSERT_TRUE(row->get_Hidden()); + +for (auto&& cell : System::IterateOver(row->get_Cells())) +{ + for (auto&& para : System::IterateOver(cell->get_Paragraphs())) + { + for (auto&& run : System::IterateOver(para->get_Runs())) + { + ASSERT_TRUE(run->get_Font()->get_Hidden()); + } + } +} +``` + +## See Also + +* Class [Row](../) +* Namespace [Aspose::Words::Tables](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words.tables/row/set_hidden/_index.md b/english/cpp/aspose.words.tables/row/set_hidden/_index.md new file mode 100644 index 00000000000..0bc0ef438ac --- /dev/null +++ b/english/cpp/aspose.words.tables/row/set_hidden/_index.md @@ -0,0 +1,23 @@ +--- +title: Aspose::Words::Tables::Row::set_Hidden method +linktitle: set_Hidden +second_title: Aspose.Words for C++ API Reference +description: 'Aspose::Words::Tables::Row::set_Hidden method. Setter for Aspose::Words::Tables::Row::get_Hidden in C++.' +type: docs +weight: 16000 +url: /cpp/aspose.words.tables/row/set_hidden/ +--- +## Row::set_Hidden method + + +Setter for [Aspose::Words::Tables::Row::get_Hidden](../get_hidden/). + +```cpp +void Aspose::Words::Tables::Row::set_Hidden(bool value) +``` + +## See Also + +* Class [Row](../) +* Namespace [Aspose::Words::Tables](../../) +* Library [Aspose.Words for C++](../../../) diff --git a/english/cpp/aspose.words/breaktype/_index.md b/english/cpp/aspose.words/breaktype/_index.md index b047d1c58ae..c9eb0f42bd7 100644 --- a/english/cpp/aspose.words/breaktype/_index.md +++ b/english/cpp/aspose.words/breaktype/_index.md @@ -35,6 +35,34 @@ enum class BreakType +Shows how to create headers and footers in a document using [DocumentBuilder](../documentbuilder/). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to insert a Table of contents (TOC) into a document using heading styles as entries. ```cpp auto doc = System::MakeObject(); diff --git a/english/cpp/aspose.words/compositenode/selectnodes/_index.md b/english/cpp/aspose.words/compositenode/selectnodes/_index.md index 99e011c453e..3976375ce13 100644 --- a/english/cpp/aspose.words/compositenode/selectnodes/_index.md +++ b/english/cpp/aspose.words/compositenode/selectnodes/_index.md @@ -29,6 +29,58 @@ A list of nodes matching the XPath query. Only expressions with element names are supported at the moment. Expressions that use attribute names are not supported. +## Examples + + + +Shows how to select certain nodes by using an XPath expression. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Tables.docx"); + +// This expression will extract all paragraph nodes, +// which are descendants of any table node in the document. +System::SharedPtr nodeList = doc->SelectNodes(u"//Table//Paragraph"); + +// Iterate through the list with an enumerator and print the contents of every paragraph in each cell of the table. +int32_t index = 0; + +{ + System::SharedPtr>> e = nodeList->GetEnumerator(); + while (e->MoveNext()) + { + std::cout << System::String::Format(u"Table paragraph index {0}, contents: \"{1}\"", index++, e->get_Current()->GetText().Trim()) << std::endl; + } +} + +// This expression will select any paragraphs that are direct children of any Body node in the document. +nodeList = doc->SelectNodes(u"//Body/Paragraph"); + +// We can treat the list as an array. +ASSERT_EQ(4, nodeList->ToArray()->get_Length()); + +// Use SelectSingleNode to select the first result of the same expression as above. +System::SharedPtr node = doc->SelectSingleNode(u"//Body/Paragraph"); + +ASPOSE_ASSERT_EQ(System::ObjectExt::GetType(), System::ObjectExt::GetType(node)); +``` + + +Shows how to use an XPath expression to test whether a node is inside a field. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Mail merge destination - Northwind employees.docx"); + +// The NodeList that results from this XPath expression will contain all nodes we find inside a field. +// However, FieldStart and FieldEnd nodes can be on the list if there are nested fields in the path. +// Currently does not find rare fields in which the FieldCode or FieldResult spans across multiple paragraphs. +System::SharedPtr resultList = doc->SelectNodes(u"//FieldStart/following-sibling::node()[following-sibling::FieldEnd]"); + +// Check if the specified run is one of the nodes that are inside the field. +std::cout << System::String::Format(u"Contents of the first Run node that's part of a field: {0}", resultList->LINQ_First(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->get_NodeType() == Aspose::Words::NodeType::Run; +})))->GetText().Trim()) << std::endl; +``` + ## See Also * Class [NodeList](../../nodelist/) diff --git a/english/cpp/aspose.words/compositenode/selectsinglenode/_index.md b/english/cpp/aspose.words/compositenode/selectsinglenode/_index.md index 81221356ec3..ee91e8b9602 100644 --- a/english/cpp/aspose.words/compositenode/selectsinglenode/_index.md +++ b/english/cpp/aspose.words/compositenode/selectsinglenode/_index.md @@ -29,6 +29,41 @@ The first [Node](../../node/) that matches the XPath query or **null** if no mat Only expressions with element names are supported at the moment. Expressions that use attribute names are not supported. +## Examples + + + +Shows how to select certain nodes by using an XPath expression. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Tables.docx"); + +// This expression will extract all paragraph nodes, +// which are descendants of any table node in the document. +System::SharedPtr nodeList = doc->SelectNodes(u"//Table//Paragraph"); + +// Iterate through the list with an enumerator and print the contents of every paragraph in each cell of the table. +int32_t index = 0; + +{ + System::SharedPtr>> e = nodeList->GetEnumerator(); + while (e->MoveNext()) + { + std::cout << System::String::Format(u"Table paragraph index {0}, contents: \"{1}\"", index++, e->get_Current()->GetText().Trim()) << std::endl; + } +} + +// This expression will select any paragraphs that are direct children of any Body node in the document. +nodeList = doc->SelectNodes(u"//Body/Paragraph"); + +// We can treat the list as an array. +ASSERT_EQ(4, nodeList->ToArray()->get_Length()); + +// Use SelectSingleNode to select the first result of the same expression as above. +System::SharedPtr node = doc->SelectSingleNode(u"//Body/Paragraph"); + +ASPOSE_ASSERT_EQ(System::ObjectExt::GetType(), System::ObjectExt::GetType(node)); +``` + ## See Also * Class [Node](../../node/) diff --git a/english/cpp/aspose.words/document/_index.md b/english/cpp/aspose.words/document/_index.md index a6e10696a61..6a67d86ddb7 100644 --- a/english/cpp/aspose.words/document/_index.md +++ b/english/cpp/aspose.words/document/_index.md @@ -187,7 +187,7 @@ class Document : public Aspose::Words::DocumentBase, | [set_SpellingChecked](./set_spellingchecked/)(bool) | Setter for [Aspose::Words::Document::get_SpellingChecked](./get_spellingchecked/). | | [set_TrackRevisions](./set_trackrevisions/)(bool) | Setter for [Aspose::Words::Document::get_TrackRevisions](./get_trackrevisions/). | | [set_VbaProject](./set_vbaproject/)(const System::SharedPtr\\&) | Setter for [Aspose::Words::Document::get_VbaProject](./get_vbaproject/). | -| [set_WarningCallback](../documentbase/set_warningcallback/)(const System::SharedPtr\\&) | Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss. | +| [set_WarningCallback](../documentbase/set_warningcallback/)(const System::SharedPtr\\&) | Setter for [Aspose::Words::DocumentBase::get_WarningCallback](../documentbase/get_warningcallback/). | | [SetParent](../node/setparent/)(const System::SharedPtr\\&) | | | [SetTemplateWeakPtr](../compositenode/settemplateweakptr/)(uint32_t) override | | | [StartTrackRevisions](./starttrackrevisions/)(const System::String\&, System::DateTime) | Starts automatically marking all further changes you make to the document programmatically as revision changes. | diff --git a/english/cpp/aspose.words/document/document/_index.md b/english/cpp/aspose.words/document/document/_index.md index ab83eb113ea..7ee77137307 100644 --- a/english/cpp/aspose.words/document/document/_index.md +++ b/english/cpp/aspose.words/document/document/_index.md @@ -116,29 +116,6 @@ Shows how to load a document using a stream. } ``` - -Shows how to load a document from a URL. -```cpp -// Create a URL that points to a Microsoft Word document. -const System::String url = u"https://filesamples.com/samples/document/docx/sample3.docx"; - -// Download the document into a byte array, then load that array into a document using a memory stream. -{ - auto webClient = System::MakeObject(); - System::ArrayPtr dataBytes = webClient->DownloadData(url); - - { - auto byteStream = System::MakeObject(dataBytes); - auto doc = System::MakeObject(byteStream); - - // At this stage, we can read and edit the document's contents and then save it to the local file system. - ASSERT_EQ(System::String(u"There are eight section headings in this document. At the beginning, \"Sample Document\" is a level 1 heading. ") + u"The main section headings, such as \"Headings\" and \"Lists\" are level 2 headings. " + u"The Tables section contains two sub-headings, \"Simple Table\" and \"Complex Table,\" which are both level 3 headings.", doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(3)->GetText().Trim()); - - doc->Save(get_ArtifactsDir() + u"Document.LoadFromWeb.docx"); - } -} -``` - ## See Also * Class [Document](../) @@ -189,29 +166,6 @@ Shows how to open an HTML document with images from a stream using a base URI. ``` -Shows how save a web page as a .docx file. -```cpp -const System::String url = u"https://products.aspose.com/words/"; - -{ - auto client = System::MakeObject(); - auto bytes = client->DownloadData(url); - { - auto stream = System::MakeObject(bytes); - // The URL is used again as a baseUri to ensure that any relative image paths are retrieved correctly. - auto options = System::MakeObject(Aspose::Words::LoadFormat::Html, u"", url); - - // Load the HTML document from stream and pass the LoadOptions object. - auto doc = System::MakeObject(stream, options); - - // At this stage, we can read and edit the document's contents and then save it to the local file system. - - doc->Save(get_ArtifactsDir() + u"Document.InsertHtmlFromWebPage.docx"); - } -} -``` - - Shows how to load an encrypted Microsoft Word document. ```cpp System::SharedPtr doc; diff --git a/english/cpp/aspose.words/documentbase/_index.md b/english/cpp/aspose.words/documentbase/_index.md index 9cb699d7d3d..228d8951904 100644 --- a/english/cpp/aspose.words/documentbase/_index.md +++ b/english/cpp/aspose.words/documentbase/_index.md @@ -79,7 +79,7 @@ class DocumentBase : public Aspose::Words::CompositeNode | [set_PageColor](./set_pagecolor/)(System::Drawing::Color) | Setter for [Aspose::Words::DocumentBase::get_PageColor](./get_pagecolor/). | | [set_PrevNode](../node/set_prevnode/)(const System::SharedPtr\\&) | | | [set_ResourceLoadingCallback](./set_resourceloadingcallback/)(const System::SharedPtr\\&) | Allows to control how external resources are loaded. | -| [set_WarningCallback](./set_warningcallback/)(const System::SharedPtr\\&) | Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss. | +| [set_WarningCallback](./set_warningcallback/)(const System::SharedPtr\\&) | Setter for [Aspose::Words::DocumentBase::get_WarningCallback](./get_warningcallback/). | | [SetParent](../node/setparent/)(const System::SharedPtr\\&) | | | [SetTemplateWeakPtr](../compositenode/settemplateweakptr/)(uint32_t) override | | | [ToString](../node/tostring/)(Aspose::Words::SaveFormat) | Exports the content of the node into a string in the specified format. | diff --git a/english/cpp/aspose.words/documentbase/get_warningcallback/_index.md b/english/cpp/aspose.words/documentbase/get_warningcallback/_index.md index 2f6f037fcf9..3b827ce1433 100644 --- a/english/cpp/aspose.words/documentbase/get_warningcallback/_index.md +++ b/english/cpp/aspose.words/documentbase/get_warningcallback/_index.md @@ -16,6 +16,41 @@ Called during various document processing procedures when an issue is detected t System::SharedPtr Aspose::Words::DocumentBase::get_WarningCallback() const ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Interface [IWarningCallback](../../iwarningcallback/) diff --git a/english/cpp/aspose.words/documentbase/set_warningcallback/_index.md b/english/cpp/aspose.words/documentbase/set_warningcallback/_index.md index 7d768bd1fd0..91f87b54aa2 100644 --- a/english/cpp/aspose.words/documentbase/set_warningcallback/_index.md +++ b/english/cpp/aspose.words/documentbase/set_warningcallback/_index.md @@ -2,7 +2,7 @@ title: Aspose::Words::DocumentBase::set_WarningCallback method linktitle: set_WarningCallback second_title: Aspose.Words for C++ API Reference -description: 'Aspose::Words::DocumentBase::set_WarningCallback method. Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss in C++.' +description: 'Aspose::Words::DocumentBase::set_WarningCallback method. Setter for Aspose::Words::DocumentBase::get_WarningCallback in C++.' type: docs weight: 18000 url: /cpp/aspose.words/documentbase/set_warningcallback/ @@ -10,7 +10,7 @@ url: /cpp/aspose.words/documentbase/set_warningcallback/ ## DocumentBase::set_WarningCallback method -Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss. +Setter for [Aspose::Words::DocumentBase::get_WarningCallback](../get_warningcallback/). ```cpp void Aspose::Words::DocumentBase::set_WarningCallback(const System::SharedPtr &value) diff --git a/english/cpp/aspose.words/documentbuilder/_index.md b/english/cpp/aspose.words/documentbuilder/_index.md index 522cb1b5b13..c0694215176 100644 --- a/english/cpp/aspose.words/documentbuilder/_index.md +++ b/english/cpp/aspose.words/documentbuilder/_index.md @@ -169,6 +169,34 @@ Note that [Font](./get_font/), [ParagraphFormat](./get_paragraphformat/) and [Pa +Shows how to create headers and footers in a document using [DocumentBuilder](./). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to build a table with custom borders. ```cpp auto doc = System::MakeObject(); diff --git a/english/cpp/aspose.words/documentbuilder/documentbuilder/_index.md b/english/cpp/aspose.words/documentbuilder/documentbuilder/_index.md index 9bf30798682..0613a227eb4 100644 --- a/english/cpp/aspose.words/documentbuilder/documentbuilder/_index.md +++ b/english/cpp/aspose.words/documentbuilder/documentbuilder/_index.md @@ -60,6 +60,34 @@ Aspose::Words::DocumentBuilder::DocumentBuilder(const System::SharedPtr(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to insert a Table of contents (TOC) into a document using heading styles as entries. ```cpp auto doc = System::MakeObject(); @@ -127,6 +155,37 @@ Aspose::Words::DocumentBuilder::DocumentBuilder(const System::SharedPtr\& | The [Document](../../document/) object to attach to. | | options | const System::SharedPtr\\& | Additional options for the document building process. | +## Examples + + + +Shows how to ignore table formatting for content after. +```cpp +auto doc = System::MakeObject(); +auto builderOptions = System::MakeObject(); +builderOptions->set_ContextTableFormatting(true); +auto builder = System::MakeObject(doc, builderOptions); + +// Adds content before the table. +// Default font size is 12. +builder->Writeln(u"Font size 12 here."); +builder->StartTable(); +builder->InsertCell(); +// Changes the font size inside the table. +builder->get_Font()->set_Size(5); +builder->Write(u"Font size 5 here"); +builder->InsertCell(); +builder->Write(u"Font size 5 here"); +builder->EndRow(); +builder->EndTable(); + +// If ContextTableFormatting is true, then table formatting isn't applied to the content after. +// If ContextTableFormatting is false, then table formatting is applied to the content after. +builder->Writeln(u"Font size 12 here."); + +doc->Save(get_ArtifactsDir() + u"Table.ContextTableFormatting.docx"); +``` + ## See Also * Class [Document](../../document/) @@ -143,6 +202,38 @@ Initializes a new instance of this class. Aspose::Words::DocumentBuilder::DocumentBuilder(const System::SharedPtr &options) ``` + +## Examples + + + +Shows how to ignore table formatting for content after. +```cpp +auto doc = System::MakeObject(); +auto builderOptions = System::MakeObject(); +builderOptions->set_ContextTableFormatting(true); +auto builder = System::MakeObject(doc, builderOptions); + +// Adds content before the table. +// Default font size is 12. +builder->Writeln(u"Font size 12 here."); +builder->StartTable(); +builder->InsertCell(); +// Changes the font size inside the table. +builder->get_Font()->set_Size(5); +builder->Write(u"Font size 5 here"); +builder->InsertCell(); +builder->Write(u"Font size 5 here"); +builder->EndRow(); +builder->EndTable(); + +// If ContextTableFormatting is true, then table formatting isn't applied to the content after. +// If ContextTableFormatting is false, then table formatting is applied to the content after. +builder->Writeln(u"Font size 12 here."); + +doc->Save(get_ArtifactsDir() + u"Table.ContextTableFormatting.docx"); +``` + ## See Also * Class [DocumentBuilderOptions](../../documentbuilderoptions/) diff --git a/english/cpp/aspose.words/documentbuilder/insertbreak/_index.md b/english/cpp/aspose.words/documentbuilder/insertbreak/_index.md index c50086076b3..53e3e80982c 100644 --- a/english/cpp/aspose.words/documentbuilder/insertbreak/_index.md +++ b/english/cpp/aspose.words/documentbuilder/insertbreak/_index.md @@ -25,6 +25,34 @@ void Aspose::Words::DocumentBuilder::InsertBreak(Aspose::Words::BreakType breakT +Shows how to create headers and footers in a document using [DocumentBuilder](../). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to insert a Table of contents (TOC) into a document using heading styles as entries. ```cpp auto doc = System::MakeObject(); diff --git a/english/cpp/aspose.words/documentbuilder/insertonlinevideo/_index.md b/english/cpp/aspose.words/documentbuilder/insertonlinevideo/_index.md index 12dd856dc2f..d744e6613e5 100644 --- a/english/cpp/aspose.words/documentbuilder/insertonlinevideo/_index.md +++ b/english/cpp/aspose.words/documentbuilder/insertonlinevideo/_index.md @@ -47,6 +47,26 @@ If your online video is not displaying correctly, use [InsertOnlineVideo()](../) The code for embedding video can vary between providers, consult your corresponding provider of choice for details. +## Examples + + + +Shows how to insert an online video into a document. +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +System::String videoUrl = u"https://vimeo.com/52477838"; + +// Insert a shape that plays a video from the web when clicked in Microsoft Word. +// This rectangular shape will contain an image based on the first frame of the linked video +// and a "play button" visual prompt. The video has an aspect ratio of 16:9. +// We will set the shape's size to that ratio, so the image does not appear stretched. +builder->InsertOnlineVideo(videoUrl, Aspose::Words::Drawing::RelativeHorizontalPosition::LeftMargin, 0, Aspose::Words::Drawing::RelativeVerticalPosition::TopMargin, 0, 320, 180, Aspose::Words::Drawing::WrapType::Square); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.InsertOnlineVideo.docx"); +``` + ## See Also * Class [Shape](../../../aspose.words.drawing/shape/) diff --git a/english/cpp/aspose.words/documentbuilder/movetoheaderfooter/_index.md b/english/cpp/aspose.words/documentbuilder/movetoheaderfooter/_index.md index 6e819a73783..260473dde21 100644 --- a/english/cpp/aspose.words/documentbuilder/movetoheaderfooter/_index.md +++ b/english/cpp/aspose.words/documentbuilder/movetoheaderfooter/_index.md @@ -35,6 +35,34 @@ Use [MoveToSection()](../movetosection/) to move out of the header into the main +Shows how to create headers and footers in a document using [DocumentBuilder](../). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to insert an image, and use it as a watermark. ```cpp auto doc = System::MakeObject(); diff --git a/english/cpp/aspose.words/documentbuilder/movetosection/_index.md b/english/cpp/aspose.words/documentbuilder/movetosection/_index.md index c1eb26b806f..dcbaac3a655 100644 --- a/english/cpp/aspose.words/documentbuilder/movetosection/_index.md +++ b/english/cpp/aspose.words/documentbuilder/movetosection/_index.md @@ -27,6 +27,37 @@ When *sectionIndex* is greater than or equal to 0, it specifies an index from th The cursor is moved to the first paragraph in the [Body](../../body/) of the specified section. +## Examples + + + +Shows how to create headers and footers in a document using [DocumentBuilder](../). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + ## See Also * Class [DocumentBuilder](../) diff --git a/english/cpp/aspose.words/documentbuilder/writeln/_index.md b/english/cpp/aspose.words/documentbuilder/writeln/_index.md index 0a136d0c8c2..07abc9a2d09 100644 --- a/english/cpp/aspose.words/documentbuilder/writeln/_index.md +++ b/english/cpp/aspose.words/documentbuilder/writeln/_index.md @@ -19,7 +19,39 @@ void Aspose::Words::DocumentBuilder::Writeln() ## Remarks -Calls [InsertParagraph](../insertparagraph/). +Calls [InsertParagraph](../insertparagraph/). + +## Examples + + + +Shows how to create headers and footers in a document using [DocumentBuilder](../). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + ## See Also * Class [DocumentBuilder](../) diff --git a/english/cpp/aspose.words/headerfootertype/_index.md b/english/cpp/aspose.words/headerfootertype/_index.md index 02cab1b1e7d..a40d2c1ebda 100644 --- a/english/cpp/aspose.words/headerfootertype/_index.md +++ b/english/cpp/aspose.words/headerfootertype/_index.md @@ -27,6 +27,38 @@ enum class HeaderFooterType | HeaderFirst | 4 | Header for the first page of the section. | | FooterFirst | 5 | Footer for the first page of the section. | + +## Examples + + + +Shows how to create headers and footers in a document using [DocumentBuilder](../documentbuilder/). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + ## See Also * Namespace [Aspose::Words](../) diff --git a/english/cpp/aspose.words/iwarningcallback/_index.md b/english/cpp/aspose.words/iwarningcallback/_index.md index 71816f05f95..1479b476fdf 100644 --- a/english/cpp/aspose.words/iwarningcallback/_index.md +++ b/english/cpp/aspose.words/iwarningcallback/_index.md @@ -24,6 +24,41 @@ class IWarningCallback : public virtual System::Object | [Is](./is/)(const System::TypeInfo\&) const override | | | static [Type](./type/)() | | | virtual [Warning](./warning/)(System::SharedPtr\) | Aspose.Words invokes this method when it encounters some issue during document loading or saving that might result in loss of formatting or data fidelity. | + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Namespace [Aspose::Words](../) diff --git a/english/cpp/aspose.words/iwarningcallback/warning/_index.md b/english/cpp/aspose.words/iwarningcallback/warning/_index.md index 4067a18c634..ce9aa3885e6 100644 --- a/english/cpp/aspose.words/iwarningcallback/warning/_index.md +++ b/english/cpp/aspose.words/iwarningcallback/warning/_index.md @@ -16,6 +16,41 @@ Aspose.Words invokes this method when it encounters some issue during document l virtual void Aspose::Words::IWarningCallback::Warning(System::SharedPtr info)=0 ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [WarningInfo](../../warninginfo/) diff --git a/english/cpp/aspose.words/loadformat/_index.md b/english/cpp/aspose.words/loadformat/_index.md index 81fe9b28deb..f54d91cb417 100644 --- a/english/cpp/aspose.words/loadformat/_index.md +++ b/english/cpp/aspose.words/loadformat/_index.md @@ -53,29 +53,6 @@ enum class LoadFormat -Shows how save a web page as a .docx file. -```cpp -const System::String url = u"https://products.aspose.com/words/"; - -{ - auto client = System::MakeObject(); - auto bytes = client->DownloadData(url); - { - auto stream = System::MakeObject(bytes); - // The URL is used again as a baseUri to ensure that any relative image paths are retrieved correctly. - auto options = System::MakeObject(Aspose::Words::LoadFormat::Html, u"", url); - - // Load the HTML document from stream and pass the LoadOptions object. - auto doc = System::MakeObject(stream, options); - - // At this stage, we can read and edit the document's contents and then save it to the local file system. - - doc->Save(get_ArtifactsDir() + u"Document.InsertHtmlFromWebPage.docx"); - } -} -``` - - Shows how to use the [FileFormatUtil](../fileformatutil/) methods to detect the format of a document. ```cpp // Load a document from a file that is missing a file extension, and then detect its file format. diff --git a/english/cpp/aspose.words/nodelist/get_count/_index.md b/english/cpp/aspose.words/nodelist/get_count/_index.md index b5cb9059a26..65d335afbe7 100644 --- a/english/cpp/aspose.words/nodelist/get_count/_index.md +++ b/english/cpp/aspose.words/nodelist/get_count/_index.md @@ -16,6 +16,72 @@ Gets the number of nodes in the list. int32_t Aspose::Words::NodeList::get_Count() const ``` + +## Examples + + + +Shows how to use XPaths to navigate a [NodeList](../). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Insert some nodes with a DocumentBuilder. +builder->Writeln(u"Hello world!"); + +builder->StartTable(); +builder->InsertCell(); +builder->Write(u"Cell 1"); +builder->InsertCell(); +builder->Write(u"Cell 2"); +builder->EndTable(); + +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// Our document contains three Run nodes. +System::SharedPtr nodeList = doc->SelectNodes(u"//Run"); + +ASSERT_EQ(3, nodeList->get_Count()); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Hello world!"; +})))); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 1"; +})))); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 2"; +})))); + +// Use a double forward slash to select all Run nodes +// that are indirect descendants of a Table node, which would be the runs inside the two cells we inserted. +nodeList = doc->SelectNodes(u"//Table//Run"); + +ASSERT_EQ(2, nodeList->get_Count()); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 1"; +})))); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 2"; +})))); + +// Single forward slashes specify direct descendant relationships, +// which we skipped when we used double slashes. +ASPOSE_ASSERT_EQ(doc->SelectNodes(u"//Table//Run"), doc->SelectNodes(u"//Table/Row/Cell/Paragraph/Run")); + +// Access the shape that contains the image we inserted. +nodeList = doc->SelectNodes(u"//Shape"); + +ASSERT_EQ(1, nodeList->get_Count()); + +auto shape = System::ExplicitCast(nodeList->idx_get(0)); +ASSERT_TRUE(shape->get_HasImage()); +``` + ## See Also * Class [NodeList](../) diff --git a/english/cpp/aspose.words/nodelist/getenumerator/_index.md b/english/cpp/aspose.words/nodelist/getenumerator/_index.md index 101dea3fa84..a3ba356abed 100644 --- a/english/cpp/aspose.words/nodelist/getenumerator/_index.md +++ b/english/cpp/aspose.words/nodelist/getenumerator/_index.md @@ -21,6 +21,41 @@ System::SharedPtr(get_MyDir() + u"Tables.docx"); + +// This expression will extract all paragraph nodes, +// which are descendants of any table node in the document. +System::SharedPtr nodeList = doc->SelectNodes(u"//Table//Paragraph"); + +// Iterate through the list with an enumerator and print the contents of every paragraph in each cell of the table. +int32_t index = 0; + +{ + System::SharedPtr>> e = nodeList->GetEnumerator(); + while (e->MoveNext()) + { + std::cout << System::String::Format(u"Table paragraph index {0}, contents: \"{1}\"", index++, e->get_Current()->GetText().Trim()) << std::endl; + } +} + +// This expression will select any paragraphs that are direct children of any Body node in the document. +nodeList = doc->SelectNodes(u"//Body/Paragraph"); + +// We can treat the list as an array. +ASSERT_EQ(4, nodeList->ToArray()->get_Length()); + +// Use SelectSingleNode to select the first result of the same expression as above. +System::SharedPtr node = doc->SelectSingleNode(u"//Body/Paragraph"); + +ASPOSE_ASSERT_EQ(System::ObjectExt::GetType(), System::ObjectExt::GetType(node)); +``` + ## See Also * Class [Node](../../node/) diff --git a/english/cpp/aspose.words/nodelist/idx_get/_index.md b/english/cpp/aspose.words/nodelist/idx_get/_index.md index 80b1e7345f1..037b5160e8c 100644 --- a/english/cpp/aspose.words/nodelist/idx_get/_index.md +++ b/english/cpp/aspose.words/nodelist/idx_get/_index.md @@ -31,6 +31,71 @@ If index is greater than or equal to the number of items in the list, this retur If index is negative and its absolute value is greater than the number of items in the list, this returns a null reference. +## Examples + + + +Shows how to use XPaths to navigate a [NodeList](../). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Insert some nodes with a DocumentBuilder. +builder->Writeln(u"Hello world!"); + +builder->StartTable(); +builder->InsertCell(); +builder->Write(u"Cell 1"); +builder->InsertCell(); +builder->Write(u"Cell 2"); +builder->EndTable(); + +builder->InsertImage(get_ImageDir() + u"Logo.jpg"); + +// Our document contains three Run nodes. +System::SharedPtr nodeList = doc->SelectNodes(u"//Run"); + +ASSERT_EQ(3, nodeList->get_Count()); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Hello world!"; +})))); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 1"; +})))); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 2"; +})))); + +// Use a double forward slash to select all Run nodes +// that are indirect descendants of a Table node, which would be the runs inside the two cells we inserted. +nodeList = doc->SelectNodes(u"//Table//Run"); + +ASSERT_EQ(2, nodeList->get_Count()); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 1"; +})))); +ASSERT_TRUE(nodeList->LINQ_Any(static_cast, bool>>(static_cast n)>>([](System::SharedPtr n) -> bool +{ + return n->GetText().Trim() == u"Cell 2"; +})))); + +// Single forward slashes specify direct descendant relationships, +// which we skipped when we used double slashes. +ASPOSE_ASSERT_EQ(doc->SelectNodes(u"//Table//Run"), doc->SelectNodes(u"//Table/Row/Cell/Paragraph/Run")); + +// Access the shape that contains the image we inserted. +nodeList = doc->SelectNodes(u"//Shape"); + +ASSERT_EQ(1, nodeList->get_Count()); + +auto shape = System::ExplicitCast(nodeList->idx_get(0)); +ASSERT_TRUE(shape->get_HasImage()); +``` + ## See Also * Class [Node](../../node/) diff --git a/english/cpp/aspose.words/nodelist/toarray/_index.md b/english/cpp/aspose.words/nodelist/toarray/_index.md index 97dc6e25f50..2779f63f603 100644 --- a/english/cpp/aspose.words/nodelist/toarray/_index.md +++ b/english/cpp/aspose.words/nodelist/toarray/_index.md @@ -27,6 +27,41 @@ You should not be adding/removing nodes while iterating over a collection of nod To be able to add/remove nodes during iteration, use this method to copy nodes into a fixed-size array and then iterate over the array. +## Examples + + + +Shows how to select certain nodes by using an XPath expression. +```cpp +auto doc = System::MakeObject(get_MyDir() + u"Tables.docx"); + +// This expression will extract all paragraph nodes, +// which are descendants of any table node in the document. +System::SharedPtr nodeList = doc->SelectNodes(u"//Table//Paragraph"); + +// Iterate through the list with an enumerator and print the contents of every paragraph in each cell of the table. +int32_t index = 0; + +{ + System::SharedPtr>> e = nodeList->GetEnumerator(); + while (e->MoveNext()) + { + std::cout << System::String::Format(u"Table paragraph index {0}, contents: \"{1}\"", index++, e->get_Current()->GetText().Trim()) << std::endl; + } +} + +// This expression will select any paragraphs that are direct children of any Body node in the document. +nodeList = doc->SelectNodes(u"//Body/Paragraph"); + +// We can treat the list as an array. +ASSERT_EQ(4, nodeList->ToArray()->get_Length()); + +// Use SelectSingleNode to select the first result of the same expression as above. +System::SharedPtr node = doc->SelectSingleNode(u"//Body/Paragraph"); + +ASPOSE_ASSERT_EQ(System::ObjectExt::GetType(), System::ObjectExt::GetType(node)); +``` + ## See Also * Class [Node](../../node/) diff --git a/english/cpp/aspose.words/pagesetup/get_differentfirstpageheaderfooter/_index.md b/english/cpp/aspose.words/pagesetup/get_differentfirstpageheaderfooter/_index.md index 86b56c64d57..981a410e7eb 100644 --- a/english/cpp/aspose.words/pagesetup/get_differentfirstpageheaderfooter/_index.md +++ b/english/cpp/aspose.words/pagesetup/get_differentfirstpageheaderfooter/_index.md @@ -21,6 +21,34 @@ bool Aspose::Words::PageSetup::get_DifferentFirstPageHeaderFooter() +Shows how to create headers and footers in a document using [DocumentBuilder](../../documentbuilder/). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to enable or disable primary headers/footers. ```cpp auto doc = System::MakeObject(); diff --git a/english/cpp/aspose.words/pagesetup/get_oddandevenpagesheaderfooter/_index.md b/english/cpp/aspose.words/pagesetup/get_oddandevenpagesheaderfooter/_index.md index b4d940a7def..aa5b8ce71fa 100644 --- a/english/cpp/aspose.words/pagesetup/get_oddandevenpagesheaderfooter/_index.md +++ b/english/cpp/aspose.words/pagesetup/get_oddandevenpagesheaderfooter/_index.md @@ -21,6 +21,34 @@ bool Aspose::Words::PageSetup::get_OddAndEvenPagesHeaderFooter() const +Shows how to create headers and footers in a document using [DocumentBuilder](../../documentbuilder/). +```cpp +auto doc = System::MakeObject(); +auto builder = System::MakeObject(doc); + +// Specify that we want different headers and footers for first, even and odd pages. +builder->get_PageSetup()->set_DifferentFirstPageHeaderFooter(true); +builder->get_PageSetup()->set_OddAndEvenPagesHeaderFooter(true); + +// Create the headers, then add three pages to the document to display each header type. +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderFirst); +builder->Write(u"Header for the first page"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderEven); +builder->Write(u"Header for even pages"); +builder->MoveToHeaderFooter(Aspose::Words::HeaderFooterType::HeaderPrimary); +builder->Write(u"Header for all other pages"); + +builder->MoveToSection(0); +builder->Writeln(u"Page1"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page2"); +builder->InsertBreak(Aspose::Words::BreakType::PageBreak); +builder->Writeln(u"Page3"); + +doc->Save(get_ArtifactsDir() + u"DocumentBuilder.HeadersAndFooters.docx"); +``` + + Shows how to enable or disable even page headers/footers. ```cpp auto doc = System::MakeObject(); diff --git a/english/cpp/aspose.words/warninginfo/_index.md b/english/cpp/aspose.words/warninginfo/_index.md index f569bda3b60..feda404362d 100644 --- a/english/cpp/aspose.words/warninginfo/_index.md +++ b/english/cpp/aspose.words/warninginfo/_index.md @@ -31,6 +31,40 @@ class WarningInfo : public System::Object You do not create instances of this class. Objects of this class are created and passed by Aspose.Words to the [Warning()](../iwarningcallback/warning/) method. +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Namespace [Aspose::Words](../) diff --git a/english/cpp/aspose.words/warninginfo/get_description/_index.md b/english/cpp/aspose.words/warninginfo/get_description/_index.md index c7459cb729d..d87544c2dfd 100644 --- a/english/cpp/aspose.words/warninginfo/get_description/_index.md +++ b/english/cpp/aspose.words/warninginfo/get_description/_index.md @@ -16,6 +16,41 @@ Returns the description of the warning. System::String Aspose::Words::WarningInfo::get_Description() const ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [WarningInfo](../) diff --git a/english/cpp/aspose.words/warninginfo/get_warningtype/_index.md b/english/cpp/aspose.words/warninginfo/get_warningtype/_index.md index 5351eda43a4..129f0f9ef07 100644 --- a/english/cpp/aspose.words/warninginfo/get_warningtype/_index.md +++ b/english/cpp/aspose.words/warninginfo/get_warningtype/_index.md @@ -16,6 +16,41 @@ Returns the type of the warning. Aspose::Words::WarningType Aspose::Words::WarningInfo::get_WarningType() const ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Enum [WarningType](../../warningtype/) diff --git a/english/cpp/aspose.words/warninginfocollection/_index.md b/english/cpp/aspose.words/warninginfocollection/_index.md index a47c9f5d379..095e1db8673 100644 --- a/english/cpp/aspose.words/warninginfocollection/_index.md +++ b/english/cpp/aspose.words/warninginfocollection/_index.md @@ -54,6 +54,40 @@ class WarningInfoCollection : public Aspose::Words::IWarningCallback, You can use this collection object as the simplest form of [IWarningCallback](../iwarningcallback/) implementation to gather all warnings that Aspose.Words generates during a load or save operation. Create an instance of this class and assign it to the [WarningCallback](../../aspose.words.loading/loadoptions/get_warningcallback/) or [WarningCallback](../documentbase/get_warningcallback/) property. +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Interface [IWarningCallback](../iwarningcallback/) diff --git a/english/cpp/aspose.words/warninginfocollection/clear/_index.md b/english/cpp/aspose.words/warninginfocollection/clear/_index.md index af95172c6b8..49a079a2ad9 100644 --- a/english/cpp/aspose.words/warninginfocollection/clear/_index.md +++ b/english/cpp/aspose.words/warninginfocollection/clear/_index.md @@ -16,6 +16,41 @@ Removes all elements from the collection. void Aspose::Words::WarningInfoCollection::Clear() ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [WarningInfoCollection](../) diff --git a/english/cpp/aspose.words/warninginfocollection/warning/_index.md b/english/cpp/aspose.words/warninginfocollection/warning/_index.md index e4f6547c775..f84d62a1b2a 100644 --- a/english/cpp/aspose.words/warninginfocollection/warning/_index.md +++ b/english/cpp/aspose.words/warninginfocollection/warning/_index.md @@ -16,6 +16,41 @@ Implements the [IWarningCallback](../../iwarningcallback/) interface. Adds a war void Aspose::Words::WarningInfoCollection::Warning(System::SharedPtr info) override ``` + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Class [WarningInfo](../../warninginfo/) diff --git a/english/cpp/aspose.words/warningtype/_index.md b/english/cpp/aspose.words/warningtype/_index.md index 685b5477db7..2ca20888e87 100644 --- a/english/cpp/aspose.words/warningtype/_index.md +++ b/english/cpp/aspose.words/warningtype/_index.md @@ -32,6 +32,41 @@ enum class WarningType | UnexpectedContent | 16777216 | Generic unexpected content, no specific code. | | Hint | 268435456 | Advises of a potential problem or suggests an improvement. | + +## Examples + + + +Shows how to set the property for finding the closest match for a missing font from the available font sources. +```cpp +// Open a document that contains text formatted with a font that does not exist in any of our font sources. +auto doc = System::MakeObject(get_MyDir() + u"Missing font.docx"); + +// Assign a callback for handling font substitution warnings. +auto warningCollector = System::MakeObject(); +doc->set_WarningCallback(warningCollector); + +// Set a default font name and enable font substitution. +auto fontSettings = System::MakeObject(); +fontSettings->get_SubstitutionSettings()->get_DefaultFontSubstitution()->set_DefaultFontName(u"Arial"); +fontSettings->get_SubstitutionSettings()->get_FontInfoSubstitution()->set_Enabled(true); + +// Original font metrics should be used after font substitution. +doc->get_LayoutOptions()->set_KeepOriginalFontMetrics(true); + +// We will get a font substitution warning if we save a document with a missing font. +doc->set_FontSettings(fontSettings); +doc->Save(get_ArtifactsDir() + u"FontSettings.EnableFontSubstitution.pdf"); + +for (auto&& info : warningCollector) +{ + if (info->get_WarningType() == Aspose::Words::WarningType::FontSubstitution) + { + std::cout << info->get_Description() << std::endl; + } +} +``` + ## See Also * Namespace [Aspose::Words](../) diff --git a/english/python-net/aspose.words.digitalsignatures/certificateholder/_index.md b/english/python-net/aspose.words.digitalsignatures/certificateholder/_index.md index d0480d98632..ca38e934cd4 100644 --- a/english/python-net/aspose.words.digitalsignatures/certificateholder/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/certificateholder/_index.md @@ -75,71 +75,6 @@ output_file_name = ARTIFACTS_DIR + 'DigitalSignatureUtil.DecryptionPassword.docx aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=input_file_name, dst_file_name=output_file_name, cert_holder=certificate_holder, sign_options=sign_options) ``` -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - ### See Also * module [aspose.words.digitalsignatures](../) diff --git a/english/python-net/aspose.words.digitalsignatures/certificateholder/create/_index.md b/english/python-net/aspose.words.digitalsignatures/certificateholder/create/_index.md index a23077b15b0..432ec52f73a 100644 --- a/english/python-net/aspose.words.digitalsignatures/certificateholder/create/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/certificateholder/create/_index.md @@ -106,31 +106,6 @@ An instance of [CertificateHolder](../) ## Examples -Shows how to create CertificateHolder objects. - -```python -# Below are four ways of creating CertificateHolder objects. -# 1 - Load a PKCS #12 file into a byte array and apply its password: -with open(MY_DIR + 'morzal.pfx', 'rb') as file: - cert_bytes = file.read() -aw.digitalsignatures.CertificateHolder.create(cert_bytes, 'aw') -# 2 - Load a PKCS #12 file into a byte array, and apply a secure password: -password = NetworkCredential('', 'aw').secure_password -aw.digitalsignatures.CertificateHolder.create(cert_bytes, password) -# If the certificate has private keys corresponding to aliases, -# we can use the aliases to fetch their respective keys. First, we will check for valid aliases. -with open(MY_DIR + 'morzal.pfx', 'rb') as cert_stream: - pkcs12_store = Pkcs12Store(cert_stream, 'aw').build() - pkcs12_store.load(cert_stream, 'aw') - for alias in pkcs12_store.aliases: - if pkcs12_store.is_key_entry(alias) and pkcs12_store.get_key(alias).key.is_private: - print('Valid alias found:', alias) -# 3 - Use a valid alias: -aw.digitalsignatures.CertificateHolder.create(MY_DIR + 'morzal.pfx', 'aw', 'c20be521-11ea-4976-81ed-865fbbfc9f24') -# 4 - Pass "null" as the alias in order to use the first available alias that returns a private key: -aw.digitalsignatures.CertificateHolder.create(MY_DIR + 'morzal.pfx', 'aw', None) -``` - Shows how to digitally sign documents. ```python diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignatureutil/sign/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignatureutil/sign/_index.md index 704c8ba6f2e..e5f10ea1bb4 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignatureutil/sign/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignatureutil/sign/_index.md @@ -147,71 +147,6 @@ with system_helper.io.FileStream(MY_DIR + 'Document.docx', system_helper.io.File aw.digitalsignatures.DigitalSignatureUtil.sign(src_stream=stream_in, dst_stream=stream_out, cert_holder=certificate_holder, sign_options=sign_options) ``` -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - Shows how to sign documents with X.509 certificates. ```python diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_id/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_id/_index.md index 30cb38da7b1..e8b61701560 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_id/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_id/_index.md @@ -33,73 +33,6 @@ When set, it associates [SignatureLine](../../../aspose.words.drawing/signaturel -### Examples - -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - ### See Also * module [aspose.words.digitalsignatures](../../) diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_image/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_image/_index.md index f350735ce71..7f86555d7a8 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_image/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/signature_line_image/_index.md @@ -27,73 +27,6 @@ def signature_line_image(self, value: bytes): ``` -### Examples - -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - ### See Also * module [aspose.words.digitalsignatures](../../) diff --git a/english/python-net/aspose.words.drawing/arrowlength/_index.md b/english/python-net/aspose.words.drawing/arrowlength/_index.md index e5a5b13e053..1c77264313e 100644 --- a/english/python-net/aspose.words.drawing/arrowlength/_index.md +++ b/english/python-net/aspose.words.drawing/arrowlength/_index.md @@ -23,62 +23,6 @@ Length of the arrow at the end of a line. | LONG | | | DEFAULT | Same as [ArrowLength.SHORT](./#SHORT). | -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../) diff --git a/english/python-net/aspose.words.drawing/arrowtype/_index.md b/english/python-net/aspose.words.drawing/arrowtype/_index.md index 2f93d681832..191df1c74ab 100644 --- a/english/python-net/aspose.words.drawing/arrowtype/_index.md +++ b/english/python-net/aspose.words.drawing/arrowtype/_index.md @@ -26,62 +26,6 @@ Specifies the type of an arrow at a line end. | OPEN | The arrow is an open arrow. | | DEFAULT | Same as [ArrowType.NONE](./#NONE). | -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../) diff --git a/english/python-net/aspose.words.drawing/arrowwidth/_index.md b/english/python-net/aspose.words.drawing/arrowwidth/_index.md index d6d001dc036..b8f9e2d52be 100644 --- a/english/python-net/aspose.words.drawing/arrowwidth/_index.md +++ b/english/python-net/aspose.words.drawing/arrowwidth/_index.md @@ -23,62 +23,6 @@ Width of the arrow at the end of a line. | WIDE | | | DEFAULT | Same as [ArrowWidth.NARROW](./#NARROW). | -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../) diff --git a/english/python-net/aspose.words.drawing/dashstyle/_index.md b/english/python-net/aspose.words.drawing/dashstyle/_index.md index c2f65361926..8321efd8295 100644 --- a/english/python-net/aspose.words.drawing/dashstyle/_index.md +++ b/english/python-net/aspose.words.drawing/dashstyle/_index.md @@ -31,62 +31,6 @@ Dashed line style. | LONG_DASH_DOT_DOT | Long dash short dash short dash. | | DEFAULT | Same as [DashStyle.SOLID](./#SOLID). | -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../) diff --git a/english/python-net/aspose.words.drawing/endcap/_index.md b/english/python-net/aspose.words.drawing/endcap/_index.md index 69668abc739..dd5d08800e3 100644 --- a/english/python-net/aspose.words.drawing/endcap/_index.md +++ b/english/python-net/aspose.words.drawing/endcap/_index.md @@ -23,62 +23,6 @@ Specifies line cap style. | FLAT | Line ends at end point. | | DEFAULT | Default value is [EndCap.FLAT](./#FLAT). | -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../) diff --git a/english/python-net/aspose.words.drawing/fill/color/_index.md b/english/python-net/aspose.words.drawing/fill/color/_index.md index bbde381954e..e82ee37fb3f 100644 --- a/english/python-net/aspose.words.drawing/fill/color/_index.md +++ b/english/python-net/aspose.words.drawing/fill/color/_index.md @@ -32,6 +32,27 @@ unlike the [Fill.fore_color](../fore_color/) property, which resets it to fully +### Examples + +Shows how to convert any of the fills back to solid fill. + +```python +doc = aw.Document(file_name=MY_DIR + 'Two color gradient.docx') +# Get Fill object for Font of the first Run. +fill = doc.first_section.body.paragraphs[0].runs[0].font.fill +# Check Fill properties of the Font. +print('The type of the fill is: {0}'.format(fill.fill_type)) +print('The foreground color of the fill is: {0}'.format(fill.fore_color)) +print('The fill is transparent at {0}%'.format(fill.transparency * 100)) +# Change type of the fill to Solid with uniform green color. +fill.solid() +print('\nThe fill is changed:') +print('The type of the fill is: {0}'.format(fill.fill_type)) +print('The foreground color of the fill is: {0}'.format(fill.fore_color)) +print('The fill transparency is {0}%'.format(fill.transparency * 100)) +doc.save(file_name=ARTIFACTS_DIR + 'Drawing.FillSolid.docx') +``` + ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/fill/fore_color/_index.md b/english/python-net/aspose.words.drawing/fill/fore_color/_index.md index 25e8c1941f9..778731adfb9 100644 --- a/english/python-net/aspose.words.drawing/fill/fore_color/_index.md +++ b/english/python-net/aspose.words.drawing/fill/fore_color/_index.md @@ -32,62 +32,6 @@ to fully opaque color unlike the [Fill.color](../color/) property, which preserv -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/fill/image_bytes/_index.md b/english/python-net/aspose.words.drawing/fill/image_bytes/_index.md index 310f85b2a33..3bba41c85e9 100644 --- a/english/python-net/aspose.words.drawing/fill/image_bytes/_index.md +++ b/english/python-net/aspose.words.drawing/fill/image_bytes/_index.md @@ -28,62 +28,6 @@ The default value is ``None``. -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/fill/visible/_index.md b/english/python-net/aspose.words.drawing/fill/visible/_index.md index cd3e51874c2..0447ec9f526 100644 --- a/english/python-net/aspose.words.drawing/fill/visible/_index.md +++ b/english/python-net/aspose.words.drawing/fill/visible/_index.md @@ -26,62 +26,6 @@ def visible(self, value: bool): ``` -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/imagedata/has_image/_index.md b/english/python-net/aspose.words.drawing/imagedata/has_image/_index.md index 8fb58f8b19b..452a9268186 100644 --- a/english/python-net/aspose.words.drawing/imagedata/has_image/_index.md +++ b/english/python-net/aspose.words.drawing/imagedata/has_image/_index.md @@ -22,24 +22,6 @@ def has_image(self) -> bool: ``` -### Examples - -Shows how to save all images from a document to the file system. - -```python -img_source_doc = aw.Document(MY_DIR + 'Images.docx') -# Shapes with the "has_image" flag set store and display all the document's images. -shapes_with_images = [node.as_shape() for node in img_source_doc.get_child_nodes(aw.NodeType.SHAPE, True) if node.as_shape().has_image] -# Go through each shape and save its image. -format_converter = drawing.ImageFormatConverter() -for shape_index, shape in enumerate(shapes_with_images): - image_data = shape.image_data - format = image_data.to_image().raw_format - file_extension = format_converter.convert_to_string(format) - with open(ARTIFACTS_DIR + f'Drawing.save_all_images.{shape_index}.{file_extension}', 'wb') as file_stream: - file_stream.write(file_stream) -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/imagedata/save/_index.md b/english/python-net/aspose.words.drawing/imagedata/save/_index.md index 2c1a844aac3..48ae23cc98e 100644 --- a/english/python-net/aspose.words.drawing/imagedata/save/_index.md +++ b/english/python-net/aspose.words.drawing/imagedata/save/_index.md @@ -46,22 +46,6 @@ def save(self, file_name: str): ## Examples -Shows how to save all images from a document to the file system. - -```python -img_source_doc = aw.Document(MY_DIR + 'Images.docx') -# Shapes with the "has_image" flag set store and display all the document's images. -shapes_with_images = [node.as_shape() for node in img_source_doc.get_child_nodes(aw.NodeType.SHAPE, True) if node.as_shape().has_image] -# Go through each shape and save its image. -format_converter = drawing.ImageFormatConverter() -for shape_index, shape in enumerate(shapes_with_images): - image_data = shape.image_data - format = image_data.to_image().raw_format - file_extension = format_converter.convert_to_string(format) - with open(ARTIFACTS_DIR + f'Drawing.save_all_images.{shape_index}.{file_extension}', 'wb') as file_stream: - file_stream.write(file_stream) -``` - Shows how to extract images from a document, and save them to the local file system as individual files. ```python diff --git a/english/python-net/aspose.words.drawing/imagedata/set_image/_index.md b/english/python-net/aspose.words.drawing/imagedata/set_image/_index.md index e7c57209682..5efd490e8b9 100644 --- a/english/python-net/aspose.words.drawing/imagedata/set_image/_index.md +++ b/english/python-net/aspose.words.drawing/imagedata/set_image/_index.md @@ -33,28 +33,6 @@ def set_image(self, file_name: str): ## Examples -Shows how to display images from the local file system in a document. - -```python -doc = aw.Document() -# To display an image in a document, we will need to create a shape -# which will contain an image, and then append it to the document's body. -img_shape = None -# Below are two ways of getting an image from a file in the local file system. -# 1 - Create an image object from an image file: -with drawing.Image.from_file(IMAGE_DIR + 'Logo.jpg') as src_image: - img_shape = aw.drawing.Shape(doc, aw.drawing.ShapeType.IMAGE) - doc.first_section.body.first_paragraph.append_child(img_shape) - img_shape.image_data.set_image(src_image) -# 2 - Open an image file from the local file system using a stream: -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - img_shape = aw.drawing.Shape(doc, aw.drawing.ShapeType.IMAGE) - doc.first_section.body.first_paragraph.append_child(img_shape) - img_shape.image_data.set_image(stream) - img_shape.left = 150.0 -doc.save(ARTIFACTS_DIR + 'Drawing.import_image.docx') -``` - Shows how to insert a linked image into a document. ```python diff --git a/english/python-net/aspose.words.drawing/oleformat/ole_package/_index.md b/english/python-net/aspose.words.drawing/oleformat/ole_package/_index.md index 8fa82da4734..5158c04927c 100644 --- a/english/python-net/aspose.words.drawing/oleformat/ole_package/_index.md +++ b/english/python-net/aspose.words.drawing/oleformat/ole_package/_index.md @@ -31,6 +31,24 @@ See [OlePackage](../../olepackage/) type for more info. +### Examples + +Shows how insert an OLE object into a document. + +```python +doc = aw.Document() +builder = aw.DocumentBuilder(doc=doc) +# OLE objects allow us to open other files in the local file system using another installed application +# in our operating system by double-clicking on the shape that contains the OLE object in the document body. +# In this case, our external file will be a ZIP archive. +zip_file_bytes = system_helper.io.File.read_all_bytes(DATABASE_DIR + 'cat001.zip') +with io.BytesIO(zip_file_bytes) as stream: + shape = builder.insert_ole_object(stream=stream, prog_id='Package', as_icon=True, presentation=None) + shape.ole_format.ole_package.file_name = 'Package file name.zip' + shape.ole_format.ole_package.display_name = 'Package display name.zip' +doc.save(file_name=ARTIFACTS_DIR + 'Shape.InsertOlePackage.docx') +``` + ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/olepackage/_index.md b/english/python-net/aspose.words.drawing/olepackage/_index.md index a766f46752e..d237a89ff10 100644 --- a/english/python-net/aspose.words.drawing/olepackage/_index.md +++ b/english/python-net/aspose.words.drawing/olepackage/_index.md @@ -31,6 +31,24 @@ Now this application is excluded from Windows but MS Word and other applications | [display_name](./display_name/) | Gets or sets OLE Package display name. | | [file_name](./file_name/) | Gets or sets OLE Package file name. | +### Examples + +Shows how insert an OLE object into a document. + +```python +doc = aw.Document() +builder = aw.DocumentBuilder(doc=doc) +# OLE objects allow us to open other files in the local file system using another installed application +# in our operating system by double-clicking on the shape that contains the OLE object in the document body. +# In this case, our external file will be a ZIP archive. +zip_file_bytes = system_helper.io.File.read_all_bytes(DATABASE_DIR + 'cat001.zip') +with io.BytesIO(zip_file_bytes) as stream: + shape = builder.insert_ole_object(stream=stream, prog_id='Package', as_icon=True, presentation=None) + shape.ole_format.ole_package.file_name = 'Package file name.zip' + shape.ole_format.ole_package.display_name = 'Package display name.zip' +doc.save(file_name=ARTIFACTS_DIR + 'Shape.InsertOlePackage.docx') +``` + ### See Also * module [aspose.words.drawing](../) diff --git a/english/python-net/aspose.words.drawing/olepackage/display_name/_index.md b/english/python-net/aspose.words.drawing/olepackage/display_name/_index.md index fd32b12fd55..bacf066d15f 100644 --- a/english/python-net/aspose.words.drawing/olepackage/display_name/_index.md +++ b/english/python-net/aspose.words.drawing/olepackage/display_name/_index.md @@ -25,6 +25,24 @@ def display_name(self, value: str): ``` +### Examples + +Shows how insert an OLE object into a document. + +```python +doc = aw.Document() +builder = aw.DocumentBuilder(doc=doc) +# OLE objects allow us to open other files in the local file system using another installed application +# in our operating system by double-clicking on the shape that contains the OLE object in the document body. +# In this case, our external file will be a ZIP archive. +zip_file_bytes = system_helper.io.File.read_all_bytes(DATABASE_DIR + 'cat001.zip') +with io.BytesIO(zip_file_bytes) as stream: + shape = builder.insert_ole_object(stream=stream, prog_id='Package', as_icon=True, presentation=None) + shape.ole_format.ole_package.file_name = 'Package file name.zip' + shape.ole_format.ole_package.display_name = 'Package display name.zip' +doc.save(file_name=ARTIFACTS_DIR + 'Shape.InsertOlePackage.docx') +``` + ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/olepackage/file_name/_index.md b/english/python-net/aspose.words.drawing/olepackage/file_name/_index.md index c7f48b7630c..4b6bc6c0b65 100644 --- a/english/python-net/aspose.words.drawing/olepackage/file_name/_index.md +++ b/english/python-net/aspose.words.drawing/olepackage/file_name/_index.md @@ -25,6 +25,24 @@ def file_name(self, value: str): ``` +### Examples + +Shows how insert an OLE object into a document. + +```python +doc = aw.Document() +builder = aw.DocumentBuilder(doc=doc) +# OLE objects allow us to open other files in the local file system using another installed application +# in our operating system by double-clicking on the shape that contains the OLE object in the document body. +# In this case, our external file will be a ZIP archive. +zip_file_bytes = system_helper.io.File.read_all_bytes(DATABASE_DIR + 'cat001.zip') +with io.BytesIO(zip_file_bytes) as stream: + shape = builder.insert_ole_object(stream=stream, prog_id='Package', as_icon=True, presentation=None) + shape.ole_format.ole_package.file_name = 'Package file name.zip' + shape.ole_format.ole_package.display_name = 'Package display name.zip' +doc.save(file_name=ARTIFACTS_DIR + 'Shape.InsertOlePackage.docx') +``` + ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/shape/stroke/_index.md b/english/python-net/aspose.words.drawing/shape/stroke/_index.md index 709310d815c..0f792e434a5 100644 --- a/english/python-net/aspose.words.drawing/shape/stroke/_index.md +++ b/english/python-net/aspose.words.drawing/shape/stroke/_index.md @@ -21,62 +21,6 @@ def stroke(self) -> aspose.words.drawing.Stroke: ``` -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/signatureline/id/_index.md b/english/python-net/aspose.words.drawing/signatureline/id/_index.md index f004d53ae6f..7ae1d72c179 100644 --- a/english/python-net/aspose.words.drawing/signatureline/id/_index.md +++ b/english/python-net/aspose.words.drawing/signatureline/id/_index.md @@ -30,73 +30,6 @@ def id(self, value: uuid.UUID): ``` -### Examples - -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/color/_index.md b/english/python-net/aspose.words.drawing/stroke/color/_index.md index 81a590f3045..68d0c3ef9b7 100644 --- a/english/python-net/aspose.words.drawing/stroke/color/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/color/_index.md @@ -34,62 +34,6 @@ aspose.pydrawing.Color.black. -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/dash_style/_index.md b/english/python-net/aspose.words.drawing/stroke/dash_style/_index.md index 07b01f786fa..e1350894852 100644 --- a/english/python-net/aspose.words.drawing/stroke/dash_style/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/dash_style/_index.md @@ -32,62 +32,6 @@ The default value is [DashStyle.SOLID](../../dashstyle/#SOLID). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/end_arrow_length/_index.md b/english/python-net/aspose.words.drawing/stroke/end_arrow_length/_index.md index 6b3ffb19aef..2b83229cbb5 100644 --- a/english/python-net/aspose.words.drawing/stroke/end_arrow_length/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/end_arrow_length/_index.md @@ -32,62 +32,6 @@ The default value is [ArrowLength.MEDIUM](../../arrowlength/#MEDIUM). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/end_arrow_type/_index.md b/english/python-net/aspose.words.drawing/stroke/end_arrow_type/_index.md index fe949d5be3b..7e3d3c8111e 100644 --- a/english/python-net/aspose.words.drawing/stroke/end_arrow_type/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/end_arrow_type/_index.md @@ -32,62 +32,6 @@ The default value is [ArrowType.NONE](../../arrowtype/#NONE). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/end_arrow_width/_index.md b/english/python-net/aspose.words.drawing/stroke/end_arrow_width/_index.md index 51d34eff93f..941aa621694 100644 --- a/english/python-net/aspose.words.drawing/stroke/end_arrow_width/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/end_arrow_width/_index.md @@ -32,62 +32,6 @@ The default value is [ArrowWidth.MEDIUM](../../arrowwidth/#MEDIUM). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/end_cap/_index.md b/english/python-net/aspose.words.drawing/stroke/end_cap/_index.md index 3a2d8511c36..adffad5d0f5 100644 --- a/english/python-net/aspose.words.drawing/stroke/end_cap/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/end_cap/_index.md @@ -32,62 +32,6 @@ The default value is [EndCap.FLAT](../../endcap/#FLAT). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/join_style/_index.md b/english/python-net/aspose.words.drawing/stroke/join_style/_index.md index a2e3c2f38f0..a5d19122c68 100644 --- a/english/python-net/aspose.words.drawing/stroke/join_style/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/join_style/_index.md @@ -34,60 +34,6 @@ The default value is [JoinStyle.ROUND](../../joinstyle/#ROUND). ### Examples -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - Shows how change stroke properties. ```python diff --git a/english/python-net/aspose.words.drawing/stroke/opacity/_index.md b/english/python-net/aspose.words.drawing/stroke/opacity/_index.md index 438d40a20df..23677d43a0f 100644 --- a/english/python-net/aspose.words.drawing/stroke/opacity/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/opacity/_index.md @@ -32,62 +32,6 @@ The default value is 1. -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/start_arrow_length/_index.md b/english/python-net/aspose.words.drawing/stroke/start_arrow_length/_index.md index a1f1e241112..76a6ed21fcf 100644 --- a/english/python-net/aspose.words.drawing/stroke/start_arrow_length/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/start_arrow_length/_index.md @@ -32,62 +32,6 @@ The default value is [ArrowLength.MEDIUM](../../arrowlength/#MEDIUM). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/start_arrow_type/_index.md b/english/python-net/aspose.words.drawing/stroke/start_arrow_type/_index.md index b1071235aad..7a73660f8b9 100644 --- a/english/python-net/aspose.words.drawing/stroke/start_arrow_type/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/start_arrow_type/_index.md @@ -32,62 +32,6 @@ The default value is [ArrowType.NONE](../../arrowtype/#NONE). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.drawing/stroke/start_arrow_width/_index.md b/english/python-net/aspose.words.drawing/stroke/start_arrow_width/_index.md index e8226e085df..5f713c8f21d 100644 --- a/english/python-net/aspose.words.drawing/stroke/start_arrow_width/_index.md +++ b/english/python-net/aspose.words.drawing/stroke/start_arrow_width/_index.md @@ -32,62 +32,6 @@ The default value is [ArrowWidth.MEDIUM](../../arrowwidth/#MEDIUM). -### Examples - -Shows to create a variety of shapes. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Below are four examples of shapes that we can insert into our documents. -# 1 - Dotted, horizontal, half-transparent red line -# with an arrow on the left end and a diamond on the right end: -arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -arrow.width = 200 -arrow.stroke.color = drawing.Color.red -arrow.stroke.start_arrow_type = aw.drawing.ArrowType.ARROW -arrow.stroke.start_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.start_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.end_arrow_type = aw.drawing.ArrowType.DIAMOND -arrow.stroke.end_arrow_length = aw.drawing.ArrowLength.LONG -arrow.stroke.end_arrow_width = aw.drawing.ArrowWidth.WIDE -arrow.stroke.dash_style = aw.drawing.DashStyle.DASH -arrow.stroke.opacity = 0.5 -self.assertEqual(aw.drawing.JoinStyle.MITER, arrow.stroke.join_style) -builder.insert_node(arrow) -# 2 - Thick black diagonal line with rounded ends: -line = aw.drawing.Shape(doc, aw.drawing.ShapeType.LINE) -line.top = 40 -line.width = 200 -line.height = 20 -line.stroke_weight = 5.0 -line.stroke.end_cap = aw.drawing.EndCap.ROUND -builder.insert_node(line) -# 3 - Arrow with a green fill: -filled_in_arrow = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow.width = 200 -filled_in_arrow.height = 40 -filled_in_arrow.top = 100 -filled_in_arrow.fill.fore_color = drawing.Color.green -filled_in_arrow.fill.visible = True -builder.insert_node(filled_in_arrow) -# 4 - Arrow with a flipped orientation filled in with the Aspose logo: -filled_in_arrow_img = aw.drawing.Shape(doc, aw.drawing.ShapeType.ARROW) -filled_in_arrow_img.width = 200 -filled_in_arrow_img.height = 40 -filled_in_arrow_img.top = 160 -filled_in_arrow_img.flip_orientation = aw.drawing.FlipOrientation.BOTH -with open(IMAGE_DIR + 'Logo.jpg', 'rb') as stream: - image = drawing.Image.from_stream(stream) - # When we flip the orientation of our arrow, we also flip the image that the arrow contains. - # Flip the image the other way to cancel this out before getting the shape to display it. - image.rotate_flip(drawing.RotateFlipType.ROTATE_NONE_FLIP_XY) - filled_in_arrow_img.image_data.set_image(image) - filled_in_arrow_img.stroke.join_style = aw.drawing.JoinStyle.ROUND - builder.insert_node(filled_in_arrow_img) -doc.save(ARTIFACTS_DIR + 'Drawing.various_shapes.docx') -``` - ### See Also * module [aspose.words.drawing](../../) diff --git a/english/python-net/aspose.words.fields/field/locale_id/_index.md b/english/python-net/aspose.words.fields/field/locale_id/_index.md index 1a39d3ef48d..be747c65464 100644 --- a/english/python-net/aspose.words.fields/field/locale_id/_index.md +++ b/english/python-net/aspose.words.fields/field/locale_id/_index.md @@ -25,28 +25,6 @@ def locale_id(self, value: int): ``` -### Examples - -Shows how to insert a field and work with its locale. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Insert a DATE field, and then print the date it will display. -# Your thread's current culture determines the formatting of the date. -field = builder.insert_field('DATE') -print(f'''Today's date, as displayed in the "{CultureInfo.current_culture.english_name}" culture: {field.result}''') -self.assertEqual(1033, field.locale_id) -# Changing the culture of our thread will impact the result of the DATE field. -# Another way to get the DATE field to display a date in a different culture is to use its LocaleId property. -# This way allows us to avoid changing the thread's culture to get this effect. -doc.field_options.field_update_culture_source = aw.fields.FieldUpdateCultureSource.FIELD_CODE -de_culture = CultureInfo('de-DE') -field.locale_id = de_culture.LCID -field.update() -print(f'''Today's date, as displayed according to the "{CultureInfo.get_culture_info(field.LocaleId).english_name}" culture: {field.Result}''') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldcreatedate/_index.md b/english/python-net/aspose.words.fields/fieldcreatedate/_index.md index 63ffad99a82..3408fc2390b 100644 --- a/english/python-net/aspose.words.fields/fieldcreatedate/_index.md +++ b/english/python-net/aspose.words.fields/fieldcreatedate/_index.md @@ -58,36 +58,6 @@ Retrieves the date and time at which the document was created. By default, the G |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows how to use the CREATEDATE field to display the creation date/time of the document. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was created:') -# We can use the CREATEDATE field to display the date and time of the creation of the document. -# Below are three different calendar types according to which the CREATEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_lunar_calendar = True -self.assertEqual(' CREATEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' CREATEDATE \\u', field.get_field_code()) -# 3 - Indian National Calendar: -builder.write('\nAccording to the Indian National Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_saka_era_calendar = True -self.assertEqual(' CREATEDATE \\s', field.get_field_code()) -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_create_date.docx') -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldcreatedate/use_lunar_calendar/_index.md b/english/python-net/aspose.words.fields/fieldcreatedate/use_lunar_calendar/_index.md index ac83bd6cd1e..789785e8675 100644 --- a/english/python-net/aspose.words.fields/fieldcreatedate/use_lunar_calendar/_index.md +++ b/english/python-net/aspose.words.fields/fieldcreatedate/use_lunar_calendar/_index.md @@ -25,36 +25,6 @@ def use_lunar_calendar(self, value: bool): ``` -### Examples - -Shows how to use the CREATEDATE field to display the creation date/time of the document. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was created:') -# We can use the CREATEDATE field to display the date and time of the creation of the document. -# Below are three different calendar types according to which the CREATEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_lunar_calendar = True -self.assertEqual(' CREATEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' CREATEDATE \\u', field.get_field_code()) -# 3 - Indian National Calendar: -builder.write('\nAccording to the Indian National Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_saka_era_calendar = True -self.assertEqual(' CREATEDATE \\s', field.get_field_code()) -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_create_date.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldcreatedate/use_saka_era_calendar/_index.md b/english/python-net/aspose.words.fields/fieldcreatedate/use_saka_era_calendar/_index.md index efb44936c73..f43c45028ab 100644 --- a/english/python-net/aspose.words.fields/fieldcreatedate/use_saka_era_calendar/_index.md +++ b/english/python-net/aspose.words.fields/fieldcreatedate/use_saka_era_calendar/_index.md @@ -25,36 +25,6 @@ def use_saka_era_calendar(self, value: bool): ``` -### Examples - -Shows how to use the CREATEDATE field to display the creation date/time of the document. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was created:') -# We can use the CREATEDATE field to display the date and time of the creation of the document. -# Below are three different calendar types according to which the CREATEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_lunar_calendar = True -self.assertEqual(' CREATEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' CREATEDATE \\u', field.get_field_code()) -# 3 - Indian National Calendar: -builder.write('\nAccording to the Indian National Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_saka_era_calendar = True -self.assertEqual(' CREATEDATE \\s', field.get_field_code()) -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_create_date.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldcreatedate/use_um_al_qura_calendar/_index.md b/english/python-net/aspose.words.fields/fieldcreatedate/use_um_al_qura_calendar/_index.md index 9374cac5eeb..6f82c44fa8c 100644 --- a/english/python-net/aspose.words.fields/fieldcreatedate/use_um_al_qura_calendar/_index.md +++ b/english/python-net/aspose.words.fields/fieldcreatedate/use_um_al_qura_calendar/_index.md @@ -25,36 +25,6 @@ def use_um_al_qura_calendar(self, value: bool): ``` -### Examples - -Shows how to use the CREATEDATE field to display the creation date/time of the document. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was created:') -# We can use the CREATEDATE field to display the date and time of the creation of the document. -# Below are three different calendar types according to which the CREATEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_lunar_calendar = True -self.assertEqual(' CREATEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' CREATEDATE \\u', field.get_field_code()) -# 3 - Indian National Calendar: -builder.write('\nAccording to the Indian National Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_CREATE_DATE, True).as_field_create_date() -field.use_saka_era_calendar = True -self.assertEqual(' CREATEDATE \\s', field.get_field_code()) -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_create_date.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/_index.md b/english/python-net/aspose.words.fields/fielddde/_index.md index 9d014346891..b5c58d8f005 100644 --- a/english/python-net/aspose.words.fields/fielddde/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/_index.md @@ -66,121 +66,6 @@ For information copied from another application, this field links that informati |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fielddde/auto_update/_index.md b/english/python-net/aspose.words.fields/fielddde/auto_update/_index.md index 3744eca5145..767589fbe02 100644 --- a/english/python-net/aspose.words.fields/fielddde/auto_update/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/auto_update/_index.md @@ -25,121 +25,6 @@ def auto_update(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/insert_as_bitmap/_index.md b/english/python-net/aspose.words.fields/fielddde/insert_as_bitmap/_index.md index fa7e29b4b16..a71418c8dca 100644 --- a/english/python-net/aspose.words.fields/fielddde/insert_as_bitmap/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/insert_as_bitmap/_index.md @@ -25,121 +25,6 @@ def insert_as_bitmap(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/insert_as_html/_index.md b/english/python-net/aspose.words.fields/fielddde/insert_as_html/_index.md index 7346004d901..e3b1a1fe47f 100644 --- a/english/python-net/aspose.words.fields/fielddde/insert_as_html/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/insert_as_html/_index.md @@ -25,121 +25,6 @@ def insert_as_html(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/insert_as_picture/_index.md b/english/python-net/aspose.words.fields/fielddde/insert_as_picture/_index.md index 525ee56d265..64972347a21 100644 --- a/english/python-net/aspose.words.fields/fielddde/insert_as_picture/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/insert_as_picture/_index.md @@ -25,121 +25,6 @@ def insert_as_picture(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/insert_as_rtf/_index.md b/english/python-net/aspose.words.fields/fielddde/insert_as_rtf/_index.md index 81bdc9648e6..4b367e3ac31 100644 --- a/english/python-net/aspose.words.fields/fielddde/insert_as_rtf/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/insert_as_rtf/_index.md @@ -25,121 +25,6 @@ def insert_as_rtf(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/insert_as_text/_index.md b/english/python-net/aspose.words.fields/fielddde/insert_as_text/_index.md index e750bbc022f..043e0624acf 100644 --- a/english/python-net/aspose.words.fields/fielddde/insert_as_text/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/insert_as_text/_index.md @@ -25,121 +25,6 @@ def insert_as_text(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/insert_as_unicode/_index.md b/english/python-net/aspose.words.fields/fielddde/insert_as_unicode/_index.md index e626b183403..d313f0ff9de 100644 --- a/english/python-net/aspose.words.fields/fielddde/insert_as_unicode/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/insert_as_unicode/_index.md @@ -25,121 +25,6 @@ def insert_as_unicode(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/is_linked/_index.md b/english/python-net/aspose.words.fields/fielddde/is_linked/_index.md index 90b4184e8cd..93443892606 100644 --- a/english/python-net/aspose.words.fields/fielddde/is_linked/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/is_linked/_index.md @@ -25,121 +25,6 @@ def is_linked(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/prog_id/_index.md b/english/python-net/aspose.words.fields/fielddde/prog_id/_index.md index 2b0ffb9becf..3ecd24d6535 100644 --- a/english/python-net/aspose.words.fields/fielddde/prog_id/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/prog_id/_index.md @@ -25,121 +25,6 @@ def prog_id(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/source_full_name/_index.md b/english/python-net/aspose.words.fields/fielddde/source_full_name/_index.md index d7fe4a6381a..e74cbd9a1d8 100644 --- a/english/python-net/aspose.words.fields/fielddde/source_full_name/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/source_full_name/_index.md @@ -25,121 +25,6 @@ def source_full_name(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fielddde/source_item/_index.md b/english/python-net/aspose.words.fields/fielddde/source_item/_index.md index 77da3c25fc7..b0008baf03a 100644 --- a/english/python-net/aspose.words.fields/fielddde/source_item/_index.md +++ b/english/python-net/aspose.words.fields/fielddde/source_item/_index.md @@ -25,121 +25,6 @@ def source_item(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/_index.md index b1f54acb6ae..2b449447542 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/_index.md @@ -66,121 +66,6 @@ and is updated automatically. |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_bitmap/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_bitmap/_index.md index 716fc670d34..fa369d5c97c 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_bitmap/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_bitmap/_index.md @@ -25,121 +25,6 @@ def insert_as_bitmap(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_html/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_html/_index.md index de0f5592a9c..4849db7e2a4 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_html/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_html/_index.md @@ -25,121 +25,6 @@ def insert_as_html(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_picture/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_picture/_index.md index 073cc24e302..44ea67e80e3 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_picture/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_picture/_index.md @@ -25,121 +25,6 @@ def insert_as_picture(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_rtf/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_rtf/_index.md index 8396e2b9c82..01f3457859a 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_rtf/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_rtf/_index.md @@ -25,121 +25,6 @@ def insert_as_rtf(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_text/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_text/_index.md index 1620a777dc3..00642d76d07 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_text/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_text/_index.md @@ -25,121 +25,6 @@ def insert_as_text(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_unicode/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_unicode/_index.md index 33e3d2f1570..78bb454e137 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/insert_as_unicode/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/insert_as_unicode/_index.md @@ -25,121 +25,6 @@ def insert_as_unicode(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/is_linked/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/is_linked/_index.md index 15c1255203a..6f5917aba1e 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/is_linked/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/is_linked/_index.md @@ -25,121 +25,6 @@ def is_linked(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/prog_id/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/prog_id/_index.md index 155ff2fc567..e748f90af43 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/prog_id/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/prog_id/_index.md @@ -25,121 +25,6 @@ def prog_id(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/source_full_name/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/source_full_name/_index.md index 7e5eef2e37b..d44b58b819f 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/source_full_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/source_full_name/_index.md @@ -25,121 +25,6 @@ def source_full_name(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldddeauto/source_item/_index.md b/english/python-net/aspose.words.fields/fieldddeauto/source_item/_index.md index cbc1301395d..a78d8aa3c35 100644 --- a/english/python-net/aspose.words.fields/fieldddeauto/source_item/_index.md +++ b/english/python-net/aspose.words.fields/fieldddeauto/source_item/_index.md @@ -25,121 +25,6 @@ def source_item(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/_index.md index c9d05271390..8d566e726df 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/_index.md @@ -64,37 +64,6 @@ Inserts all or part of the text and graphics contained in another document. |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/bookmark_name/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/bookmark_name/_index.md index 768cd22bd76..331ea62985b 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/bookmark_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/bookmark_name/_index.md @@ -25,37 +25,6 @@ def bookmark_name(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/encoding/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/encoding/_index.md index 7b737d57be0..49508d49bb9 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/encoding/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/encoding/_index.md @@ -25,37 +25,6 @@ def encoding(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/lock_fields/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/lock_fields/_index.md index 6f548124993..ecc9ee3a301 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/lock_fields/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/lock_fields/_index.md @@ -25,37 +25,6 @@ def lock_fields(self, value: bool): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/mime_type/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/mime_type/_index.md index 7a47cc1b38a..e389a8c39c1 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/mime_type/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/mime_type/_index.md @@ -25,37 +25,6 @@ def mime_type(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/namespace_mappings/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/namespace_mappings/_index.md index f6541b7b1be..4bc46fb3acc 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/namespace_mappings/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/namespace_mappings/_index.md @@ -25,37 +25,6 @@ def namespace_mappings(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/source_full_name/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/source_full_name/_index.md index 189089d944e..41022dd2132 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/source_full_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/source_full_name/_index.md @@ -25,37 +25,6 @@ def source_full_name(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/text_converter/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/text_converter/_index.md index 985f32aadd8..bf7304dbde9 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/text_converter/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/text_converter/_index.md @@ -25,37 +25,6 @@ def text_converter(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/xpath/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/xpath/_index.md index 98f0484f18b..40e56bc9acc 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/xpath/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/xpath/_index.md @@ -25,37 +25,6 @@ def xpath(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldincludetext/xsl_transformation/_index.md b/english/python-net/aspose.words.fields/fieldincludetext/xsl_transformation/_index.md index d572f1bd8cb..40f175a77b7 100644 --- a/english/python-net/aspose.words.fields/fieldincludetext/xsl_transformation/_index.md +++ b/english/python-net/aspose.words.fields/fieldincludetext/xsl_transformation/_index.md @@ -25,37 +25,6 @@ def xsl_transformation(self, value: str): ``` -### Examples - -Shows how to create an INCLUDETEXT field, and set its properties. - -```python -def field_include_text(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system. - # 1 - Perform an XSL transformation on an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.xsl_transformation = MY_DIR + 'CD collection XSL transformation.xsl' - builder.writeln() - # 2 - Use an XPath to take specific elements from an XML document: - field_include_text = create_field_include_text(builder, MY_DIR + 'CD collection data.xml', False, 'text/xml', 'XML', 'ISO-8859-1') - field_include_text.namespace_mappings = "xmlns:n='myNamespace'" - field_include_text.xpath = '/catalog/cd/title' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_include_text.docx') - -def create_field_include_text(builder: aw.DocumentBuilder, source_full_name: str, lock_fields: bool, mime_type: str, text_converter: str, encoding: str) -> aw.fields.FieldIncludeText: - """Use a document builder to insert an INCLUDETEXT field with custom properties.""" - field_include_text = builder.insert_field(aw.fields.FieldType.FIELD_INCLUDE_TEXT, True).as_field_include_text() - field_include_text.source_full_name = source_full_name - field_include_text.lock_fields = lock_fields - field_include_text.mime_type = mime_type - field_include_text.text_converter = text_converter - field_include_text.encoding = encoding - return field_include_text -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/_index.md b/english/python-net/aspose.words.fields/fieldlink/_index.md index 324ee8a9d60..340090971ed 100644 --- a/english/python-net/aspose.words.fields/fieldlink/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/_index.md @@ -68,121 +68,6 @@ source file. |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldlink/auto_update/_index.md b/english/python-net/aspose.words.fields/fieldlink/auto_update/_index.md index cfbf7f43c11..9ca61a639cf 100644 --- a/english/python-net/aspose.words.fields/fieldlink/auto_update/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/auto_update/_index.md @@ -25,121 +25,6 @@ def auto_update(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/format_update_type/_index.md b/english/python-net/aspose.words.fields/fieldlink/format_update_type/_index.md index a212bcb980f..ab541ac594d 100644 --- a/english/python-net/aspose.words.fields/fieldlink/format_update_type/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/format_update_type/_index.md @@ -25,121 +25,6 @@ def format_update_type(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/insert_as_bitmap/_index.md b/english/python-net/aspose.words.fields/fieldlink/insert_as_bitmap/_index.md index 91f84b83dc9..5e85253af2a 100644 --- a/english/python-net/aspose.words.fields/fieldlink/insert_as_bitmap/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/insert_as_bitmap/_index.md @@ -25,121 +25,6 @@ def insert_as_bitmap(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/insert_as_html/_index.md b/english/python-net/aspose.words.fields/fieldlink/insert_as_html/_index.md index 609711eea42..4a3373f870b 100644 --- a/english/python-net/aspose.words.fields/fieldlink/insert_as_html/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/insert_as_html/_index.md @@ -25,121 +25,6 @@ def insert_as_html(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/insert_as_picture/_index.md b/english/python-net/aspose.words.fields/fieldlink/insert_as_picture/_index.md index ea699c6d206..153540cd247 100644 --- a/english/python-net/aspose.words.fields/fieldlink/insert_as_picture/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/insert_as_picture/_index.md @@ -25,121 +25,6 @@ def insert_as_picture(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/insert_as_rtf/_index.md b/english/python-net/aspose.words.fields/fieldlink/insert_as_rtf/_index.md index 0fa088a5172..00a1314e4da 100644 --- a/english/python-net/aspose.words.fields/fieldlink/insert_as_rtf/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/insert_as_rtf/_index.md @@ -25,121 +25,6 @@ def insert_as_rtf(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/insert_as_text/_index.md b/english/python-net/aspose.words.fields/fieldlink/insert_as_text/_index.md index 4e29d1f3dbd..2148082c451 100644 --- a/english/python-net/aspose.words.fields/fieldlink/insert_as_text/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/insert_as_text/_index.md @@ -25,121 +25,6 @@ def insert_as_text(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/insert_as_unicode/_index.md b/english/python-net/aspose.words.fields/fieldlink/insert_as_unicode/_index.md index ec68c02aa85..023c62b3e0a 100644 --- a/english/python-net/aspose.words.fields/fieldlink/insert_as_unicode/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/insert_as_unicode/_index.md @@ -25,121 +25,6 @@ def insert_as_unicode(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/is_linked/_index.md b/english/python-net/aspose.words.fields/fieldlink/is_linked/_index.md index 695523d26fa..bebec155c49 100644 --- a/english/python-net/aspose.words.fields/fieldlink/is_linked/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/is_linked/_index.md @@ -25,121 +25,6 @@ def is_linked(self, value: bool): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/prog_id/_index.md b/english/python-net/aspose.words.fields/fieldlink/prog_id/_index.md index f2e414c0b80..ee2ff998f03 100644 --- a/english/python-net/aspose.words.fields/fieldlink/prog_id/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/prog_id/_index.md @@ -25,121 +25,6 @@ def prog_id(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/source_full_name/_index.md b/english/python-net/aspose.words.fields/fieldlink/source_full_name/_index.md index d10e3cf421d..a2c0cc4a0d8 100644 --- a/english/python-net/aspose.words.fields/fieldlink/source_full_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/source_full_name/_index.md @@ -25,121 +25,6 @@ def source_full_name(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldlink/source_item/_index.md b/english/python-net/aspose.words.fields/fieldlink/source_item/_index.md index 0cd3233abd5..7830bc52602 100644 --- a/english/python-net/aspose.words.fields/fieldlink/source_item/_index.md +++ b/english/python-net/aspose.words.fields/fieldlink/source_item/_index.md @@ -25,121 +25,6 @@ def source_item(self, value: str): ``` -### Examples - -Shows how to use various field types to link to other documents in the local file system, and display their contents. - -```python -def field_linked_objects_as_text(): - for insert_linked_object_as in (InsertLinkedObjectAs.TEXT, InsertLinkedObjectAs.UNICODE, InsertLinkedObjectAs.HTML, InsertLinkedObjectAs.RTF): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of text. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Word.document.8', MY_DIR + 'Document.docx', None, True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_text.docx') - -def field_linked_objects_as_image(): - for insert_linked_object_as in (InsertLinkedObjectAs.PICTURE, InsertLinkedObjectAs.BITMAP): - with self.subTest(insert_linked_object_as=insert_linked_object_as): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Below are three types of fields we can use to display contents from a linked document in the form of an image. - # 1 - A LINK field: - builder.writeln('FieldLink:\n') - insert_field_link(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'MySpreadsheet.xlsx', 'Sheet1!R2C2', True) - # 2 - A DDE field: - builder.writeln('FieldDde:\n') - insert_field_fde(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True, True) - # 3 - A DDEAUTO field: - builder.writeln('FieldDdeAuto:\n') - insert_field_fde_auto(builder, insert_linked_object_as, 'Excel.Sheet', MY_DIR + 'Spreadsheet.xlsx', 'Sheet1!R1C1', True) - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_linked_objects_as_image.docx') - -def insert_field_link(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, should_auto_update: bool): - """ExField.InsertLinkedObjectAs.BITMAP""" - field = builder.insert_field(aw.fields.FieldType.FIELD_LINK, True).as_field_link() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - builder.writeln('\n') - -def insert_field_fde(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool, should_auto_update: bool): - """Use a document builder to insert a DDE field, and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDE, True).as_field_dde() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.auto_update = should_auto_update - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - builder.writeln('\n') - -def insert_field_fde_auto(builder: aw.DocumentBuilder, insert_linked_object_as: 'ExField.InsertLinkedObjectAs', prog_id: str, source_full_name: str, source_item: str, is_linked: bool): - """Use a document builder to insert a DDEAUTO, field and set its properties according to parameters.""" - field = builder.insert_field(aw.fields.FieldType.FIELD_DDEAUTO, True).as_field_dde_auto() - if insert_linked_object_as == ExField.InsertLinkedObjectAs.TEXT: - field.insert_as_text = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.UNICODE: - field.insert_as_unicode = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.HTML: - field.insert_as_html = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.RTF: - field.insert_as_rtf = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.PICTURE: - field.insert_as_picture = True - elif insert_linked_object_as == ExField.InsertLinkedObjectAs.BITMAP: - field.insert_as_bitmap = True - field.prog_id = prog_id - field.source_full_name = source_full_name - field.source_item = source_item - field.is_linked = is_linked - -class InsertLinkedObjectAs(Enum): - # LinkedObjectAsText - TEXT = 1 - UNICODE = 2 - HTML = 3 - RTF = 4 - # LinkedObjectAsImage - PICTURE = 5 - BITMAP = 6 -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldnoteref/_index.md b/english/python-net/aspose.words.fields/fieldnoteref/_index.md index 5f231acf3dc..084b1755178 100644 --- a/english/python-net/aspose.words.fields/fieldnoteref/_index.md +++ b/english/python-net/aspose.words.fields/fieldnoteref/_index.md @@ -83,49 +83,6 @@ doc.update_fields() doc.save(file_name=ARTIFACTS_DIR + 'Field.NOTEREF.doc') ``` -Shows to insert NOTEREF fields, and modify their appearance. - -```python -def field_note_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Create a bookmark with a footnote that the NOTEREF field will reference. - insert_bookmark_with_footnote(builder, 'MyBookmark1', 'Contents of MyBookmark1', 'Footnote from MyBookmark1') - # This NOTEREF field will display the number of the footnote inside the referenced bookmark. - # Setting the "insert_hyperlink" property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word. - self.assertEqual(' NOTEREF MyBookmark2 \\h', insert_field_note_ref(builder, 'MyBookmark2', True, False, False, 'Hyperlink to Bookmark2, with footnote number ').get_field_code()) - # When using the \p flag, after the footnote number, the field also displays the bookmark's position relative to the field. - # Bookmark1 is above this field and contains footnote number 1, so the result will be "1 above" on update. - self.assertEqual(' NOTEREF MyBookmark1 \\h \\p', insert_field_note_ref(builder, 'MyBookmark1', True, True, False, 'Bookmark1, with footnote number ').get_field_code()) - # Bookmark2 is below this field and contains footnote number 2, so the field will display "2 below". - # The \f flag makes the number 2 appear in the same format as the footnote number label in the actual text. - self.assertEqual(' NOTEREF MyBookmark2 \\h \\p \\f', insert_field_note_ref(builder, 'MyBookmark2', True, True, True, 'Bookmark2, with footnote number ').get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - insert_bookmark_with_footnote(builder, 'MyBookmark2', 'Contents of MyBookmark2', 'Footnote from MyBookmark2') - doc.update_page_layout() - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_note_ref.docx') - -def insert_field_note_ref(builder: aw.DocumentBuilder, bookmark_name: str, insert_hyperlink: bool, insert_relative_position: bool, insert_reference_mark: bool, text_before: str) -> aw.fields.FieldNoteRef: - """Uses a document builder to insert a NOTEREF field with specified properties.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_NOTE_REF, True).as_field_note_ref() - field.bookmark_name = bookmark_name - field.insert_hyperlink = insert_hyperlink - field.insert_relative_position = insert_relative_position - field.insert_reference_mark = insert_reference_mark - builder.writeln() - return field - -def insert_bookmark_with_footnote(builder: aw.DocumentBuilder, bookmark_name: str, bookmark_text: str, footnote_text: str): - """Uses a document builder to insert a named bookmark with a footnote at the end.""" - builder.start_bookmark(bookmark_name) - builder.write(bookmark_text) - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, footnote_text) - builder.end_bookmark(bookmark_name) - builder.writeln() -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldnoteref/bookmark_name/_index.md b/english/python-net/aspose.words.fields/fieldnoteref/bookmark_name/_index.md index e5823999cad..c8061f154f5 100644 --- a/english/python-net/aspose.words.fields/fieldnoteref/bookmark_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldnoteref/bookmark_name/_index.md @@ -25,51 +25,6 @@ def bookmark_name(self, value: str): ``` -### Examples - -Shows to insert NOTEREF fields, and modify their appearance. - -```python -def field_note_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Create a bookmark with a footnote that the NOTEREF field will reference. - insert_bookmark_with_footnote(builder, 'MyBookmark1', 'Contents of MyBookmark1', 'Footnote from MyBookmark1') - # This NOTEREF field will display the number of the footnote inside the referenced bookmark. - # Setting the "insert_hyperlink" property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word. - self.assertEqual(' NOTEREF MyBookmark2 \\h', insert_field_note_ref(builder, 'MyBookmark2', True, False, False, 'Hyperlink to Bookmark2, with footnote number ').get_field_code()) - # When using the \p flag, after the footnote number, the field also displays the bookmark's position relative to the field. - # Bookmark1 is above this field and contains footnote number 1, so the result will be "1 above" on update. - self.assertEqual(' NOTEREF MyBookmark1 \\h \\p', insert_field_note_ref(builder, 'MyBookmark1', True, True, False, 'Bookmark1, with footnote number ').get_field_code()) - # Bookmark2 is below this field and contains footnote number 2, so the field will display "2 below". - # The \f flag makes the number 2 appear in the same format as the footnote number label in the actual text. - self.assertEqual(' NOTEREF MyBookmark2 \\h \\p \\f', insert_field_note_ref(builder, 'MyBookmark2', True, True, True, 'Bookmark2, with footnote number ').get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - insert_bookmark_with_footnote(builder, 'MyBookmark2', 'Contents of MyBookmark2', 'Footnote from MyBookmark2') - doc.update_page_layout() - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_note_ref.docx') - -def insert_field_note_ref(builder: aw.DocumentBuilder, bookmark_name: str, insert_hyperlink: bool, insert_relative_position: bool, insert_reference_mark: bool, text_before: str) -> aw.fields.FieldNoteRef: - """Uses a document builder to insert a NOTEREF field with specified properties.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_NOTE_REF, True).as_field_note_ref() - field.bookmark_name = bookmark_name - field.insert_hyperlink = insert_hyperlink - field.insert_relative_position = insert_relative_position - field.insert_reference_mark = insert_reference_mark - builder.writeln() - return field - -def insert_bookmark_with_footnote(builder: aw.DocumentBuilder, bookmark_name: str, bookmark_text: str, footnote_text: str): - """Uses a document builder to insert a named bookmark with a footnote at the end.""" - builder.start_bookmark(bookmark_name) - builder.write(bookmark_text) - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, footnote_text) - builder.end_bookmark(bookmark_name) - builder.writeln() -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldnoteref/insert_hyperlink/_index.md b/english/python-net/aspose.words.fields/fieldnoteref/insert_hyperlink/_index.md index 155500956c8..20c32aa990c 100644 --- a/english/python-net/aspose.words.fields/fieldnoteref/insert_hyperlink/_index.md +++ b/english/python-net/aspose.words.fields/fieldnoteref/insert_hyperlink/_index.md @@ -25,51 +25,6 @@ def insert_hyperlink(self, value: bool): ``` -### Examples - -Shows to insert NOTEREF fields, and modify their appearance. - -```python -def field_note_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Create a bookmark with a footnote that the NOTEREF field will reference. - insert_bookmark_with_footnote(builder, 'MyBookmark1', 'Contents of MyBookmark1', 'Footnote from MyBookmark1') - # This NOTEREF field will display the number of the footnote inside the referenced bookmark. - # Setting the "insert_hyperlink" property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word. - self.assertEqual(' NOTEREF MyBookmark2 \\h', insert_field_note_ref(builder, 'MyBookmark2', True, False, False, 'Hyperlink to Bookmark2, with footnote number ').get_field_code()) - # When using the \p flag, after the footnote number, the field also displays the bookmark's position relative to the field. - # Bookmark1 is above this field and contains footnote number 1, so the result will be "1 above" on update. - self.assertEqual(' NOTEREF MyBookmark1 \\h \\p', insert_field_note_ref(builder, 'MyBookmark1', True, True, False, 'Bookmark1, with footnote number ').get_field_code()) - # Bookmark2 is below this field and contains footnote number 2, so the field will display "2 below". - # The \f flag makes the number 2 appear in the same format as the footnote number label in the actual text. - self.assertEqual(' NOTEREF MyBookmark2 \\h \\p \\f', insert_field_note_ref(builder, 'MyBookmark2', True, True, True, 'Bookmark2, with footnote number ').get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - insert_bookmark_with_footnote(builder, 'MyBookmark2', 'Contents of MyBookmark2', 'Footnote from MyBookmark2') - doc.update_page_layout() - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_note_ref.docx') - -def insert_field_note_ref(builder: aw.DocumentBuilder, bookmark_name: str, insert_hyperlink: bool, insert_relative_position: bool, insert_reference_mark: bool, text_before: str) -> aw.fields.FieldNoteRef: - """Uses a document builder to insert a NOTEREF field with specified properties.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_NOTE_REF, True).as_field_note_ref() - field.bookmark_name = bookmark_name - field.insert_hyperlink = insert_hyperlink - field.insert_relative_position = insert_relative_position - field.insert_reference_mark = insert_reference_mark - builder.writeln() - return field - -def insert_bookmark_with_footnote(builder: aw.DocumentBuilder, bookmark_name: str, bookmark_text: str, footnote_text: str): - """Uses a document builder to insert a named bookmark with a footnote at the end.""" - builder.start_bookmark(bookmark_name) - builder.write(bookmark_text) - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, footnote_text) - builder.end_bookmark(bookmark_name) - builder.writeln() -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldnoteref/insert_reference_mark/_index.md b/english/python-net/aspose.words.fields/fieldnoteref/insert_reference_mark/_index.md index b3e51c352bf..3f7267fac35 100644 --- a/english/python-net/aspose.words.fields/fieldnoteref/insert_reference_mark/_index.md +++ b/english/python-net/aspose.words.fields/fieldnoteref/insert_reference_mark/_index.md @@ -26,51 +26,6 @@ def insert_reference_mark(self, value: bool): ``` -### Examples - -Shows to insert NOTEREF fields, and modify their appearance. - -```python -def field_note_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Create a bookmark with a footnote that the NOTEREF field will reference. - insert_bookmark_with_footnote(builder, 'MyBookmark1', 'Contents of MyBookmark1', 'Footnote from MyBookmark1') - # This NOTEREF field will display the number of the footnote inside the referenced bookmark. - # Setting the "insert_hyperlink" property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word. - self.assertEqual(' NOTEREF MyBookmark2 \\h', insert_field_note_ref(builder, 'MyBookmark2', True, False, False, 'Hyperlink to Bookmark2, with footnote number ').get_field_code()) - # When using the \p flag, after the footnote number, the field also displays the bookmark's position relative to the field. - # Bookmark1 is above this field and contains footnote number 1, so the result will be "1 above" on update. - self.assertEqual(' NOTEREF MyBookmark1 \\h \\p', insert_field_note_ref(builder, 'MyBookmark1', True, True, False, 'Bookmark1, with footnote number ').get_field_code()) - # Bookmark2 is below this field and contains footnote number 2, so the field will display "2 below". - # The \f flag makes the number 2 appear in the same format as the footnote number label in the actual text. - self.assertEqual(' NOTEREF MyBookmark2 \\h \\p \\f', insert_field_note_ref(builder, 'MyBookmark2', True, True, True, 'Bookmark2, with footnote number ').get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - insert_bookmark_with_footnote(builder, 'MyBookmark2', 'Contents of MyBookmark2', 'Footnote from MyBookmark2') - doc.update_page_layout() - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_note_ref.docx') - -def insert_field_note_ref(builder: aw.DocumentBuilder, bookmark_name: str, insert_hyperlink: bool, insert_relative_position: bool, insert_reference_mark: bool, text_before: str) -> aw.fields.FieldNoteRef: - """Uses a document builder to insert a NOTEREF field with specified properties.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_NOTE_REF, True).as_field_note_ref() - field.bookmark_name = bookmark_name - field.insert_hyperlink = insert_hyperlink - field.insert_relative_position = insert_relative_position - field.insert_reference_mark = insert_reference_mark - builder.writeln() - return field - -def insert_bookmark_with_footnote(builder: aw.DocumentBuilder, bookmark_name: str, bookmark_text: str, footnote_text: str): - """Uses a document builder to insert a named bookmark with a footnote at the end.""" - builder.start_bookmark(bookmark_name) - builder.write(bookmark_text) - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, footnote_text) - builder.end_bookmark(bookmark_name) - builder.writeln() -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldnoteref/insert_relative_position/_index.md b/english/python-net/aspose.words.fields/fieldnoteref/insert_relative_position/_index.md index 87bd0cf1ee8..6452a98075f 100644 --- a/english/python-net/aspose.words.fields/fieldnoteref/insert_relative_position/_index.md +++ b/english/python-net/aspose.words.fields/fieldnoteref/insert_relative_position/_index.md @@ -25,51 +25,6 @@ def insert_relative_position(self, value: bool): ``` -### Examples - -Shows to insert NOTEREF fields, and modify their appearance. - -```python -def field_note_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - # Create a bookmark with a footnote that the NOTEREF field will reference. - insert_bookmark_with_footnote(builder, 'MyBookmark1', 'Contents of MyBookmark1', 'Footnote from MyBookmark1') - # This NOTEREF field will display the number of the footnote inside the referenced bookmark. - # Setting the "insert_hyperlink" property lets us jump to the bookmark by Ctrl + clicking the field in Microsoft Word. - self.assertEqual(' NOTEREF MyBookmark2 \\h', insert_field_note_ref(builder, 'MyBookmark2', True, False, False, 'Hyperlink to Bookmark2, with footnote number ').get_field_code()) - # When using the \p flag, after the footnote number, the field also displays the bookmark's position relative to the field. - # Bookmark1 is above this field and contains footnote number 1, so the result will be "1 above" on update. - self.assertEqual(' NOTEREF MyBookmark1 \\h \\p', insert_field_note_ref(builder, 'MyBookmark1', True, True, False, 'Bookmark1, with footnote number ').get_field_code()) - # Bookmark2 is below this field and contains footnote number 2, so the field will display "2 below". - # The \f flag makes the number 2 appear in the same format as the footnote number label in the actual text. - self.assertEqual(' NOTEREF MyBookmark2 \\h \\p \\f', insert_field_note_ref(builder, 'MyBookmark2', True, True, True, 'Bookmark2, with footnote number ').get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - insert_bookmark_with_footnote(builder, 'MyBookmark2', 'Contents of MyBookmark2', 'Footnote from MyBookmark2') - doc.update_page_layout() - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_note_ref.docx') - -def insert_field_note_ref(builder: aw.DocumentBuilder, bookmark_name: str, insert_hyperlink: bool, insert_relative_position: bool, insert_reference_mark: bool, text_before: str) -> aw.fields.FieldNoteRef: - """Uses a document builder to insert a NOTEREF field with specified properties.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_NOTE_REF, True).as_field_note_ref() - field.bookmark_name = bookmark_name - field.insert_hyperlink = insert_hyperlink - field.insert_relative_position = insert_relative_position - field.insert_reference_mark = insert_reference_mark - builder.writeln() - return field - -def insert_bookmark_with_footnote(builder: aw.DocumentBuilder, bookmark_name: str, bookmark_text: str, footnote_text: str): - """Uses a document builder to insert a named bookmark with a footnote at the end.""" - builder.start_bookmark(bookmark_name) - builder.write(bookmark_text) - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, footnote_text) - builder.end_bookmark(bookmark_name) - builder.writeln() -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldoptions/use_invariant_culture_number_format/_index.md b/english/python-net/aspose.words.fields/fieldoptions/use_invariant_culture_number_format/_index.md index 0b4cc9d2fcd..f8d64565d6c 100644 --- a/english/python-net/aspose.words.fields/fieldoptions/use_invariant_culture_number_format/_index.md +++ b/english/python-net/aspose.words.fields/fieldoptions/use_invariant_culture_number_format/_index.md @@ -38,28 +38,6 @@ The default value is ``False``. -### Examples - -Shows how to format numbers according to the invariant culture. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -Thread.current_thread.current_culture = 'de-DE' -field = builder.insert_field(' = 1234567,89 \\# $#,###,###.##') -field.update() -# Sometimes, fields may not format their numbers correctly under certain cultures. -self.assertFalse(doc.field_options.use_invariant_culture_number_format) -self.assertEqual('$1234567,89 . ', field.result) -# To fix this, we could change the culture for the entire thread. -# Another way to fix this is to set this flag, -# which gets all fields to use the invariant culture when formatting numbers. -# This way allows us to avoid changing the culture for the entire thread. -doc.field_options.use_invariant_culture_number_format = True -field.update() -self.assertEqual('$1.234.567,89', field.result) -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldrd/_index.md b/english/python-net/aspose.words.fields/fieldrd/_index.md index 86d118487e3..6ce597b2fbd 100644 --- a/english/python-net/aspose.words.fields/fieldrd/_index.md +++ b/english/python-net/aspose.words.fields/fieldrd/_index.md @@ -58,35 +58,6 @@ with the TOC, TOA, or INDEX field |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows to use the RD field to create a table of contents entries from headings in other documents. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Use a document builder to insert a table of contents, -# and then add one entry for the table of contents on the following page. -builder.insert_field(aw.fields.FieldType.FIELD_TOC, True) -builder.insert_break(aw.BreakType.PAGE_BREAK) -builder.current_paragraph.paragraph_format.style_name = 'Heading 1' -builder.writeln('TOC entry from within this document') -# Insert an RD field, which references another local file system document in its FileName property. -# The TOC will also now accept all headings from the referenced document as entries for its table. -field = builder.insert_field(aw.fields.FieldType.FIELD_REF_DOC, True).as_field_rd() -field.file_name = ARTIFACTS_DIR + 'ReferencedDocument.docx' -self.assertEqual(' RD {ArtifactsDir.Replace(@"\\",@"\\\\")}ReferencedDocument.docx', field.get_field_code()) -# Create the document that the RD field is referencing and insert a heading. -# This heading will show up as an entry in the TOC field in our first document. -referenced_doc = aw.Document() -ref_doc_builder = aw.DocumentBuilder(referenced_doc) -ref_doc_builder.current_paragraph.paragraph_format.style_name = 'Heading 1' -ref_doc_builder.writeln('TOC entry from referenced document') -referenced_doc.save(ARTIFACTS_DIR + 'ReferencedDocument.docx') -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_rd.docx') -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldrd/file_name/_index.md b/english/python-net/aspose.words.fields/fieldrd/file_name/_index.md index 2e121f8bb05..787105da4f2 100644 --- a/english/python-net/aspose.words.fields/fieldrd/file_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldrd/file_name/_index.md @@ -25,35 +25,6 @@ def file_name(self, value: str): ``` -### Examples - -Shows to use the RD field to create a table of contents entries from headings in other documents. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Use a document builder to insert a table of contents, -# and then add one entry for the table of contents on the following page. -builder.insert_field(aw.fields.FieldType.FIELD_TOC, True) -builder.insert_break(aw.BreakType.PAGE_BREAK) -builder.current_paragraph.paragraph_format.style_name = 'Heading 1' -builder.writeln('TOC entry from within this document') -# Insert an RD field, which references another local file system document in its FileName property. -# The TOC will also now accept all headings from the referenced document as entries for its table. -field = builder.insert_field(aw.fields.FieldType.FIELD_REF_DOC, True).as_field_rd() -field.file_name = ARTIFACTS_DIR + 'ReferencedDocument.docx' -self.assertEqual(' RD {ArtifactsDir.Replace(@"\\",@"\\\\")}ReferencedDocument.docx', field.get_field_code()) -# Create the document that the RD field is referencing and insert a heading. -# This heading will show up as an entry in the TOC field in our first document. -referenced_doc = aw.Document() -ref_doc_builder = aw.DocumentBuilder(referenced_doc) -ref_doc_builder.current_paragraph.paragraph_format.style_name = 'Heading 1' -ref_doc_builder.writeln('TOC entry from referenced document') -referenced_doc.save(ARTIFACTS_DIR + 'ReferencedDocument.docx') -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_rd.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldrd/is_path_relative/_index.md b/english/python-net/aspose.words.fields/fieldrd/is_path_relative/_index.md index 873f3b0efda..e308ac3994c 100644 --- a/english/python-net/aspose.words.fields/fieldrd/is_path_relative/_index.md +++ b/english/python-net/aspose.words.fields/fieldrd/is_path_relative/_index.md @@ -25,35 +25,6 @@ def is_path_relative(self, value: bool): ``` -### Examples - -Shows to use the RD field to create a table of contents entries from headings in other documents. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# Use a document builder to insert a table of contents, -# and then add one entry for the table of contents on the following page. -builder.insert_field(aw.fields.FieldType.FIELD_TOC, True) -builder.insert_break(aw.BreakType.PAGE_BREAK) -builder.current_paragraph.paragraph_format.style_name = 'Heading 1' -builder.writeln('TOC entry from within this document') -# Insert an RD field, which references another local file system document in its FileName property. -# The TOC will also now accept all headings from the referenced document as entries for its table. -field = builder.insert_field(aw.fields.FieldType.FIELD_REF_DOC, True).as_field_rd() -field.file_name = ARTIFACTS_DIR + 'ReferencedDocument.docx' -self.assertEqual(' RD {ArtifactsDir.Replace(@"\\",@"\\\\")}ReferencedDocument.docx', field.get_field_code()) -# Create the document that the RD field is referencing and insert a heading. -# This heading will show up as an entry in the TOC field in our first document. -referenced_doc = aw.Document() -ref_doc_builder = aw.DocumentBuilder(referenced_doc) -ref_doc_builder.current_paragraph.paragraph_format.style_name = 'Heading 1' -ref_doc_builder.writeln('TOC entry from referenced document') -referenced_doc.save(ARTIFACTS_DIR + 'ReferencedDocument.docx') -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_rd.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/_index.md b/english/python-net/aspose.words.fields/fieldref/_index.md index f742a8448c3..8eeb7a2601f 100644 --- a/english/python-net/aspose.words.fields/fieldref/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/_index.md @@ -87,67 +87,6 @@ self.assertEqual('Hello world!', field_ref.result) doc.save(file_name=ARTIFACTS_DIR + 'Field.SET.REF.docx') ``` -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldref/bookmark_name/_index.md b/english/python-net/aspose.words.fields/fieldref/bookmark_name/_index.md index 119fe9d1c40..6c452670cf7 100644 --- a/english/python-net/aspose.words.fields/fieldref/bookmark_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/bookmark_name/_index.md @@ -48,67 +48,6 @@ self.assertEqual('Hello world!', field_ref.result) doc.save(file_name=ARTIFACTS_DIR + 'Field.SET.REF.docx') ``` -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/include_note_or_comment/_index.md b/english/python-net/aspose.words.fields/fieldref/include_note_or_comment/_index.md index 065d7191252..36ee36d01b9 100644 --- a/english/python-net/aspose.words.fields/fieldref/include_note_or_comment/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/include_note_or_comment/_index.md @@ -26,69 +26,6 @@ def include_note_or_comment(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/insert_hyperlink/_index.md b/english/python-net/aspose.words.fields/fieldref/insert_hyperlink/_index.md index cf4f19280a6..c58b70a1667 100644 --- a/english/python-net/aspose.words.fields/fieldref/insert_hyperlink/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/insert_hyperlink/_index.md @@ -25,69 +25,6 @@ def insert_hyperlink(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number/_index.md b/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number/_index.md index b1008be155b..6adc2057371 100644 --- a/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number/_index.md @@ -25,69 +25,6 @@ def insert_paragraph_number(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_full_context/_index.md b/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_full_context/_index.md index e71edea330e..e239f931846 100644 --- a/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_full_context/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_full_context/_index.md @@ -25,69 +25,6 @@ def insert_paragraph_number_in_full_context(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_relative_context/_index.md b/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_relative_context/_index.md index 428d117d0bd..4336bbf63f3 100644 --- a/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_relative_context/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/insert_paragraph_number_in_relative_context/_index.md @@ -25,69 +25,6 @@ def insert_paragraph_number_in_relative_context(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/insert_relative_position/_index.md b/english/python-net/aspose.words.fields/fieldref/insert_relative_position/_index.md index 47d23291fd9..b7418ec4211 100644 --- a/english/python-net/aspose.words.fields/fieldref/insert_relative_position/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/insert_relative_position/_index.md @@ -25,69 +25,6 @@ def insert_relative_position(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/number_separator/_index.md b/english/python-net/aspose.words.fields/fieldref/number_separator/_index.md index 61abb6fadef..e7d8a01bbe3 100644 --- a/english/python-net/aspose.words.fields/fieldref/number_separator/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/number_separator/_index.md @@ -25,69 +25,6 @@ def number_separator(self, value: str): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldref/suppress_non_delimiters/_index.md b/english/python-net/aspose.words.fields/fieldref/suppress_non_delimiters/_index.md index 6cb5fdc154e..3de0eff2935 100644 --- a/english/python-net/aspose.words.fields/fieldref/suppress_non_delimiters/_index.md +++ b/english/python-net/aspose.words.fields/fieldref/suppress_non_delimiters/_index.md @@ -25,69 +25,6 @@ def suppress_non_delimiters(self, value: bool): ``` -### Examples - -Shows how to insert REF fields to reference bookmarks. - -```python -def field_ref(): - doc = aw.Document() - builder = aw.DocumentBuilder(doc) - builder.start_bookmark('MyBookmark') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #1') - builder.write('Text that will appear in REF field') - builder.insert_footnote(aw.notes.FootnoteType.FOOTNOTE, 'MyBookmark footnote #2') - builder.end_bookmark('MyBookmark') - builder.move_to_document_start() - # We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at. - builder.list_format.apply_number_default() - builder.list_format.list_level.number_format = '> \x0000' - # Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes. - field = insert_field_ref(builder, 'MyBookmark', '', '\n') - field.include_note_or_comment = True - field.insert_hyperlink = True - self.assertEqual(' REF MyBookmark \\f \\h', field.get_field_code()) - # Insert a REF field, and display whether the referenced bookmark is above or below it. - field = insert_field_ref(builder, 'MyBookmark', 'The referenced paragraph is ', ' this field.\n') - field.insert_relative_position = True - self.assertEqual(' REF MyBookmark \\p', field.get_field_code()) - # Display the list number of the bookmark as it appears in the document. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number is ", '\n') - field.insert_paragraph_number = True - self.assertEqual(' REF MyBookmark \\n', field.get_field_code()) - # Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's paragraph number, non-delimiters suppressed, is ", '\n') - field.insert_paragraph_number = True - field.suppress_non_delimiters = True - self.assertEqual(' REF MyBookmark \\n \\t', field.get_field_code()) - # Move down one list level. - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>> \x0001' - # Display the list number of the bookmark and the numbers of all the list levels above it. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's full context paragraph number is ", '\n') - field.insert_paragraph_number_in_full_context = True - self.assertEqual(' REF MyBookmark \\w', field.get_field_code()) - builder.insert_break(aw.BreakType.PAGE_BREAK) - # Display the list level numbers between this REF field, and the bookmark that it is referencing. - field = insert_field_ref(builder, 'MyBookmark', "The bookmark's relative paragraph number is ", '\n') - field.insert_paragraph_number_in_relative_context = True - self.assertEqual(' REF MyBookmark \\r', field.get_field_code()) - # At the end of the document, the bookmark will show up as a list item here. - builder.writeln('List level above bookmark') - builder.list_format.list_level_number += 1 - builder.list_format.list_level.number_format = '>>> \x0002' - doc.update_fields() - doc.save(ARTIFACTS_DIR + 'Field.field_ref.docx') - -def insert_field_ref(builder: aw.DocumentBuilder, bookmark_name: str, text_before: str, text_after: str) -> aw.fields.FieldRef: - """Get the document builder to insert a REF field, reference a bookmark with it, and add text before and after it.""" - builder.write(text_before) - field = builder.insert_field(aw.fields.FieldType.FIELD_REF, True).as_field_ref() - field.bookmark_name = bookmark_name - builder.write(text_after) - return field -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldsavedate/_index.md b/english/python-net/aspose.words.fields/fieldsavedate/_index.md index ffe6c7dc3b2..c217e3fe81d 100644 --- a/english/python-net/aspose.words.fields/fieldsavedate/_index.md +++ b/english/python-net/aspose.words.fields/fieldsavedate/_index.md @@ -58,41 +58,6 @@ Retrieves the date and time on which the document was last saved. By default, th |[ update()](../field/update/#default) | Performs the field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | |[ update(ignore_merge_format)](../field/update/#bool) | Performs a field update. Throws if the field is being updated already.
(Inherited from [Field](../field/)) | -### Examples - -Shows how to use the SAVEDATE field to display the date/time of the document's most recent save operation performed using Microsoft Word. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was last saved:') -# We can use the SAVEDATE field to display the last save operation's date and time on the document. -# The save operation that these fields refer to is the manual save in an application like Microsoft Word, -# not the document's "save" method. -# Below are three different calendar types according to which the SAVEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_lunar_calendar = True -self.assertEqual(' SAVEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' SAVEDATE \\u', field.get_field_code()) -# 3 - Indian National calendar: -builder.write('\nAccording to the Indian National calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_saka_era_calendar = True -self.assertEqual(' SAVEDATE \\s', field.get_field_code()) -# The SAVEDATE fields draw their date/time values from the "last_saved_time" built-in property. -# The document's Save method will not update this value, but we can still update it manually. -doc.built_in_document_properties.last_saved_time = datetime.datetime.now() -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_save_date.docx') -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldsavedate/use_lunar_calendar/_index.md b/english/python-net/aspose.words.fields/fieldsavedate/use_lunar_calendar/_index.md index 911e75ad6a4..bd8872e1a5d 100644 --- a/english/python-net/aspose.words.fields/fieldsavedate/use_lunar_calendar/_index.md +++ b/english/python-net/aspose.words.fields/fieldsavedate/use_lunar_calendar/_index.md @@ -25,41 +25,6 @@ def use_lunar_calendar(self, value: bool): ``` -### Examples - -Shows how to use the SAVEDATE field to display the date/time of the document's most recent save operation performed using Microsoft Word. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was last saved:') -# We can use the SAVEDATE field to display the last save operation's date and time on the document. -# The save operation that these fields refer to is the manual save in an application like Microsoft Word, -# not the document's "save" method. -# Below are three different calendar types according to which the SAVEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_lunar_calendar = True -self.assertEqual(' SAVEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' SAVEDATE \\u', field.get_field_code()) -# 3 - Indian National calendar: -builder.write('\nAccording to the Indian National calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_saka_era_calendar = True -self.assertEqual(' SAVEDATE \\s', field.get_field_code()) -# The SAVEDATE fields draw their date/time values from the "last_saved_time" built-in property. -# The document's Save method will not update this value, but we can still update it manually. -doc.built_in_document_properties.last_saved_time = datetime.datetime.now() -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_save_date.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldsavedate/use_saka_era_calendar/_index.md b/english/python-net/aspose.words.fields/fieldsavedate/use_saka_era_calendar/_index.md index 5c9587aa881..cbbf966db72 100644 --- a/english/python-net/aspose.words.fields/fieldsavedate/use_saka_era_calendar/_index.md +++ b/english/python-net/aspose.words.fields/fieldsavedate/use_saka_era_calendar/_index.md @@ -25,41 +25,6 @@ def use_saka_era_calendar(self, value: bool): ``` -### Examples - -Shows how to use the SAVEDATE field to display the date/time of the document's most recent save operation performed using Microsoft Word. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was last saved:') -# We can use the SAVEDATE field to display the last save operation's date and time on the document. -# The save operation that these fields refer to is the manual save in an application like Microsoft Word, -# not the document's "save" method. -# Below are three different calendar types according to which the SAVEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_lunar_calendar = True -self.assertEqual(' SAVEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' SAVEDATE \\u', field.get_field_code()) -# 3 - Indian National calendar: -builder.write('\nAccording to the Indian National calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_saka_era_calendar = True -self.assertEqual(' SAVEDATE \\s', field.get_field_code()) -# The SAVEDATE fields draw their date/time values from the "last_saved_time" built-in property. -# The document's Save method will not update this value, but we can still update it manually. -doc.built_in_document_properties.last_saved_time = datetime.datetime.now() -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_save_date.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldsavedate/use_um_al_qura_calendar/_index.md b/english/python-net/aspose.words.fields/fieldsavedate/use_um_al_qura_calendar/_index.md index d12541c5dbf..63e3cdd22be 100644 --- a/english/python-net/aspose.words.fields/fieldsavedate/use_um_al_qura_calendar/_index.md +++ b/english/python-net/aspose.words.fields/fieldsavedate/use_um_al_qura_calendar/_index.md @@ -25,41 +25,6 @@ def use_um_al_qura_calendar(self, value: bool): ``` -### Examples - -Shows how to use the SAVEDATE field to display the date/time of the document's most recent save operation performed using Microsoft Word. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was last saved:') -# We can use the SAVEDATE field to display the last save operation's date and time on the document. -# The save operation that these fields refer to is the manual save in an application like Microsoft Word, -# not the document's "save" method. -# Below are three different calendar types according to which the SAVEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_lunar_calendar = True -self.assertEqual(' SAVEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' SAVEDATE \\u', field.get_field_code()) -# 3 - Indian National calendar: -builder.write('\nAccording to the Indian National calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_saka_era_calendar = True -self.assertEqual(' SAVEDATE \\s', field.get_field_code()) -# The SAVEDATE fields draw their date/time values from the "last_saved_time" built-in property. -# The document's Save method will not update this value, but we can still update it manually. -doc.built_in_document_properties.last_saved_time = datetime.datetime.now() -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_save_date.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldseq/_index.md b/english/python-net/aspose.words.fields/fieldseq/_index.md index 77d2ee668b7..a9df8a67189 100644 --- a/english/python-net/aspose.words.fields/fieldseq/_index.md +++ b/english/python-net/aspose.words.fields/fieldseq/_index.md @@ -170,65 +170,6 @@ doc.update_fields() doc.save(file_name=ARTIFACTS_DIR + 'Field.SEQ.ResetNumbering.docx') ``` -Shows how to combine table of contents and sequence fields. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# A TOC field can create an entry in its table of contents for each SEQ field found in the document. -# Each entry contains the paragraph that contains the SEQ field, -# and the number of the page that the field appears on. -field_toc = builder.insert_field(aw.fields.FieldType.FIELD_TOC, True).as_field_toc() -# Configure this TOC field to have a "sequence_identifier" property with a value of "MySequence". -field_toc.table_of_figures_label = 'MySequence' -# Configure this TOC field to only pick up SEQ fields that are within the bounds of a bookmark -# named "TOCBookmark". -field_toc.bookmark_name = 'TOCBookmark' -builder.insert_break(aw.BreakType.PAGE_BREAK) -self.assertEqual(' TOC \\c MySequence \\b TOCBookmark', field_toc.get_field_code()) -# SEQ fields display a count that increments at each SEQ field. -# These fields also maintain separate counts for each unique named sequence -# identified by the SEQ field's "sequence_identifier" property. -# Insert a SEQ field that has a sequence identifier that matches the TOC's -# "table_of_figures_label" property. This field will not create an entry in the TOC since it is outside -# the bookmark's bounds designated by "BookmarkName". -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -builder.writeln(', will not show up in the TOC because it is outside of the bookmark.') -builder.start_bookmark('TOCBookmark') -# This SEQ field's sequence matches the TOC's "table_of_figures_label" property and is within the bookmark's bounds. -# The paragraph that contains this field will show up in the TOC as an entry. -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -builder.writeln(', will show up in the TOC next to the entry for the above caption.') -# This SEQ field's sequence does not match the TOC's "table_of_figures_label" property, -# and is within the bounds of the bookmark. Its paragraph will not show up in the TOC as an entry. -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'OtherSequence' -builder.writeln(", will not show up in the TOC because it's from a different sequence identifier.") -# This SEQ field's sequence matches the TOC's "table_of_figures_label" property and is within the bounds of the bookmark. -# This field also references another bookmark. The contents of that bookmark will appear in the TOC entry for this SEQ field. -# The SEQ field itself will not display the contents of that bookmark. -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -field_seq.bookmark_name = 'SEQBookmark' -self.assertEqual(' SEQ MySequence SEQBookmark', field_seq.get_field_code()) -# Create a bookmark with contents that will show up in the TOC entry due to the above SEQ field referencing it. -builder.insert_break(aw.BreakType.PAGE_BREAK) -builder.start_bookmark('SEQBookmark') -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -builder.writeln(', text from inside SEQBookmark.') -builder.end_bookmark('SEQBookmark') -builder.end_bookmark('TOCBookmark') -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.toc_seq_bookmark.docx') -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldseq/bookmark_name/_index.md b/english/python-net/aspose.words.fields/fieldseq/bookmark_name/_index.md index 7c1dac9d3a8..20e22ac1ac2 100644 --- a/english/python-net/aspose.words.fields/fieldseq/bookmark_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldseq/bookmark_name/_index.md @@ -25,67 +25,6 @@ def bookmark_name(self, value: str): ``` -### Examples - -Shows how to combine table of contents and sequence fields. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -# A TOC field can create an entry in its table of contents for each SEQ field found in the document. -# Each entry contains the paragraph that contains the SEQ field, -# and the number of the page that the field appears on. -field_toc = builder.insert_field(aw.fields.FieldType.FIELD_TOC, True).as_field_toc() -# Configure this TOC field to have a "sequence_identifier" property with a value of "MySequence". -field_toc.table_of_figures_label = 'MySequence' -# Configure this TOC field to only pick up SEQ fields that are within the bounds of a bookmark -# named "TOCBookmark". -field_toc.bookmark_name = 'TOCBookmark' -builder.insert_break(aw.BreakType.PAGE_BREAK) -self.assertEqual(' TOC \\c MySequence \\b TOCBookmark', field_toc.get_field_code()) -# SEQ fields display a count that increments at each SEQ field. -# These fields also maintain separate counts for each unique named sequence -# identified by the SEQ field's "sequence_identifier" property. -# Insert a SEQ field that has a sequence identifier that matches the TOC's -# "table_of_figures_label" property. This field will not create an entry in the TOC since it is outside -# the bookmark's bounds designated by "BookmarkName". -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -builder.writeln(', will not show up in the TOC because it is outside of the bookmark.') -builder.start_bookmark('TOCBookmark') -# This SEQ field's sequence matches the TOC's "table_of_figures_label" property and is within the bookmark's bounds. -# The paragraph that contains this field will show up in the TOC as an entry. -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -builder.writeln(', will show up in the TOC next to the entry for the above caption.') -# This SEQ field's sequence does not match the TOC's "table_of_figures_label" property, -# and is within the bounds of the bookmark. Its paragraph will not show up in the TOC as an entry. -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'OtherSequence' -builder.writeln(", will not show up in the TOC because it's from a different sequence identifier.") -# This SEQ field's sequence matches the TOC's "table_of_figures_label" property and is within the bounds of the bookmark. -# This field also references another bookmark. The contents of that bookmark will appear in the TOC entry for this SEQ field. -# The SEQ field itself will not display the contents of that bookmark. -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -field_seq.bookmark_name = 'SEQBookmark' -self.assertEqual(' SEQ MySequence SEQBookmark', field_seq.get_field_code()) -# Create a bookmark with contents that will show up in the TOC entry due to the above SEQ field referencing it. -builder.insert_break(aw.BreakType.PAGE_BREAK) -builder.start_bookmark('SEQBookmark') -builder.write('MySequence #') -field_seq = builder.insert_field(aw.fields.FieldType.FIELD_SEQUENCE, True).as_field_seq() -field_seq.sequence_identifier = 'MySequence' -builder.writeln(', text from inside SEQBookmark.') -builder.end_bookmark('SEQBookmark') -builder.end_bookmark('TOCBookmark') -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.toc_seq_bookmark.docx') -``` - ### See Also * module [aspose.words.fields](../../) diff --git a/english/python-net/aspose.words.fields/fieldstart/_index.md b/english/python-net/aspose.words.fields/fieldstart/_index.md index 5d8dc814ebc..6583cc075a1 100644 --- a/english/python-net/aspose.words.fields/fieldstart/_index.md +++ b/english/python-net/aspose.words.fields/fieldstart/_index.md @@ -77,182 +77,6 @@ method. |[ to_string(save_format)](../../aspose.words/node/to_string/#saveformat) | Exports the content of the node into a string in the specified format.
(Inherited from [Node](../../aspose.words/node/)) | |[ to_string(save_options)](../../aspose.words/node/to_string/#saveoptions) | Exports the content of the node into a string using the specified save options.
(Inherited from [Node](../../aspose.words/node/)) | -### Examples - -Shows how to find all hyperlinks in a Word document, and then change their URLs and display names. - -```python -class ExReplaceHyperlinks(ApiExampleBase): - - def test_fields(self): - - doc = aw.Document(MY_DIR + "Hyperlinks.docx") - - # Hyperlinks in a Word documents are fields. To begin looking for hyperlinks, we must first find all the fields. - # Use the "select_nodes" method to find all the fields in the document via an XPath. - field_starts = doc.select_nodes("//FieldStart") - - for field_start in field_starts: - field_start = field_start.as_field_start() - - if field_start.field_type == aw.fields.FieldType.FIELD_HYPERLINK: - hyperlink = Hyperlink(field_start) - - # Hyperlinks that link to bookmarks do not have URLs. - if hyperlink.is_local: - continue - - # Give each URL hyperlink a new URL and name. - hyperlink.target = "http://www.aspose.com" - hyperlink.name = "Aspose - The .NET & Java Component Publisher" - - doc.save(ARTIFACTS_DIR + "ReplaceHyperlinks.fields.docx") - - -class Hyperlink: - """HYPERLINK fields contain and display hyperlinks in the document body. A field in Aspose.Words - consists of several nodes, and it might be difficult to work with all those nodes directly. - This implementation will work only if the hyperlink code and name each consist of only one Run node. - - The node structure for fields is as follows: - - [FieldStart][Run - field code][FieldSeparator][Run - field result][FieldEnd] - - Below are two example field codes of HYPERLINK fields: - HYPERLINK "url" - HYPERLINK \\l "bookmark name" - - A field's "result" property contains text that the field displays in the document body to the user.""" - def __init__(self, field_start: aw.fields.FieldStart): - - if field_start is None: - raise ValueError("field_start") - if field_start.field_type != aw.fields.FieldType.FIELD_HYPERLINK: - raise ValueError("Field start type must be FieldHyperlink.") - - self.field_start = field_start - - # Find the field separator node. - self.field_separator = Hyperlink.find_next_sibling(self.field_start, aw.NodeType.FIELD_SEPARATOR) - if self.field_separator is None: - raise Exception("Cannot find field separator.") - - # Normally, we can always find the field's end node, but the example document - # contains a paragraph break inside a hyperlink, which puts the field end - # in the next paragraph. It will be much more complicated to handle fields which span several - # paragraphs correctly. In this case allowing field end to be null is enough. - self.field_end = Hyperlink.find_next_sibling(self.field_separator, aw.NodeType.FIELD_END) - - # Field code looks something like "HYPERLINK "http:\\www.myurl.com"", but it can consist of several runs. - field_code = Hyperlink.get_text_same_parent(self.field_start.next_sibling, self.field_separator) - - pattern = r""" - \S+ # One or more non spaces HYPERLINK or other word in other languages. - \s+ # One or more spaces. - (?:""\s+)? # Non-capturing optional "" and one or more spaces. - (\\l\s+)? # Optional \l flag followed by one or more spaces. - " # One apostrophe. - ([^"]+) # One or more characters, excluding the apostrophe (hyperlink target). - " # One closing apostrophe. - """ - - match = re.match(pattern, field_code.strip(), re.VERBOSE) - - # The hyperlink is local if \l is present in the field code. - self._is_local = len(match.group(2)) > 0 - self._target = match.groups(3) - - @property - def name(self) -> str: - """Gets the display name of the hyperlink.""" - return Hyperlink.GetTextSameParent(self.field_separator, self.field_end) - - @name.setter - def name(self, value: str): - """Sets the display name of the hyperlink.""" - - # Hyperlink display name is stored in the field result, which is a Run - # node between field separator and field end. - field_result = self.field_separator.next_sibling.as_run() - field_result.text = value - - # If the field result consists of more than one run, delete these runs. - Hyperlink.remove_same_parent(field_result.next_sibling, self.field_end) - - @property - def target(self) -> str: - """Gets the target URL or bookmark name of the hyperlink.""" - return self._target - - @target.setter - def target(self, value: str) -> str: - """Sets the target URL or bookmark name of the hyperlink.""" - self._target = value - self.update_field_code() - - @property - def is_local(self) -> bool: - """True if the hyperlinks target is a bookmark inside the document. False if the hyperlink is a URL.""" - return self._is_local - - @is_local.setter - def is_local(self, value: bool): - self._is_local = value - self.update_field_code() - - def update_field_code(self): - - # A field's field code is in a Run node between the field's start node and field separator. - field_code = self.field_start.next_sibling.as_run() - field_code.text = 'HYPERLINK {0}"{1}"'.format( - "\\l " if self.is_local else "", self.target) - - # If the field code consists of more than one run, delete these runs. - Hyperlink.remove_same_parent(field_code.next_sibling, self.field_separator) - - @staticmethod - def find_next_sibling(start_node: aw.Node, node_type: aw.NodeType) -> aw.Node: - """Goes through siblings starting from the start node until it finds a node of the specified type or None.""" - - node = start_node - while node is not None: - if node.node_type == node_type: - return node - - node = node.next_sibling - - return None - - @staticmethod - def get_text_same_parent(start_node: aw.Node, end_node: aw.Node) -> str: - """Retrieves text from start up to but not including the end node.""" - - if end_node is not None and start_node.parent_node != end_node.parent_node: - raise ValueError("Start and end nodes are expected to have the same parent.") - - text = '' - child = start_node - while child != end_node: - text += child.get_text() - child = child.next_sibling - - return text - - @staticmethod - def remove_same_parent(start_node: aw.Node, end_node: aw.Node): - """Removes nodes from start up to but not including the end node. - Assumes that the start and end nodes have the same parent.""" - - if end_node is not None and start_node.parent_node != end_node.parent_node: - raise ValueError("Start and end nodes are expected to have the same parent.") - - cur_child = start_node - while cur_child is not None and cur_child != end_node: - next_child = cur_child.next_sibling - cur_child.remove() - cur_child = next_child -``` - ### See Also * module [aspose.words.fields](../) diff --git a/english/python-net/aspose.words.fields/fieldstyleref/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/_index.md index c47a9a428c5..03f56f7b90b 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/_index.md @@ -71,13 +71,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number/_index.md index 2b85aeda4a7..b1464c5255d 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_full_context/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_full_context/_index.md index 59ddebef5e2..fdcc4d0c5a3 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_full_context/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_full_context/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_relative_context/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_relative_context/_index.md index a43cf91b91f..e37d9ea2ff8 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_relative_context/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/insert_paragraph_number_in_relative_context/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/insert_relative_position/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/insert_relative_position/_index.md index ffce9422c4c..dcfcbdc320e 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/insert_relative_position/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/insert_relative_position/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/search_from_bottom/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/search_from_bottom/_index.md index 32eecc64666..088e5a6a0b8 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/search_from_bottom/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/search_from_bottom/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/style_name/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/style_name/_index.md index cc4f4bf9830..cea75bcb545 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/style_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/style_name/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldstyleref/suppress_non_delimiters/_index.md b/english/python-net/aspose.words.fields/fieldstyleref/suppress_non_delimiters/_index.md index 58d402904e3..3de472e655a 100644 --- a/english/python-net/aspose.words.fields/fieldstyleref/suppress_non_delimiters/_index.md +++ b/english/python-net/aspose.words.fields/fieldstyleref/suppress_non_delimiters/_index.md @@ -33,13 +33,13 @@ Shows how to use STYLEREF fields. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) # Create a list based using a Microsoft Word list template. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # This generated list will display "1.a )". # Space before the bracket is a non-delimiter character, which we can suppress. -list.list_levels[0].number_format = '\x00.' -list.list_levels[1].number_format = '\x01 )' +doc_list.list_levels[0].number_format = '\x00.' +doc_list.list_levels[1].number_format = '\x01 )' # Add text and apply paragraph styles that STYLEREF fields will reference. -builder.list_format.list = list +builder.list_format.list = doc_list builder.list_format.list_indent() builder.paragraph_format.style = doc.styles.get_by_name('List Paragraph') builder.writeln('Item 1') diff --git a/english/python-net/aspose.words.fields/fieldta/_index.md b/english/python-net/aspose.words.fields/fieldta/_index.md index 195e78b5dff..0ea22d552c7 100644 --- a/english/python-net/aspose.words.fields/fieldta/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/_index.md @@ -97,7 +97,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldta/entry_category/_index.md b/english/python-net/aspose.words.fields/fieldta/entry_category/_index.md index 676672898d4..2136a548707 100644 --- a/english/python-net/aspose.words.fields/fieldta/entry_category/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/entry_category/_index.md @@ -62,7 +62,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldta/is_bold/_index.md b/english/python-net/aspose.words.fields/fieldta/is_bold/_index.md index 7c3a5d6ee83..0dfe798e7c4 100644 --- a/english/python-net/aspose.words.fields/fieldta/is_bold/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/is_bold/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldta/is_italic/_index.md b/english/python-net/aspose.words.fields/fieldta/is_italic/_index.md index 74a4082d04e..e6bfa11cf06 100644 --- a/english/python-net/aspose.words.fields/fieldta/is_italic/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/is_italic/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldta/long_citation/_index.md b/english/python-net/aspose.words.fields/fieldta/long_citation/_index.md index 2891f92dee8..a72dfd01225 100644 --- a/english/python-net/aspose.words.fields/fieldta/long_citation/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/long_citation/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldta/page_range_bookmark_name/_index.md b/english/python-net/aspose.words.fields/fieldta/page_range_bookmark_name/_index.md index fa6fea91ee2..cce02adb290 100644 --- a/english/python-net/aspose.words.fields/fieldta/page_range_bookmark_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/page_range_bookmark_name/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldta/short_citation/_index.md b/english/python-net/aspose.words.fields/fieldta/short_citation/_index.md index 32573bd098d..1491e7602ba 100644 --- a/english/python-net/aspose.words.fields/fieldta/short_citation/_index.md +++ b/english/python-net/aspose.words.fields/fieldta/short_citation/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/_index.md b/english/python-net/aspose.words.fields/fieldtoa/_index.md index 32eda100895..e0fd550424f 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/_index.md @@ -103,7 +103,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/bookmark_name/_index.md b/english/python-net/aspose.words.fields/fieldtoa/bookmark_name/_index.md index 866fc382cc6..245f2fb4faf 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/bookmark_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/bookmark_name/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/entry_category/_index.md b/english/python-net/aspose.words.fields/fieldtoa/entry_category/_index.md index c6ef0c2ac3d..9be161f9a1d 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/entry_category/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/entry_category/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/entry_separator/_index.md b/english/python-net/aspose.words.fields/fieldtoa/entry_separator/_index.md index 3c7a06e87bf..5780de92dc1 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/entry_separator/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/entry_separator/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/page_number_list_separator/_index.md b/english/python-net/aspose.words.fields/fieldtoa/page_number_list_separator/_index.md index 80a2e9ada1b..6030616916a 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/page_number_list_separator/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/page_number_list_separator/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/page_range_separator/_index.md b/english/python-net/aspose.words.fields/fieldtoa/page_range_separator/_index.md index 73f39dbecc4..47657a3cc78 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/page_range_separator/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/page_range_separator/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/remove_entry_formatting/_index.md b/english/python-net/aspose.words.fields/fieldtoa/remove_entry_formatting/_index.md index 3adefb5b087..5107311cf4f 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/remove_entry_formatting/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/remove_entry_formatting/_index.md @@ -62,7 +62,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/sequence_name/_index.md b/english/python-net/aspose.words.fields/fieldtoa/sequence_name/_index.md index 932f02382b1..c58b0f78d3c 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/sequence_name/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/sequence_name/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/sequence_separator/_index.md b/english/python-net/aspose.words.fields/fieldtoa/sequence_separator/_index.md index 105f7e87e6b..498d131f5ca 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/sequence_separator/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/sequence_separator/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/use_heading/_index.md b/english/python-net/aspose.words.fields/fieldtoa/use_heading/_index.md index 4cff6e35e4b..b1701dd8f81 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/use_heading/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/use_heading/_index.md @@ -61,7 +61,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fields/fieldtoa/use_passim/_index.md b/english/python-net/aspose.words.fields/fieldtoa/use_passim/_index.md index eeb513b1843..127807a295a 100644 --- a/english/python-net/aspose.words.fields/fieldtoa/use_passim/_index.md +++ b/english/python-net/aspose.words.fields/fieldtoa/use_passim/_index.md @@ -63,7 +63,7 @@ def field_toa_test(): # The format from the TA fields will carry over into our table. # We can disable this by setting the "remove_entry_formatting" flag. field_toa.remove_entry_formatting = True - builder.font.color = drawing.Color.green + builder.font.color = aspose.pydrawing.Color.green builder.font.name = 'Arial Black' self.assertEqual(' TOA \\c 1 \\h \\b MyBookmark \\e " \t p." \\l " & p. " \\p \\g " to " \\f', field_toa.get_field_code()) builder.insert_break(aw.BreakType.PAGE_BREAK) diff --git a/english/python-net/aspose.words.fonts/fontinfosubstitutionrule/_index.md b/english/python-net/aspose.words.fonts/fontinfosubstitutionrule/_index.md index ad044945f95..3c3125b6524 100644 --- a/english/python-net/aspose.words.fonts/fontinfosubstitutionrule/_index.md +++ b/english/python-net/aspose.words.fonts/fontinfosubstitutionrule/_index.md @@ -33,6 +33,30 @@ available for the missing font then nothing will be done. | --- | --- | | [enabled](../fontsubstitutionrule/enabled/) | Specifies whether the rule is enabled or not.
(Inherited from [FontSubstitutionRule](../fontsubstitutionrule/)) | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words.fonts](../) diff --git a/english/python-net/aspose.words.fonts/fontsubstitutionsettings/font_info_substitution/_index.md b/english/python-net/aspose.words.fonts/fontsubstitutionsettings/font_info_substitution/_index.md index e962f2a8395..8dea9fd0bfc 100644 --- a/english/python-net/aspose.words.fonts/fontsubstitutionsettings/font_info_substitution/_index.md +++ b/english/python-net/aspose.words.fonts/fontsubstitutionsettings/font_info_substitution/_index.md @@ -21,6 +21,30 @@ def font_info_substitution(self) -> aspose.words.fonts.FontInfoSubstitutionRule: ``` +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words.fonts](../../) diff --git a/english/python-net/aspose.words.layout/layoutoptions/keep_original_font_metrics/_index.md b/english/python-net/aspose.words.layout/layoutoptions/keep_original_font_metrics/_index.md index 023c615cd33..b4457d3b38e 100644 --- a/english/python-net/aspose.words.layout/layoutoptions/keep_original_font_metrics/_index.md +++ b/english/python-net/aspose.words.layout/layoutoptions/keep_original_font_metrics/_index.md @@ -27,6 +27,30 @@ def keep_original_font_metrics(self, value: bool): ``` +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words.layout](../../) diff --git a/english/python-net/aspose.words.lists/list/_index.md b/english/python-net/aspose.words.lists/list/_index.md index 463169d63c9..06776de3959 100644 --- a/english/python-net/aspose.words.lists/list/_index.md +++ b/english/python-net/aspose.words.lists/list/_index.md @@ -107,8 +107,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -117,7 +117,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -129,7 +129,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/list/is_restart_at_each_section/_index.md b/english/python-net/aspose.words.lists/list/is_restart_at_each_section/_index.md index 676df84d37b..611d5da8415 100644 --- a/english/python-net/aspose.words.lists/list/is_restart_at_each_section/_index.md +++ b/english/python-net/aspose.words.lists/list/is_restart_at_each_section/_index.md @@ -44,13 +44,13 @@ Shows how to configure a list to restart numbering at each section. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list = doc.lists[0] -list.is_restart_at_each_section = restart_list_at_each_section +doc_list = doc.lists[0] +doc_list.is_restart_at_each_section = restart_list_at_each_section # The "IsRestartAtEachSection" property will only be applicable when # the document's OOXML compliance level is to a standard that is newer than "OoxmlComplianceCore.Ecma376". options = aw.saving.OoxmlSaveOptions() options.compliance = aw.saving.OoxmlCompliance.ISO29500_2008_TRANSITIONAL -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('List item 1') builder.writeln('List item 2') builder.insert_break(aw.BreakType.SECTION_BREAK_NEW_PAGE) diff --git a/english/python-net/aspose.words.lists/list/list_levels/_index.md b/english/python-net/aspose.words.lists/list/list_levels/_index.md index 21cbc26c34c..c7c687ac43a 100644 --- a/english/python-net/aspose.words.lists/list/list_levels/_index.md +++ b/english/python-net/aspose.words.lists/list/list_levels/_index.md @@ -39,8 +39,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -49,7 +49,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -61,7 +61,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listformat/list_level/_index.md b/english/python-net/aspose.words.lists/listformat/list_level/_index.md index 8afb4552d4b..3c61aa99a54 100644 --- a/english/python-net/aspose.words.lists/listformat/list_level/_index.md +++ b/english/python-net/aspose.words.lists/listformat/list_level/_index.md @@ -32,8 +32,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -42,7 +42,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -54,7 +54,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/_index.md b/english/python-net/aspose.words.lists/listlevel/_index.md index acc733d66e1..39a793e4d94 100644 --- a/english/python-net/aspose.words.lists/listlevel/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/_index.md @@ -68,8 +68,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -78,7 +78,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -90,7 +90,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/alignment/_index.md b/english/python-net/aspose.words.lists/listlevel/alignment/_index.md index 5cb836e3cd8..307f81465ca 100644 --- a/english/python-net/aspose.words.lists/listlevel/alignment/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/alignment/_index.md @@ -43,8 +43,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -53,7 +53,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -65,7 +65,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/create_picture_bullet/_index.md b/english/python-net/aspose.words.lists/listlevel/create_picture_bullet/_index.md index cb3c334c975..10831851294 100644 --- a/english/python-net/aspose.words.lists/listlevel/create_picture_bullet/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/create_picture_bullet/_index.md @@ -33,19 +33,19 @@ Shows how to set a custom image icon for list item labels. ```python doc = aw.Document() -list = doc.lists.add(list_template=aw.lists.ListTemplate.BULLET_CIRCLE) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.BULLET_CIRCLE) # Create a picture bullet for the current list level, and set an image from a local file system # as the icon that the bullets for this list level will display. -list.list_levels[0].create_picture_bullet() -list.list_levels[0].image_data.set_image(file_name=IMAGE_DIR + 'Logo icon.ico') -self.assertTrue(list.list_levels[0].image_data.has_image) +doc_list.list_levels[0].create_picture_bullet() +doc_list.list_levels[0].image_data.set_image(file_name=IMAGE_DIR + 'Logo icon.ico') +self.assertTrue(doc_list.list_levels[0].image_data.has_image) builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('Hello world!') builder.write('Hello again!') doc.save(file_name=ARTIFACTS_DIR + 'Lists.CreatePictureBullet.docx') -list.list_levels[0].delete_picture_bullet() -self.assertIsNone(list.list_levels[0].image_data) +doc_list.list_levels[0].delete_picture_bullet() +self.assertIsNone(doc_list.list_levels[0].image_data) ``` ### See Also diff --git a/english/python-net/aspose.words.lists/listlevel/delete_picture_bullet/_index.md b/english/python-net/aspose.words.lists/listlevel/delete_picture_bullet/_index.md index f392f17b139..1fc5f78dfa0 100644 --- a/english/python-net/aspose.words.lists/listlevel/delete_picture_bullet/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/delete_picture_bullet/_index.md @@ -30,19 +30,19 @@ Shows how to set a custom image icon for list item labels. ```python doc = aw.Document() -list = doc.lists.add(list_template=aw.lists.ListTemplate.BULLET_CIRCLE) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.BULLET_CIRCLE) # Create a picture bullet for the current list level, and set an image from a local file system # as the icon that the bullets for this list level will display. -list.list_levels[0].create_picture_bullet() -list.list_levels[0].image_data.set_image(file_name=IMAGE_DIR + 'Logo icon.ico') -self.assertTrue(list.list_levels[0].image_data.has_image) +doc_list.list_levels[0].create_picture_bullet() +doc_list.list_levels[0].image_data.set_image(file_name=IMAGE_DIR + 'Logo icon.ico') +self.assertTrue(doc_list.list_levels[0].image_data.has_image) builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('Hello world!') builder.write('Hello again!') doc.save(file_name=ARTIFACTS_DIR + 'Lists.CreatePictureBullet.docx') -list.list_levels[0].delete_picture_bullet() -self.assertIsNone(list.list_levels[0].image_data) +doc_list.list_levels[0].delete_picture_bullet() +self.assertIsNone(doc_list.list_levels[0].image_data) ``` ### See Also diff --git a/english/python-net/aspose.words.lists/listlevel/font/_index.md b/english/python-net/aspose.words.lists/listlevel/font/_index.md index 3300d52ce53..7feea5bee48 100644 --- a/english/python-net/aspose.words.lists/listlevel/font/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/font/_index.md @@ -32,8 +32,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -42,7 +42,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -54,7 +54,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/is_legal/_index.md b/english/python-net/aspose.words.lists/listlevel/is_legal/_index.md index 2464f31bd94..35b54c683b9 100644 --- a/english/python-net/aspose.words.lists/listlevel/is_legal/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/is_legal/_index.md @@ -36,30 +36,30 @@ builder = aw.DocumentBuilder(doc=doc) # We can create nested lists by increasing the indent level. # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # Level 1 labels will be formatted according to the "Heading 1" paragraph style and will have a prefix. # These will look like "Appendix A", "Appendix B"... -list.list_levels[0].number_format = 'Appendix \x00' -list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER -list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') +doc_list.list_levels[0].number_format = 'Appendix \x00' +doc_list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER +doc_list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') # Level 2 labels will display the current numbers of the first and the second list levels and have leading zeroes. # If the first list level is at 1, then the list labels from these will look like "Section (1.01)", "Section (1.02)"... -list.list_levels[1].number_format = 'Section (\x00.\x01)' -list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO +doc_list.list_levels[1].number_format = 'Section (\x00.\x01)' +doc_list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO # Note that the higher-level uses UppercaseLetter numbering. # We can set the "IsLegal" property to use Arabic numbers for the higher list levels. -list.list_levels[1].is_legal = True -list.list_levels[1].restart_after_level = 0 +doc_list.list_levels[1].is_legal = True +doc_list.list_levels[1].restart_after_level = 0 # Level 3 labels will be upper case Roman numerals with a prefix and a suffix and will restart at each List level 1 item. # These list labels will look like "-I-", "-II-"... -list.list_levels[2].number_format = '-\x02-' -list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN -list.list_levels[2].restart_after_level = 1 +doc_list.list_levels[2].number_format = '-\x02-' +doc_list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN +doc_list.list_levels[2].restart_after_level = 1 # Make labels of all list levels bold. -for level in list.list_levels: +for level in doc_list.list_levels: level.font.bold = True # Apply list formatting to the current paragraph. -builder.list_format.list = list +builder.list_format.list = doc_list # Create list items that will display all three of our list levels. n = 0 while n < 2: diff --git a/english/python-net/aspose.words.lists/listlevel/linked_style/_index.md b/english/python-net/aspose.words.lists/listlevel/linked_style/_index.md index bdab48791c9..4c1bc7c802e 100644 --- a/english/python-net/aspose.words.lists/listlevel/linked_style/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/linked_style/_index.md @@ -44,30 +44,30 @@ builder = aw.DocumentBuilder(doc=doc) # We can create nested lists by increasing the indent level. # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # Level 1 labels will be formatted according to the "Heading 1" paragraph style and will have a prefix. # These will look like "Appendix A", "Appendix B"... -list.list_levels[0].number_format = 'Appendix \x00' -list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER -list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') +doc_list.list_levels[0].number_format = 'Appendix \x00' +doc_list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER +doc_list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') # Level 2 labels will display the current numbers of the first and the second list levels and have leading zeroes. # If the first list level is at 1, then the list labels from these will look like "Section (1.01)", "Section (1.02)"... -list.list_levels[1].number_format = 'Section (\x00.\x01)' -list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO +doc_list.list_levels[1].number_format = 'Section (\x00.\x01)' +doc_list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO # Note that the higher-level uses UppercaseLetter numbering. # We can set the "IsLegal" property to use Arabic numbers for the higher list levels. -list.list_levels[1].is_legal = True -list.list_levels[1].restart_after_level = 0 +doc_list.list_levels[1].is_legal = True +doc_list.list_levels[1].restart_after_level = 0 # Level 3 labels will be upper case Roman numerals with a prefix and a suffix and will restart at each List level 1 item. # These list labels will look like "-I-", "-II-"... -list.list_levels[2].number_format = '-\x02-' -list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN -list.list_levels[2].restart_after_level = 1 +doc_list.list_levels[2].number_format = '-\x02-' +doc_list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN +doc_list.list_levels[2].restart_after_level = 1 # Make labels of all list levels bold. -for level in list.list_levels: +for level in doc_list.list_levels: level.font.bold = True # Apply list formatting to the current paragraph. -builder.list_format.list = list +builder.list_format.list = doc_list # Create list items that will display all three of our list levels. n = 0 while n < 2: diff --git a/english/python-net/aspose.words.lists/listlevel/number_format/_index.md b/english/python-net/aspose.words.lists/listlevel/number_format/_index.md index 3fd554a0033..71d93dbb0f7 100644 --- a/english/python-net/aspose.words.lists/listlevel/number_format/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/number_format/_index.md @@ -50,8 +50,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -60,7 +60,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -72,7 +72,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() @@ -93,30 +93,30 @@ builder = aw.DocumentBuilder(doc=doc) # We can create nested lists by increasing the indent level. # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # Level 1 labels will be formatted according to the "Heading 1" paragraph style and will have a prefix. # These will look like "Appendix A", "Appendix B"... -list.list_levels[0].number_format = 'Appendix \x00' -list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER -list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') +doc_list.list_levels[0].number_format = 'Appendix \x00' +doc_list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER +doc_list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') # Level 2 labels will display the current numbers of the first and the second list levels and have leading zeroes. # If the first list level is at 1, then the list labels from these will look like "Section (1.01)", "Section (1.02)"... -list.list_levels[1].number_format = 'Section (\x00.\x01)' -list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO +doc_list.list_levels[1].number_format = 'Section (\x00.\x01)' +doc_list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO # Note that the higher-level uses UppercaseLetter numbering. # We can set the "IsLegal" property to use Arabic numbers for the higher list levels. -list.list_levels[1].is_legal = True -list.list_levels[1].restart_after_level = 0 +doc_list.list_levels[1].is_legal = True +doc_list.list_levels[1].restart_after_level = 0 # Level 3 labels will be upper case Roman numerals with a prefix and a suffix and will restart at each List level 1 item. # These list labels will look like "-I-", "-II-"... -list.list_levels[2].number_format = '-\x02-' -list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN -list.list_levels[2].restart_after_level = 1 +doc_list.list_levels[2].number_format = '-\x02-' +doc_list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN +doc_list.list_levels[2].restart_after_level = 1 # Make labels of all list levels bold. -for level in list.list_levels: +for level in doc_list.list_levels: level.font.bold = True # Apply list formatting to the current paragraph. -builder.list_format.list = list +builder.list_format.list = doc_list # Create list items that will display all three of our list levels. n = 0 while n < 2: diff --git a/english/python-net/aspose.words.lists/listlevel/number_position/_index.md b/english/python-net/aspose.words.lists/listlevel/number_position/_index.md index 7d91b16c582..11308344f60 100644 --- a/english/python-net/aspose.words.lists/listlevel/number_position/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/number_position/_index.md @@ -43,8 +43,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -53,7 +53,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -65,7 +65,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/number_style/_index.md b/english/python-net/aspose.words.lists/listlevel/number_style/_index.md index a6f63359d14..3f069bb229f 100644 --- a/english/python-net/aspose.words.lists/listlevel/number_style/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/number_style/_index.md @@ -36,8 +36,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -46,7 +46,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -58,7 +58,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() @@ -79,30 +79,30 @@ builder = aw.DocumentBuilder(doc=doc) # We can create nested lists by increasing the indent level. # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # Level 1 labels will be formatted according to the "Heading 1" paragraph style and will have a prefix. # These will look like "Appendix A", "Appendix B"... -list.list_levels[0].number_format = 'Appendix \x00' -list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER -list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') +doc_list.list_levels[0].number_format = 'Appendix \x00' +doc_list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER +doc_list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') # Level 2 labels will display the current numbers of the first and the second list levels and have leading zeroes. # If the first list level is at 1, then the list labels from these will look like "Section (1.01)", "Section (1.02)"... -list.list_levels[1].number_format = 'Section (\x00.\x01)' -list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO +doc_list.list_levels[1].number_format = 'Section (\x00.\x01)' +doc_list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO # Note that the higher-level uses UppercaseLetter numbering. # We can set the "IsLegal" property to use Arabic numbers for the higher list levels. -list.list_levels[1].is_legal = True -list.list_levels[1].restart_after_level = 0 +doc_list.list_levels[1].is_legal = True +doc_list.list_levels[1].restart_after_level = 0 # Level 3 labels will be upper case Roman numerals with a prefix and a suffix and will restart at each List level 1 item. # These list labels will look like "-I-", "-II-"... -list.list_levels[2].number_format = '-\x02-' -list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN -list.list_levels[2].restart_after_level = 1 +doc_list.list_levels[2].number_format = '-\x02-' +doc_list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN +doc_list.list_levels[2].restart_after_level = 1 # Make labels of all list levels bold. -for level in list.list_levels: +for level in doc_list.list_levels: level.font.bold = True # Apply list formatting to the current paragraph. -builder.list_format.list = list +builder.list_format.list = doc_list # Create list items that will display all three of our list levels. n = 0 while n < 2: diff --git a/english/python-net/aspose.words.lists/listlevel/restart_after_level/_index.md b/english/python-net/aspose.words.lists/listlevel/restart_after_level/_index.md index 4f83ffa3fd5..80342a7064c 100644 --- a/english/python-net/aspose.words.lists/listlevel/restart_after_level/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/restart_after_level/_index.md @@ -43,30 +43,30 @@ builder = aw.DocumentBuilder(doc=doc) # We can create nested lists by increasing the indent level. # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) # Level 1 labels will be formatted according to the "Heading 1" paragraph style and will have a prefix. # These will look like "Appendix A", "Appendix B"... -list.list_levels[0].number_format = 'Appendix \x00' -list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER -list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') +doc_list.list_levels[0].number_format = 'Appendix \x00' +doc_list.list_levels[0].number_style = aw.NumberStyle.UPPERCASE_LETTER +doc_list.list_levels[0].linked_style = doc.styles.get_by_name('Heading 1') # Level 2 labels will display the current numbers of the first and the second list levels and have leading zeroes. # If the first list level is at 1, then the list labels from these will look like "Section (1.01)", "Section (1.02)"... -list.list_levels[1].number_format = 'Section (\x00.\x01)' -list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO +doc_list.list_levels[1].number_format = 'Section (\x00.\x01)' +doc_list.list_levels[1].number_style = aw.NumberStyle.LEADING_ZERO # Note that the higher-level uses UppercaseLetter numbering. # We can set the "IsLegal" property to use Arabic numbers for the higher list levels. -list.list_levels[1].is_legal = True -list.list_levels[1].restart_after_level = 0 +doc_list.list_levels[1].is_legal = True +doc_list.list_levels[1].restart_after_level = 0 # Level 3 labels will be upper case Roman numerals with a prefix and a suffix and will restart at each List level 1 item. # These list labels will look like "-I-", "-II-"... -list.list_levels[2].number_format = '-\x02-' -list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN -list.list_levels[2].restart_after_level = 1 +doc_list.list_levels[2].number_format = '-\x02-' +doc_list.list_levels[2].number_style = aw.NumberStyle.UPPERCASE_ROMAN +doc_list.list_levels[2].restart_after_level = 1 # Make labels of all list levels bold. -for level in list.list_levels: +for level in doc_list.list_levels: level.font.bold = True # Apply list formatting to the current paragraph. -builder.list_format.list = list +builder.list_format.list = doc_list # Create list items that will display all three of our list levels. n = 0 while n < 2: diff --git a/english/python-net/aspose.words.lists/listlevel/start_at/_index.md b/english/python-net/aspose.words.lists/listlevel/start_at/_index.md index dcb9063092d..d113de418e3 100644 --- a/english/python-net/aspose.words.lists/listlevel/start_at/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/start_at/_index.md @@ -43,8 +43,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -53,7 +53,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -65,7 +65,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/tab_position/_index.md b/english/python-net/aspose.words.lists/listlevel/tab_position/_index.md index 88db18c968f..a20562e3c0e 100644 --- a/english/python-net/aspose.words.lists/listlevel/tab_position/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/tab_position/_index.md @@ -43,8 +43,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -53,7 +53,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -65,7 +65,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/text_position/_index.md b/english/python-net/aspose.words.lists/listlevel/text_position/_index.md index 39ec76920b5..8e5925ef2f9 100644 --- a/english/python-net/aspose.words.lists/listlevel/text_position/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/text_position/_index.md @@ -43,8 +43,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -53,7 +53,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -65,7 +65,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevel/trailing_character/_index.md b/english/python-net/aspose.words.lists/listlevel/trailing_character/_index.md index 77d47a5925a..41dc5c0c817 100644 --- a/english/python-net/aspose.words.lists/listlevel/trailing_character/_index.md +++ b/english/python-net/aspose.words.lists/listlevel/trailing_character/_index.md @@ -36,8 +36,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -46,7 +46,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -58,7 +58,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevelalignment/_index.md b/english/python-net/aspose.words.lists/listlevelalignment/_index.md index 1d8093cf0dd..0a2731d74aa 100644 --- a/english/python-net/aspose.words.lists/listlevelalignment/_index.md +++ b/english/python-net/aspose.words.lists/listlevelalignment/_index.md @@ -37,8 +37,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -47,7 +47,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -59,7 +59,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevelcollection/__getitem__/_index.md b/english/python-net/aspose.words.lists/listlevelcollection/__getitem__/_index.md index eb8f6c70cdf..50f002d70fb 100644 --- a/english/python-net/aspose.words.lists/listlevelcollection/__getitem__/_index.md +++ b/english/python-net/aspose.words.lists/listlevelcollection/__getitem__/_index.md @@ -34,8 +34,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -44,7 +44,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -56,7 +56,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listlevelcollection/_index.md b/english/python-net/aspose.words.lists/listlevelcollection/_index.md index 0fe9782c137..d77f00af006 100644 --- a/english/python-net/aspose.words.lists/listlevelcollection/_index.md +++ b/english/python-net/aspose.words.lists/listlevelcollection/_index.md @@ -40,8 +40,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -50,7 +50,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -62,7 +62,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.lists/listtrailingcharacter/_index.md b/english/python-net/aspose.words.lists/listtrailingcharacter/_index.md index 954d771146d..41e46aa7dc5 100644 --- a/english/python-net/aspose.words.lists/listtrailingcharacter/_index.md +++ b/english/python-net/aspose.words.lists/listtrailingcharacter/_index.md @@ -37,8 +37,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -47,7 +47,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -59,7 +59,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.loading/markdownloadoptions/_index.md b/english/python-net/aspose.words.loading/markdownloadoptions/_index.md index 3f4af1e0a86..86d1cd2dc8a 100644 --- a/english/python-net/aspose.words.loading/markdownloadoptions/_index.md +++ b/english/python-net/aspose.words.loading/markdownloadoptions/_index.md @@ -41,6 +41,7 @@ Allows to specify additional options when loading [LoadFormat.MARKDOWN](../../as | [preserve_include_picture_field](../loadoptions/preserve_include_picture_field/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``False``.
(Inherited from [LoadOptions](../loadoptions/)) | | [progress_callback](../loadoptions/progress_callback/) | Called during loading a document and accepts data about loading progress.
(Inherited from [LoadOptions](../loadoptions/)) | | [resource_loading_callback](../loadoptions/resource_loading_callback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.
(Inherited from [LoadOptions](../loadoptions/)) | +| [soft_line_break_character](./soft_line_break_character/) | Gets or sets a character value representing `soft line break`. The default value is ``SPACE (U+0020)``. | | [temp_folder](../loadoptions/temp_folder/) | Allows to use temporary files when reading document. By default this property is ``None`` and no temporary files are used.
(Inherited from [LoadOptions](../loadoptions/)) | | [update_dirty_fields](../loadoptions/update_dirty_fields/) | Specifies whether to update the fields with the ``dirty`` attribute.
(Inherited from [LoadOptions](../loadoptions/)) | | [use_system_lcid](../loadoptions/use_system_lcid/) | Gets or sets whether to use LCID value obtained from Windows registry to determine page setup default margins.
(Inherited from [LoadOptions](../loadoptions/)) | diff --git a/english/python-net/aspose.words.loading/markdownloadoptions/soft_line_break_character/_index.md b/english/python-net/aspose.words.loading/markdownloadoptions/soft_line_break_character/_index.md new file mode 100644 index 00000000000..421c0272620 --- /dev/null +++ b/english/python-net/aspose.words.loading/markdownloadoptions/soft_line_break_character/_index.md @@ -0,0 +1,53 @@ +--- +title: MarkdownLoadOptions.soft_line_break_character property +linktitle: soft_line_break_character property +articleTitle: soft_line_break_character property +second_title: Aspose.Words for Python +description: "MarkdownLoadOptions.soft_line_break_character property. Gets or sets a character value representing `soft line break`" +type: docs +weight: 40 +url: /python-net/aspose.words.loading/markdownloadoptions/soft_line_break_character/ +--- + +## MarkdownLoadOptions.soft_line_break_character property + +Gets or sets a character value representing `soft line break`. +The default value is ``SPACE (U+0020)``. + + + +```python +@property +def soft_line_break_character(self) -> str: + ... + +@soft_line_break_character.setter +def soft_line_break_character(self, value: str): + ... + +``` + +### Remarks + +Note, setting this option to [ControlChar.LINE_BREAK_CHAR](../../../aspose.words/controlchar/LINE_BREAK_CHAR/) allows you +to load soft line breaks as hard line breaks. + + + +### Examples + +Shows how to set soft line break character. + +```python +with io.BytesIO(system_helper.text.Encoding.get_bytes('line1\nline2', system_helper.text.Encoding.utf_8())) as stream: + load_options = aw.loading.MarkdownLoadOptions() + load_options.soft_line_break_character = aw.ControlChar.LINE_BREAK_CHAR + doc = aw.Document(stream=stream, load_options=load_options) + self.assertEqual('line1\x0bline2', doc.get_text().strip()) +``` + +### See Also + +* module [aspose.words.loading](../../) +* class [MarkdownLoadOptions](../) + diff --git a/english/python-net/aspose.words.properties/builtindocumentproperties/last_saved_time/_index.md b/english/python-net/aspose.words.properties/builtindocumentproperties/last_saved_time/_index.md index ca73642e4ae..83e1846acaa 100644 --- a/english/python-net/aspose.words.properties/builtindocumentproperties/last_saved_time/_index.md +++ b/english/python-net/aspose.words.properties/builtindocumentproperties/last_saved_time/_index.md @@ -63,39 +63,6 @@ properties.last_saved_time = datetime.datetime.now() doc.save(file_name=ARTIFACTS_DIR + 'DocumentProperties.Origin.docx') ``` -Shows how to use the SAVEDATE field to display the date/time of the document's most recent save operation performed using Microsoft Word. - -```python -doc = aw.Document(MY_DIR + 'Document.docx') -builder = aw.DocumentBuilder(doc) -builder.move_to_document_end() -builder.writeln(' Date this document was last saved:') -# We can use the SAVEDATE field to display the last save operation's date and time on the document. -# The save operation that these fields refer to is the manual save in an application like Microsoft Word, -# not the document's "save" method. -# Below are three different calendar types according to which the SAVEDATE field can display the date/time. -# 1 - Islamic Lunar Calendar: -builder.write('According to the Lunar Calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_lunar_calendar = True -self.assertEqual(' SAVEDATE \\h', field.get_field_code()) -# 2 - Umm al-Qura calendar: -builder.write('\nAccording to the Umm al-Qura calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_um_al_qura_calendar = True -self.assertEqual(' SAVEDATE \\u', field.get_field_code()) -# 3 - Indian National calendar: -builder.write('\nAccording to the Indian National calendar - ') -field = builder.insert_field(aw.fields.FieldType.FIELD_SAVE_DATE, True).as_field_save_date() -field.use_saka_era_calendar = True -self.assertEqual(' SAVEDATE \\s', field.get_field_code()) -# The SAVEDATE fields draw their date/time values from the "last_saved_time" built-in property. -# The document's Save method will not update this value, but we can still update it manually. -doc.built_in_document_properties.last_saved_time = datetime.datetime.now() -doc.update_fields() -doc.save(ARTIFACTS_DIR + 'Field.field_save_date.docx') -``` - ### See Also * module [aspose.words.properties](../../) diff --git a/english/python-net/aspose.words.properties/documentproperty/to_bool/_index.md b/english/python-net/aspose.words.properties/documentproperty/to_bool/_index.md index b6f7350baeb..695053969a8 100644 --- a/english/python-net/aspose.words.properties/documentproperty/to_bool/_index.md +++ b/english/python-net/aspose.words.properties/documentproperty/to_bool/_index.md @@ -26,26 +26,6 @@ Throws an exception if the property type is not [PropertyType.BOOLEAN](../../pro -### Examples - -Shows various type conversion methods of custom document properties. - -```python -doc = aw.Document() -properties = doc.custom_document_properties -auth_date = datetime.date.today() -properties.add(name='Authorized', value=True) -properties.add(name='Authorized By', value='John Doe') -properties.add(name='Authorized Date', value=auth_date) -properties.add(name='Authorized Revision', value=doc.built_in_document_properties.revision_number) -properties.add(name='Authorized Amount', value=123.45) -self.assertEqual(True, properties.get_by_name('Authorized').to_bool()) -self.assertEqual('John Doe', properties.get_by_name('Authorized By').to_string()) -self.assertEqual(auth_date, properties.get_by_name('Authorized Date').to_date_time()) -self.assertEqual(1, properties.get_by_name('Authorized Revision').to_int()) -self.assertEqual(123.45, properties.get_by_name('Authorized Amount').to_double()) -``` - ### See Also * module [aspose.words.properties](../../) diff --git a/english/python-net/aspose.words.properties/documentproperty/to_date_time/_index.md b/english/python-net/aspose.words.properties/documentproperty/to_date_time/_index.md index c121578acdd..4b8ea3e8352 100644 --- a/english/python-net/aspose.words.properties/documentproperty/to_date_time/_index.md +++ b/english/python-net/aspose.words.properties/documentproperty/to_date_time/_index.md @@ -40,24 +40,6 @@ authorization_date = doc.custom_document_properties.get_by_name('AuthorizationDa print(f'Document authorized on {authorization_date}') ``` -Shows various type conversion methods of custom document properties. - -```python -doc = aw.Document() -properties = doc.custom_document_properties -auth_date = datetime.date.today() -properties.add(name='Authorized', value=True) -properties.add(name='Authorized By', value='John Doe') -properties.add(name='Authorized Date', value=auth_date) -properties.add(name='Authorized Revision', value=doc.built_in_document_properties.revision_number) -properties.add(name='Authorized Amount', value=123.45) -self.assertEqual(True, properties.get_by_name('Authorized').to_bool()) -self.assertEqual('John Doe', properties.get_by_name('Authorized By').to_string()) -self.assertEqual(auth_date, properties.get_by_name('Authorized Date').to_date_time()) -self.assertEqual(1, properties.get_by_name('Authorized Revision').to_int()) -self.assertEqual(123.45, properties.get_by_name('Authorized Amount').to_double()) -``` - ### See Also * module [aspose.words.properties](../../) diff --git a/english/python-net/aspose.words.properties/documentproperty/to_double/_index.md b/english/python-net/aspose.words.properties/documentproperty/to_double/_index.md index f886c2a68dd..5b53c24caca 100644 --- a/english/python-net/aspose.words.properties/documentproperty/to_double/_index.md +++ b/english/python-net/aspose.words.properties/documentproperty/to_double/_index.md @@ -25,26 +25,6 @@ Throws an exception if the property type is not [PropertyType.NUMBER](../../prop -### Examples - -Shows various type conversion methods of custom document properties. - -```python -doc = aw.Document() -properties = doc.custom_document_properties -auth_date = datetime.date.today() -properties.add(name='Authorized', value=True) -properties.add(name='Authorized By', value='John Doe') -properties.add(name='Authorized Date', value=auth_date) -properties.add(name='Authorized Revision', value=doc.built_in_document_properties.revision_number) -properties.add(name='Authorized Amount', value=123.45) -self.assertEqual(True, properties.get_by_name('Authorized').to_bool()) -self.assertEqual('John Doe', properties.get_by_name('Authorized By').to_string()) -self.assertEqual(auth_date, properties.get_by_name('Authorized Date').to_date_time()) -self.assertEqual(1, properties.get_by_name('Authorized Revision').to_int()) -self.assertEqual(123.45, properties.get_by_name('Authorized Amount').to_double()) -``` - ### See Also * module [aspose.words.properties](../../) diff --git a/english/python-net/aspose.words.properties/documentproperty/to_int/_index.md b/english/python-net/aspose.words.properties/documentproperty/to_int/_index.md index c28b0702779..1c926efd703 100644 --- a/english/python-net/aspose.words.properties/documentproperty/to_int/_index.md +++ b/english/python-net/aspose.words.properties/documentproperty/to_int/_index.md @@ -25,26 +25,6 @@ Throws an exception if the property type is not [PropertyType.NUMBER](../../prop -### Examples - -Shows various type conversion methods of custom document properties. - -```python -doc = aw.Document() -properties = doc.custom_document_properties -auth_date = datetime.date.today() -properties.add(name='Authorized', value=True) -properties.add(name='Authorized By', value='John Doe') -properties.add(name='Authorized Date', value=auth_date) -properties.add(name='Authorized Revision', value=doc.built_in_document_properties.revision_number) -properties.add(name='Authorized Amount', value=123.45) -self.assertEqual(True, properties.get_by_name('Authorized').to_bool()) -self.assertEqual('John Doe', properties.get_by_name('Authorized By').to_string()) -self.assertEqual(auth_date, properties.get_by_name('Authorized Date').to_date_time()) -self.assertEqual(1, properties.get_by_name('Authorized Revision').to_int()) -self.assertEqual(123.45, properties.get_by_name('Authorized Amount').to_double()) -``` - ### See Also * module [aspose.words.properties](../../) diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/_index.md index 035fda4e863..b89a502e7d1 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/_index.md @@ -38,6 +38,7 @@ To learn more, visit the [Find and Replace](https://docs.aspose.com/words/python | [ignore_fields](./ignore_fields/) | Gets or sets a boolean value indicating either to ignore text inside fields. The default value is ``False``. | | [ignore_footnotes](./ignore_footnotes/) | Gets or sets a boolean value indicating either to ignore footnotes. The default value is ``False``. | | [ignore_inserted](./ignore_inserted/) | Gets or sets a boolean value indicating either to ignore text inside insert revisions. The default value is ``False``. | +| [ignore_office_math](./ignore_office_math/) | Gets or sets a boolean value indicating either to ignore text inside OfficeMath/\>. The default value is ``True``. | | [ignore_shapes](./ignore_shapes/) | Gets or sets a boolean value indicating either to ignore shapes within a text. | | [ignore_structured_document_tags](./ignore_structured_document_tags/) | Gets or sets a boolean value indicating either to ignore content of [StructuredDocumentTag](../../aspose.words.markup/structureddocumenttag/). The default value is ``False``. | | [legacy_mode](./legacy_mode/) | Gets or sets a boolean value indicating that old find/replace algorithm is used. | diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_office_math/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_office_math/_index.md new file mode 100644 index 00000000000..8ecccb36666 --- /dev/null +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_office_math/_index.md @@ -0,0 +1,50 @@ +--- +title: FindReplaceOptions.ignore_office_math property +linktitle: ignore_office_math property +articleTitle: ignore_office_math property +second_title: Aspose.Words for Python +description: "FindReplaceOptions.ignore_office_math property. Gets or sets a boolean value indicating either to ignore text inside OfficeMath/>" +type: docs +weight: 110 +url: /python-net/aspose.words.replacing/findreplaceoptions/ignore_office_math/ +--- + +## FindReplaceOptions.ignore_office_math property + +Gets or sets a boolean value indicating either to ignore text inside OfficeMath/\>. +The default value is ``True``. + + + +```python +@property +def ignore_office_math(self) -> bool: + ... + +@ignore_office_math.setter +def ignore_office_math(self, value: bool): + ... + +``` + +### Examples + +Shows how to find and replace text within OfficeMath. + +```python +doc = aw.Document(file_name=MY_DIR + 'Office math.docx') +self.assertEqual('i+b-c≥iM+bM-cM', doc.first_section.body.first_paragraph.get_text().strip()) +options = aw.replacing.FindReplaceOptions() +options.ignore_office_math = is_ignore_office_math +doc.range.replace(pattern='b', replacement='x', options=options) +if is_ignore_office_math: + self.assertEqual('i+b-c≥iM+bM-cM', doc.first_section.body.first_paragraph.get_text().strip()) +else: + self.assertEqual('i+x-c≥iM+xM-cM', doc.first_section.body.first_paragraph.get_text().strip()) +``` + +### See Also + +* module [aspose.words.replacing](../../) +* class [FindReplaceOptions](../) + diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_shapes/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_shapes/_index.md index fad86a7ecaa..26b41a214e3 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_shapes/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_shapes/_index.md @@ -5,7 +5,7 @@ articleTitle: ignore_shapes property second_title: Aspose.Words for Python description: "FindReplaceOptions.ignore_shapes property. Gets or sets a boolean value indicating either to ignore shapes within a text." type: docs -weight: 110 +weight: 120 url: /python-net/aspose.words.replacing/findreplaceoptions/ignore_shapes/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_structured_document_tags/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_structured_document_tags/_index.md index 797d2521ddc..45868ee162f 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_structured_document_tags/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/ignore_structured_document_tags/_index.md @@ -5,7 +5,7 @@ articleTitle: ignore_structured_document_tags property second_title: Aspose.Words for Python description: "FindReplaceOptions.ignore_structured_document_tags property. Gets or sets a boolean value indicating either to ignore content of [StructuredDocumentTag](../../../aspose.words.markup/structureddocumenttag/)" type: docs -weight: 120 +weight: 130 url: /python-net/aspose.words.replacing/findreplaceoptions/ignore_structured_document_tags/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/legacy_mode/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/legacy_mode/_index.md index 1750f610e65..82ef3a9006f 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/legacy_mode/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/legacy_mode/_index.md @@ -5,7 +5,7 @@ articleTitle: legacy_mode property second_title: Aspose.Words for Python description: "FindReplaceOptions.legacy_mode property. Gets or sets a boolean value indicating that old find/replace algorithm is used." type: docs -weight: 130 +weight: 140 url: /python-net/aspose.words.replacing/findreplaceoptions/legacy_mode/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/match_case/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/match_case/_index.md index 4b1f2428989..5c8de682530 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/match_case/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/match_case/_index.md @@ -5,7 +5,7 @@ articleTitle: match_case property second_title: Aspose.Words for Python description: "FindReplaceOptions.match_case property. True indicates case-sensitive comparison, false indicates case-insensitive comparison." type: docs -weight: 140 +weight: 150 url: /python-net/aspose.words.replacing/findreplaceoptions/match_case/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/replacement_format/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/replacement_format/_index.md index cc50fb190ac..f5945c44f39 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/replacement_format/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/replacement_format/_index.md @@ -5,7 +5,7 @@ articleTitle: replacement_format property second_title: Aspose.Words for Python description: "FindReplaceOptions.replacement_format property. Specifies format of the replacement" type: docs -weight: 150 +weight: 160 url: /python-net/aspose.words.replacing/findreplaceoptions/replacement_format/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/replacing_callback/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/replacing_callback/_index.md index 049fd3282cd..e1b128f1cb9 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/replacing_callback/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/replacing_callback/_index.md @@ -5,7 +5,7 @@ articleTitle: replacing_callback property second_title: Aspose.Words for Python description: "FindReplaceOptions.replacing_callback property. The user-defined method which is called before every replace occurrence." type: docs -weight: 160 +weight: 170 url: /python-net/aspose.words.replacing/findreplaceoptions/replacing_callback/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/smart_paragraph_break_replacement/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/smart_paragraph_break_replacement/_index.md index e4256c288bd..a84d5cdbf94 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/smart_paragraph_break_replacement/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/smart_paragraph_break_replacement/_index.md @@ -5,7 +5,7 @@ articleTitle: smart_paragraph_break_replacement property second_title: Aspose.Words for Python description: "FindReplaceOptions.smart_paragraph_break_replacement property. Gets or sets a boolean value indicating either it is allowed to replace paragraph break when there is no next sibling paragraph." type: docs -weight: 170 +weight: 180 url: /python-net/aspose.words.replacing/findreplaceoptions/smart_paragraph_break_replacement/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/use_legacy_order/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/use_legacy_order/_index.md index 277ef98ceeb..61e5fed1607 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/use_legacy_order/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/use_legacy_order/_index.md @@ -5,7 +5,7 @@ articleTitle: use_legacy_order property second_title: Aspose.Words for Python description: "FindReplaceOptions.use_legacy_order property. True indicates that a text search is performed sequentially from top to bottom considering the text boxes" type: docs -weight: 180 +weight: 190 url: /python-net/aspose.words.replacing/findreplaceoptions/use_legacy_order/ --- diff --git a/english/python-net/aspose.words.replacing/findreplaceoptions/use_substitutions/_index.md b/english/python-net/aspose.words.replacing/findreplaceoptions/use_substitutions/_index.md index 17895ff63a4..3e16775601e 100644 --- a/english/python-net/aspose.words.replacing/findreplaceoptions/use_substitutions/_index.md +++ b/english/python-net/aspose.words.replacing/findreplaceoptions/use_substitutions/_index.md @@ -5,7 +5,7 @@ articleTitle: use_substitutions property second_title: Aspose.Words for Python description: "FindReplaceOptions.use_substitutions property. Gets or sets a boolean value indicating whether to recognize and use substitutions within replacement patterns" type: docs -weight: 190 +weight: 200 url: /python-net/aspose.words.replacing/findreplaceoptions/use_substitutions/ --- diff --git a/english/python-net/aspose.words.saving/exportlistlabels/_index.md b/english/python-net/aspose.words.saving/exportlistlabels/_index.md index 06a9ea6a98d..8ed6f92e736 100644 --- a/english/python-net/aspose.words.saving/exportlistlabels/_index.md +++ b/english/python-net/aspose.words.saving/exportlistlabels/_index.md @@ -29,15 +29,15 @@ Shows how to configure list exporting to HTML. ```python doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -builder.list_format.list = list +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +builder.list_format.list = doc_list builder.writeln('Default numbered list item 1.') builder.writeln('Default numbered list item 2.') builder.list_format.list_indent() builder.writeln('Default numbered list item 3.') builder.list_format.remove_numbers() -list = doc.lists.add(list_template=aw.lists.ListTemplate.OUTLINE_HEADINGS_LEGAL) -builder.list_format.list = list +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.OUTLINE_HEADINGS_LEGAL) +builder.list_format.list = doc_list builder.writeln('Outline legal heading list item 1.') builder.writeln('Outline legal heading list item 2.') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.saving/htmlsaveoptions/export_list_labels/_index.md b/english/python-net/aspose.words.saving/htmlsaveoptions/export_list_labels/_index.md index 5265db5fd00..37e26cf0e2d 100644 --- a/english/python-net/aspose.words.saving/htmlsaveoptions/export_list_labels/_index.md +++ b/english/python-net/aspose.words.saving/htmlsaveoptions/export_list_labels/_index.md @@ -34,15 +34,15 @@ Shows how to configure list exporting to HTML. ```python doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -builder.list_format.list = list +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +builder.list_format.list = doc_list builder.writeln('Default numbered list item 1.') builder.writeln('Default numbered list item 2.') builder.list_format.list_indent() builder.writeln('Default numbered list item 3.') builder.list_format.remove_numbers() -list = doc.lists.add(list_template=aw.lists.ListTemplate.OUTLINE_HEADINGS_LEGAL) -builder.list_format.list = list +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.OUTLINE_HEADINGS_LEGAL) +builder.list_format.list = doc_list builder.writeln('Outline legal heading list item 1.') builder.writeln('Outline legal heading list item 2.') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words.saving/htmlsaveoptions/resolve_font_names/_index.md b/english/python-net/aspose.words.saving/htmlsaveoptions/resolve_font_names/_index.md index c917a4ea8cf..f15c8df17cc 100644 --- a/english/python-net/aspose.words.saving/htmlsaveoptions/resolve_font_names/_index.md +++ b/english/python-net/aspose.words.saving/htmlsaveoptions/resolve_font_names/_index.md @@ -40,32 +40,6 @@ font substitution as required. -### Examples - -Shows how to resolve all font names before writing them to HTML. - -```python -doc = aw.Document(MY_DIR + 'Missing font.docx') -# This document contains text that names a font that we do not have. -self.assertIsNotNone(doc.font_infos.get_by_name('28 Days Later')) -# If we have no way of getting this font, and we want to be able to display all the text -# in this document in an output HTML, we can substitute it with another font. -font_settings = aw.fonts.FontSettings() -font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' -font_settings.substitution_settings.default_font_substitution.enabled = True -doc.font_settings = font_settings -save_options = aw.saving.HtmlSaveOptions(aw.SaveFormat.HTML) -# By default, this option is set to 'False' and Aspose.Words writes font names as specified in the source document -save_options.resolve_font_names = resolve_font_names -doc.save(ARTIFACTS_DIR + 'HtmlSaveOptions.resolve_font_names.html', save_options) -with open(ARTIFACTS_DIR + 'HtmlSaveOptions.resolve_font_names.html', 'rt', encoding='utf-8') as file: - out_doc_contents = file.read() -if resolve_font_names: - self.assertIn('', out_doc_contents) -else: - self.assertIn('', out_doc_contents) -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/imagesaveoptions/_index.md b/english/python-net/aspose.words.saving/imagesaveoptions/_index.md index 50a008b12a7..7a67f60f33f 100644 --- a/english/python-net/aspose.words.saving/imagesaveoptions/_index.md +++ b/english/python-net/aspose.words.saving/imagesaveoptions/_index.md @@ -79,28 +79,6 @@ To learn more, visit the [Specify Save Options](https://docs.aspose.com/words/py ### Examples -Renders a page of a Word document into an image with transparent or colored background. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc=doc) -builder.font.name = 'Times New Roman' -builder.font.size = 24 -builder.writeln('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.') -builder.insert_image(file_name=IMAGE_DIR + 'Logo.jpg') -# Create an "ImageSaveOptions" object which we can pass to the document's "Save" method -# to modify the way in which that method renders the document into an image. -img_options = aw.saving.ImageSaveOptions(aw.SaveFormat.PNG) -# Set the "PaperColor" property to a transparent color to apply a transparent -# background to the document while rendering it to an image. -img_options.paper_color = aspose.pydrawing.Color.transparent -doc.save(file_name=ARTIFACTS_DIR + 'ImageSaveOptions.PaperColor.Transparent.png', save_options=img_options) -# Set the "PaperColor" property to an opaque color to apply that color -# as the background of the document as we render it to an image. -img_options.paper_color = aspose.pydrawing.Color.light_coral -doc.save(file_name=ARTIFACTS_DIR + 'ImageSaveOptions.PaperColor.LightCoral.png', save_options=img_options) -``` - Shows how to configure compression while saving a document as a JPEG. ```python diff --git a/english/python-net/aspose.words.saving/imagesaveoptions/paper_color/_index.md b/english/python-net/aspose.words.saving/imagesaveoptions/paper_color/_index.md index 3ee98649cef..bc4450083c8 100644 --- a/english/python-net/aspose.words.saving/imagesaveoptions/paper_color/_index.md +++ b/english/python-net/aspose.words.saving/imagesaveoptions/paper_color/_index.md @@ -36,30 +36,6 @@ then the document background color will override the color specified by this pro -### Examples - -Renders a page of a Word document into an image with transparent or colored background. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc=doc) -builder.font.name = 'Times New Roman' -builder.font.size = 24 -builder.writeln('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.') -builder.insert_image(file_name=IMAGE_DIR + 'Logo.jpg') -# Create an "ImageSaveOptions" object which we can pass to the document's "Save" method -# to modify the way in which that method renders the document into an image. -img_options = aw.saving.ImageSaveOptions(aw.SaveFormat.PNG) -# Set the "PaperColor" property to a transparent color to apply a transparent -# background to the document while rendering it to an image. -img_options.paper_color = aspose.pydrawing.Color.transparent -doc.save(file_name=ARTIFACTS_DIR + 'ImageSaveOptions.PaperColor.Transparent.png', save_options=img_options) -# Set the "PaperColor" property to an opaque color to apply that color -# as the background of the document as we render it to an image. -img_options.paper_color = aspose.pydrawing.Color.light_coral -doc.save(file_name=ARTIFACTS_DIR + 'ImageSaveOptions.PaperColor.LightCoral.png', save_options=img_options) -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/markdownexportashtml/_index.md b/english/python-net/aspose.words.saving/markdownexportashtml/_index.md index a239e2c9fd1..77373029d26 100644 --- a/english/python-net/aspose.words.saving/markdownexportashtml/_index.md +++ b/english/python-net/aspose.words.saving/markdownexportashtml/_index.md @@ -20,6 +20,7 @@ Allows to specify the elements to be exported to Markdown as raw HTML. | --- | --- | | NONE | Export all elements using Markdown syntax without any raw HTML. | | TABLES | Export tables as raw HTML. | +| NON_COMPATIBLE_TABLES | Export tables that cannot be correctly represented in pure Markdown as raw HTML. | ### Examples @@ -41,6 +42,18 @@ save_options.export_as_html = aw.saving.MarkdownExportAsHtml.TABLES doc.save(file_name=ARTIFACTS_DIR + 'MarkdownSaveOptions.ExportTableAsHtml.md', save_options=save_options) ``` +Shows how to export tables that cannot be correctly represented in pure Markdown as raw HTML. + +```python +output_path = ARTIFACTS_DIR + 'MarkdownSaveOptions.NonCompatibleTables.md' +doc = aw.Document(file_name=MY_DIR + 'Non compatible table.docx') +# With the "NonCompatibleTables" option, you can export tables that have a complex structure with merged cells +# or nested tables to raw HTML and leave simple tables in Markdown format. +save_options = aw.saving.MarkdownSaveOptions() +save_options.export_as_html = aw.saving.MarkdownExportAsHtml.NON_COMPATIBLE_TABLES +doc.save(file_name=output_path, save_options=save_options) +``` + ### See Also * module [aspose.words.saving](../) diff --git a/english/python-net/aspose.words.saving/ooxmlcompliance/_index.md b/english/python-net/aspose.words.saving/ooxmlcompliance/_index.md index 123b0f3e65d..2b7c5559077 100644 --- a/english/python-net/aspose.words.saving/ooxmlcompliance/_index.md +++ b/english/python-net/aspose.words.saving/ooxmlcompliance/_index.md @@ -52,13 +52,13 @@ Shows how to configure a list to restart numbering at each section. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list = doc.lists[0] -list.is_restart_at_each_section = restart_list_at_each_section +doc_list = doc.lists[0] +doc_list.is_restart_at_each_section = restart_list_at_each_section # The "IsRestartAtEachSection" property will only be applicable when # the document's OOXML compliance level is to a standard that is newer than "OoxmlComplianceCore.Ecma376". options = aw.saving.OoxmlSaveOptions() options.compliance = aw.saving.OoxmlCompliance.ISO29500_2008_TRANSITIONAL -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('List item 1') builder.writeln('List item 2') builder.insert_break(aw.BreakType.SECTION_BREAK_NEW_PAGE) diff --git a/english/python-net/aspose.words.saving/ooxmlsaveoptions/compliance/_index.md b/english/python-net/aspose.words.saving/ooxmlsaveoptions/compliance/_index.md index c4af2ff4dc3..9a0e1af1c18 100644 --- a/english/python-net/aspose.words.saving/ooxmlsaveoptions/compliance/_index.md +++ b/english/python-net/aspose.words.saving/ooxmlsaveoptions/compliance/_index.md @@ -57,13 +57,13 @@ Shows how to configure a list to restart numbering at each section. doc = aw.Document() builder = aw.DocumentBuilder(doc=doc) doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list = doc.lists[0] -list.is_restart_at_each_section = restart_list_at_each_section +doc_list = doc.lists[0] +doc_list.is_restart_at_each_section = restart_list_at_each_section # The "IsRestartAtEachSection" property will only be applicable when # the document's OOXML compliance level is to a standard that is newer than "OoxmlComplianceCore.Ecma376". options = aw.saving.OoxmlSaveOptions() options.compliance = aw.saving.OoxmlCompliance.ISO29500_2008_TRANSITIONAL -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('List item 1') builder.writeln('List item 2') builder.insert_break(aw.BreakType.SECTION_BREAK_NEW_PAGE) diff --git a/english/python-net/aspose.words.saving/pdfpagemode/_index.md b/english/python-net/aspose.words.saving/pdfpagemode/_index.md index 60f370b8b96..2c75b0fb8cb 100644 --- a/english/python-net/aspose.words.saving/pdfpagemode/_index.md +++ b/english/python-net/aspose.words.saving/pdfpagemode/_index.md @@ -49,29 +49,6 @@ save_options.header_footer_bookmarks_export_mode = header_footer_bookmarks_expor doc.save(file_name=ARTIFACTS_DIR + 'PdfSaveOptions.HeaderFooterBookmarksExportMode.pdf', save_options=save_options) ``` -Shows how to set instructions for some PDF readers to follow when opening an output document. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -builder.writeln('Hello world!') -# Create a "PdfSaveOptions" object that we can pass to the document's "save" method -# to modify how that method converts the document to .PDF. -options = aw.saving.PdfSaveOptions() -# Set the "page_mode" property to "PdfPageMode.FULL_SCREEN" to get the PDF reader to open the saved -# document in full-screen mode, which takes over the monitor's display and has no controls visible. -# Set the "page_mode" property to "PdfPageMode.USE_THUMBS" to get the PDF reader to display a separate panel -# with a thumbnail for each page in the document. -# Set the "page_mode" property to "PdfPageMode.USE_OC" to get the PDF reader to display a separate panel -# that allows us to work with any layers present in the document. -# Set the "page_mode" property to "PdfPageMode.USE_OUTLINES" to get the PDF reader -# also to display the outline, if possible. -# Set the "page_mode" property to "PdfPageMode.USE_NONE" to get the PDF reader to display just the document itself. -# Set the "page_mode" property to "PdfPageMode.USE_ATTACHMENTS" to make visible attachments panel. -options.page_mode = page_mode -doc.save(ARTIFACTS_DIR + 'PdfSaveOptions.page_mode.pdf', options) -``` - ### See Also * module [aspose.words.saving](../) diff --git a/english/python-net/aspose.words.saving/pdfsaveoptions/__init__/_index.md b/english/python-net/aspose.words.saving/pdfsaveoptions/__init__/_index.md index b5b120f19af..c2c0d89eaee 100644 --- a/english/python-net/aspose.words.saving/pdfsaveoptions/__init__/_index.md +++ b/english/python-net/aspose.words.saving/pdfsaveoptions/__init__/_index.md @@ -27,35 +27,31 @@ Shows how to enable or disable subsetting when embedding fonts while rendering a ```python doc = aw.Document() -builder = aw.DocumentBuilder(doc) +builder = aw.DocumentBuilder(doc=doc) builder.font.name = 'Arial' builder.writeln('Hello world!') builder.font.name = 'Arvo' builder.writeln('The quick brown fox jumps over the lazy dog.') # Configure our font sources to ensure that we have access to both the fonts in this document. original_fonts_sources = aw.fonts.FontSettings.default_instance.get_fonts_sources() -folder_font_source = aw.fonts.FolderFontSource(FONTS_DIR, True) -aw.fonts.FontSettings.default_instance.set_fonts_sources([original_fonts_sources[0], folder_font_source]) +folder_font_source = aw.fonts.FolderFontSource(folder_path=FONTS_DIR, scan_subfolders=True) +aw.fonts.FontSettings.default_instance.set_fonts_sources(sources=[original_fonts_sources[0], folder_font_source]) font_sources = aw.fonts.FontSettings.default_instance.get_fonts_sources() -self.assertTrue(any((font.full_font_name == 'Arial' for font in font_sources[0].get_available_fonts()))) -self.assertTrue(any((font.full_font_name == 'Arvo' for font in font_sources[1].get_available_fonts()))) -# Create a "PdfSaveOptions" object that we can pass to the document's "save" method +self.assertTrue(any([f.full_font_name == 'Arial' for f in font_sources[0].get_available_fonts()])) +self.assertTrue(any([f.full_font_name == 'Arvo' for f in font_sources[1].get_available_fonts()])) +# Create a "PdfSaveOptions" object that we can pass to the document's "Save" method # to modify how that method converts the document to .PDF. options = aw.saving.PdfSaveOptions() # Since our document contains a custom font, embedding in the output document may be desirable. -# Set the "embed_full_fonts" property to "True" to embed every glyph of every embedded font in the output PDF. +# Set the "EmbedFullFonts" property to "true" to embed every glyph of every embedded font in the output PDF. # The document's size may become very large, but we will have full use of all fonts if we edit the PDF. -# Set the "embed_full_fonts" property to "False" to apply subsetting to fonts, saving only the glyphs +# Set the "EmbedFullFonts" property to "false" to apply subsetting to fonts, saving only the glyphs # that the document is using. The file will be considerably smaller, # but we may need access to any custom fonts if we edit the document. options.embed_full_fonts = embed_full_fonts -doc.save(ARTIFACTS_DIR + 'PdfSaveOptions.embed_full_fonts.pdf', options) -if embed_full_fonts: - self.assertLess(500000, os.path.getsize(ARTIFACTS_DIR + 'PdfSaveOptions.embed_full_fonts.pdf')) -else: - self.assertGreater(25000, os.path.getsize(ARTIFACTS_DIR + 'PdfSaveOptions.embed_full_fonts.pdf')) +doc.save(file_name=ARTIFACTS_DIR + 'PdfSaveOptions.EmbedFullFonts.pdf', save_options=options) # Restore the original font sources. -aw.fonts.FontSettings.default_instance.set_fonts_sources(original_fonts_sources) +aw.fonts.FontSettings.default_instance.set_fonts_sources(sources=original_fonts_sources) ``` ### See Also diff --git a/english/python-net/aspose.words.saving/pdfsaveoptions/embed_full_fonts/_index.md b/english/python-net/aspose.words.saving/pdfsaveoptions/embed_full_fonts/_index.md index 6e2fe7156ec..53d00e5994c 100644 --- a/english/python-net/aspose.words.saving/pdfsaveoptions/embed_full_fonts/_index.md +++ b/english/python-net/aspose.words.saving/pdfsaveoptions/embed_full_fonts/_index.md @@ -47,35 +47,31 @@ Shows how to enable or disable subsetting when embedding fonts while rendering a ```python doc = aw.Document() -builder = aw.DocumentBuilder(doc) +builder = aw.DocumentBuilder(doc=doc) builder.font.name = 'Arial' builder.writeln('Hello world!') builder.font.name = 'Arvo' builder.writeln('The quick brown fox jumps over the lazy dog.') # Configure our font sources to ensure that we have access to both the fonts in this document. original_fonts_sources = aw.fonts.FontSettings.default_instance.get_fonts_sources() -folder_font_source = aw.fonts.FolderFontSource(FONTS_DIR, True) -aw.fonts.FontSettings.default_instance.set_fonts_sources([original_fonts_sources[0], folder_font_source]) +folder_font_source = aw.fonts.FolderFontSource(folder_path=FONTS_DIR, scan_subfolders=True) +aw.fonts.FontSettings.default_instance.set_fonts_sources(sources=[original_fonts_sources[0], folder_font_source]) font_sources = aw.fonts.FontSettings.default_instance.get_fonts_sources() -self.assertTrue(any((font.full_font_name == 'Arial' for font in font_sources[0].get_available_fonts()))) -self.assertTrue(any((font.full_font_name == 'Arvo' for font in font_sources[1].get_available_fonts()))) -# Create a "PdfSaveOptions" object that we can pass to the document's "save" method +self.assertTrue(any([f.full_font_name == 'Arial' for f in font_sources[0].get_available_fonts()])) +self.assertTrue(any([f.full_font_name == 'Arvo' for f in font_sources[1].get_available_fonts()])) +# Create a "PdfSaveOptions" object that we can pass to the document's "Save" method # to modify how that method converts the document to .PDF. options = aw.saving.PdfSaveOptions() # Since our document contains a custom font, embedding in the output document may be desirable. -# Set the "embed_full_fonts" property to "True" to embed every glyph of every embedded font in the output PDF. +# Set the "EmbedFullFonts" property to "true" to embed every glyph of every embedded font in the output PDF. # The document's size may become very large, but we will have full use of all fonts if we edit the PDF. -# Set the "embed_full_fonts" property to "False" to apply subsetting to fonts, saving only the glyphs +# Set the "EmbedFullFonts" property to "false" to apply subsetting to fonts, saving only the glyphs # that the document is using. The file will be considerably smaller, # but we may need access to any custom fonts if we edit the document. options.embed_full_fonts = embed_full_fonts -doc.save(ARTIFACTS_DIR + 'PdfSaveOptions.embed_full_fonts.pdf', options) -if embed_full_fonts: - self.assertLess(500000, os.path.getsize(ARTIFACTS_DIR + 'PdfSaveOptions.embed_full_fonts.pdf')) -else: - self.assertGreater(25000, os.path.getsize(ARTIFACTS_DIR + 'PdfSaveOptions.embed_full_fonts.pdf')) +doc.save(file_name=ARTIFACTS_DIR + 'PdfSaveOptions.EmbedFullFonts.pdf', save_options=options) # Restore the original font sources. -aw.fonts.FontSettings.default_instance.set_fonts_sources(original_fonts_sources) +aw.fonts.FontSettings.default_instance.set_fonts_sources(sources=original_fonts_sources) ``` ### See Also diff --git a/english/python-net/aspose.words.saving/pdfsaveoptions/page_mode/_index.md b/english/python-net/aspose.words.saving/pdfsaveoptions/page_mode/_index.md index 1deca70f8f5..5132fd7fe20 100644 --- a/english/python-net/aspose.words.saving/pdfsaveoptions/page_mode/_index.md +++ b/english/python-net/aspose.words.saving/pdfsaveoptions/page_mode/_index.md @@ -55,29 +55,6 @@ save_options.header_footer_bookmarks_export_mode = header_footer_bookmarks_expor doc.save(file_name=ARTIFACTS_DIR + 'PdfSaveOptions.HeaderFooterBookmarksExportMode.pdf', save_options=save_options) ``` -Shows how to set instructions for some PDF readers to follow when opening an output document. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -builder.writeln('Hello world!') -# Create a "PdfSaveOptions" object that we can pass to the document's "save" method -# to modify how that method converts the document to .PDF. -options = aw.saving.PdfSaveOptions() -# Set the "page_mode" property to "PdfPageMode.FULL_SCREEN" to get the PDF reader to open the saved -# document in full-screen mode, which takes over the monitor's display and has no controls visible. -# Set the "page_mode" property to "PdfPageMode.USE_THUMBS" to get the PDF reader to display a separate panel -# with a thumbnail for each page in the document. -# Set the "page_mode" property to "PdfPageMode.USE_OC" to get the PDF reader to display a separate panel -# that allows us to work with any layers present in the document. -# Set the "page_mode" property to "PdfPageMode.USE_OUTLINES" to get the PDF reader -# also to display the outline, if possible. -# Set the "page_mode" property to "PdfPageMode.USE_NONE" to get the PDF reader to display just the document itself. -# Set the "page_mode" property to "PdfPageMode.USE_ATTACHMENTS" to make visible attachments panel. -options.page_mode = page_mode -doc.save(ARTIFACTS_DIR + 'PdfSaveOptions.page_mode.pdf', options) -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/pdfsaveoptions/preblend_images/_index.md b/english/python-net/aspose.words.saving/pdfsaveoptions/preblend_images/_index.md index 95874893790..f1f3d7ce393 100644 --- a/english/python-net/aspose.words.saving/pdfsaveoptions/preblend_images/_index.md +++ b/english/python-net/aspose.words.saving/pdfsaveoptions/preblend_images/_index.md @@ -37,25 +37,6 @@ The default value is ``False``. -### Examples - -Shows how to preblend images with transparent backgrounds while saving a document to PDF. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc) -img = drawing.Image.from_file(IMAGE_DIR + 'Transparent background logo.png') -builder.insert_image(img) -# Create a "PdfSaveOptions" object that we can pass to the document's "save" method -# to modify how that method converts the document to .PDF. -options = aw.saving.PdfSaveOptions() -# Set the "preblend_images" property to "True" to preblend transparent images -# with a background, which may reduce artifacts. -# Set the "preblend_images" property to "False" to render transparent images normally. -options.preblend_images = preblend_images -doc.save(ARTIFACTS_DIR + 'PdfSaveOptions.preblend_images.pdf', options) -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/txtsaveoptions/preserve_table_layout/_index.md b/english/python-net/aspose.words.saving/txtsaveoptions/preserve_table_layout/_index.md index 7c2ab5b1ea2..52b82d42784 100644 --- a/english/python-net/aspose.words.saving/txtsaveoptions/preserve_table_layout/_index.md +++ b/english/python-net/aspose.words.saving/txtsaveoptions/preserve_table_layout/_index.md @@ -56,7 +56,7 @@ txt_save_options.preserve_table_layout = preserve_table_layout doc.save(file_name=ARTIFACTS_DIR + 'TxtSaveOptions.PreserveTableLayout.txt', save_options=txt_save_options) doc_text = system_helper.io.File.read_all_text(ARTIFACTS_DIR + 'TxtSaveOptions.PreserveTableLayout.txt') if preserve_table_layout: - self.assertEqual('Row 1, cell 1 Row 1, cell 2\r\n' + 'Row 2, cell 1 Row 2, cell 2\r\n\r\n', doc_text) + self.assertEqual('Row 1, cell 1 Row 1, cell 2\r\n' + 'Row 2, cell 1 Row 2, cell 2\r\n\r\n', doc_text) else: self.assertEqual('Row 1, cell 1\r' + 'Row 1, cell 2\r' + 'Row 2, cell 1\r' + 'Row 2, cell 2\r\r\n', doc_text) ``` diff --git a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/_index.md b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/_index.md index 91316cdfe4e..9bdd82573f4 100644 --- a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/_index.md +++ b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/_index.md @@ -65,59 +65,6 @@ To learn more, visit the [Specify Save Options](https://docs.aspose.com/words/py |[ create_save_options(save_format)](../saveoptions/create_save_options/#saveformat) | Creates a save options object of a class suitable for the specified save format.
(Inherited from [SaveOptions](../saveoptions/)) | |[ create_save_options(file_name)](../saveoptions/create_save_options/#str) | Creates a save options object of a class suitable for the file extension specified in the given file name.
(Inherited from [SaveOptions](../saveoptions/)) | -### Examples - -Shows how to print the URIs of linked resources created while converting a document to fixed-form .xaml. - -```python -def test_resource_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - callback = ExXamlFixedSaveOptions.ResourceUriPrinter() - - # Create a "XamlFixedSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFixedSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FIXED, options.save_format) - - # Use the "resources_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked resources, such as images and fonts. - options.resources_folder = ARTIFACTS_DIR + "XamlFixedResourceFolder" - - # Use the "resources_folder_alias" property to use this folder - # when constructing image URIs instead of the resources folder's name. - options.resources_folder_alias = ARTIFACTS_DIR + "XamlFixedFolderAlias" - - options.resource_saving_callback = callback - - # A folder specified by "resources_folder_alias" will need to contain the resources instead of "resources_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.resources_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFixedSaveOptions.resource_folder.xaml", options) - - for resource in callback.resources: - print(resource) - - -class ResourceUriPrinter(aw.saving.IResourceSavingCallback): - """Counts and prints URIs of resources created during conversion to fixed .xaml.""" - - def __init__(self): - - self.resources = [] # type: List[str] - - def resource_saving(self, args: aw.saving.ResourceSavingArgs): - - self.resources.add(f"Resource \"{args.resource_file_name}\"\n\t{args.resource_file_uri}") - - # If we specified a resource folder alias, we would also need - # to redirect each stream to put its resource in the alias folder. - args.resource_stream = open(args.resource_file_uri, 'wb') - args.keep_resource_stream_open = False -``` - ### See Also * module [aspose.words.saving](../) diff --git a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resource_saving_callback/_index.md b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resource_saving_callback/_index.md index d54003d81e2..ec0f0fb716a 100644 --- a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resource_saving_callback/_index.md +++ b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resource_saving_callback/_index.md @@ -25,59 +25,6 @@ def resource_saving_callback(self, value: aspose.words.saving.IResourceSavingCal ``` -### Examples - -Shows how to print the URIs of linked resources created while converting a document to fixed-form .xaml. - -```python -def test_resource_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - callback = ExXamlFixedSaveOptions.ResourceUriPrinter() - - # Create a "XamlFixedSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFixedSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FIXED, options.save_format) - - # Use the "resources_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked resources, such as images and fonts. - options.resources_folder = ARTIFACTS_DIR + "XamlFixedResourceFolder" - - # Use the "resources_folder_alias" property to use this folder - # when constructing image URIs instead of the resources folder's name. - options.resources_folder_alias = ARTIFACTS_DIR + "XamlFixedFolderAlias" - - options.resource_saving_callback = callback - - # A folder specified by "resources_folder_alias" will need to contain the resources instead of "resources_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.resources_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFixedSaveOptions.resource_folder.xaml", options) - - for resource in callback.resources: - print(resource) - - -class ResourceUriPrinter(aw.saving.IResourceSavingCallback): - """Counts and prints URIs of resources created during conversion to fixed .xaml.""" - - def __init__(self): - - self.resources = [] # type: List[str] - - def resource_saving(self, args: aw.saving.ResourceSavingArgs): - - self.resources.add(f"Resource \"{args.resource_file_name}\"\n\t{args.resource_file_uri}") - - # If we specified a resource folder alias, we would also need - # to redirect each stream to put its resource in the alias folder. - args.resource_stream = open(args.resource_file_uri, 'wb') - args.keep_resource_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder/_index.md b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder/_index.md index 6149134df6e..baf0a2b951c 100644 --- a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder/_index.md +++ b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder/_index.md @@ -45,59 +45,6 @@ by using the [XamlFixedSaveOptions.resources_folder](./) property -### Examples - -Shows how to print the URIs of linked resources created while converting a document to fixed-form .xaml. - -```python -def test_resource_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - callback = ExXamlFixedSaveOptions.ResourceUriPrinter() - - # Create a "XamlFixedSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFixedSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FIXED, options.save_format) - - # Use the "resources_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked resources, such as images and fonts. - options.resources_folder = ARTIFACTS_DIR + "XamlFixedResourceFolder" - - # Use the "resources_folder_alias" property to use this folder - # when constructing image URIs instead of the resources folder's name. - options.resources_folder_alias = ARTIFACTS_DIR + "XamlFixedFolderAlias" - - options.resource_saving_callback = callback - - # A folder specified by "resources_folder_alias" will need to contain the resources instead of "resources_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.resources_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFixedSaveOptions.resource_folder.xaml", options) - - for resource in callback.resources: - print(resource) - - -class ResourceUriPrinter(aw.saving.IResourceSavingCallback): - """Counts and prints URIs of resources created during conversion to fixed .xaml.""" - - def __init__(self): - - self.resources = [] # type: List[str] - - def resource_saving(self, args: aw.saving.ResourceSavingArgs): - - self.resources.add(f"Resource \"{args.resource_file_name}\"\n\t{args.resource_file_uri}") - - # If we specified a resource folder alias, we would also need - # to redirect each stream to put its resource in the alias folder. - args.resource_stream = open(args.resource_file_uri, 'wb') - args.keep_resource_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder_alias/_index.md b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder_alias/_index.md index a1a0e21fd64..b7f7d502f4b 100644 --- a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder_alias/_index.md +++ b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/resources_folder_alias/_index.md @@ -37,59 +37,6 @@ allows to specify how the image URIs will be constructed. -### Examples - -Shows how to print the URIs of linked resources created while converting a document to fixed-form .xaml. - -```python -def test_resource_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - callback = ExXamlFixedSaveOptions.ResourceUriPrinter() - - # Create a "XamlFixedSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFixedSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FIXED, options.save_format) - - # Use the "resources_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked resources, such as images and fonts. - options.resources_folder = ARTIFACTS_DIR + "XamlFixedResourceFolder" - - # Use the "resources_folder_alias" property to use this folder - # when constructing image URIs instead of the resources folder's name. - options.resources_folder_alias = ARTIFACTS_DIR + "XamlFixedFolderAlias" - - options.resource_saving_callback = callback - - # A folder specified by "resources_folder_alias" will need to contain the resources instead of "resources_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.resources_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFixedSaveOptions.resource_folder.xaml", options) - - for resource in callback.resources: - print(resource) - - -class ResourceUriPrinter(aw.saving.IResourceSavingCallback): - """Counts and prints URIs of resources created during conversion to fixed .xaml.""" - - def __init__(self): - - self.resources = [] # type: List[str] - - def resource_saving(self, args: aw.saving.ResourceSavingArgs): - - self.resources.add(f"Resource \"{args.resource_file_name}\"\n\t{args.resource_file_uri}") - - # If we specified a resource folder alias, we would also need - # to redirect each stream to put its resource in the alias folder. - args.resource_stream = open(args.resource_file_uri, 'wb') - args.keep_resource_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/save_format/_index.md b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/save_format/_index.md index bd4eb7e09e3..ba103ec4f67 100644 --- a/english/python-net/aspose.words.saving/xamlfixedsaveoptions/save_format/_index.md +++ b/english/python-net/aspose.words.saving/xamlfixedsaveoptions/save_format/_index.md @@ -27,59 +27,6 @@ def save_format(self, value: aspose.words.SaveFormat): ``` -### Examples - -Shows how to print the URIs of linked resources created while converting a document to fixed-form .xaml. - -```python -def test_resource_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - callback = ExXamlFixedSaveOptions.ResourceUriPrinter() - - # Create a "XamlFixedSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFixedSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FIXED, options.save_format) - - # Use the "resources_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked resources, such as images and fonts. - options.resources_folder = ARTIFACTS_DIR + "XamlFixedResourceFolder" - - # Use the "resources_folder_alias" property to use this folder - # when constructing image URIs instead of the resources folder's name. - options.resources_folder_alias = ARTIFACTS_DIR + "XamlFixedFolderAlias" - - options.resource_saving_callback = callback - - # A folder specified by "resources_folder_alias" will need to contain the resources instead of "resources_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.resources_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFixedSaveOptions.resource_folder.xaml", options) - - for resource in callback.resources: - print(resource) - - -class ResourceUriPrinter(aw.saving.IResourceSavingCallback): - """Counts and prints URIs of resources created during conversion to fixed .xaml.""" - - def __init__(self): - - self.resources = [] # type: List[str] - - def resource_saving(self, args: aw.saving.ResourceSavingArgs): - - self.resources.add(f"Resource \"{args.resource_file_name}\"\n\t{args.resource_file_uri}") - - # If we specified a resource folder alias, we would also need - # to redirect each stream to put its resource in the alias folder. - args.resource_stream = open(args.resource_file_uri, 'wb') - args.keep_resource_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlflowsaveoptions/__init__/_index.md b/english/python-net/aspose.words.saving/xamlflowsaveoptions/__init__/_index.md index fde75a1335f..c0daa0d4839 100644 --- a/english/python-net/aspose.words.saving/xamlflowsaveoptions/__init__/_index.md +++ b/english/python-net/aspose.words.saving/xamlflowsaveoptions/__init__/_index.md @@ -36,61 +36,6 @@ def __init__(self, save_format: aspose.words.SaveFormat): | --- | --- | --- | | save_format | [SaveFormat](../../../aspose.words/saveformat/) | Can be [SaveFormat.XAML_FLOW](../../../aspose.words/saveformat/#XAML_FLOW) or [SaveFormat.XAML_FLOW_PACK](../../../aspose.words/saveformat/#XAML_FLOW_PACK). | -## Examples - -Shows how to print the filenames of linked images created while converting a document to flow-form .xaml. - -```python -def test_image_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - - callback = ExXamlFlowSaveOptions.ImageUriPrinter(ARTIFACTS_DIR + "XamlFlowImageFolderAlias") - - # Create a "XamlFlowSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFlowSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FLOW, options.save_format) - - # Use the "images_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked images. - options.images_folder = ARTIFACTS_DIR + "XamlFlowImageFolder" - - # Use the "images_folder_alias" property to use this folder - # when constructing image URIs instead of the images folder's name. - options.images_folder_alias = ARTIFACTS_DIR + "XamlFlowImageFolderAlias" - - options.image_saving_callback = callback - - # A folder specified by "images_folder_alias" will need to contain the resources instead of "images_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.images_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFlowSaveOptions.image_folder.xaml", options) - - for resource in callback.Resources: - print(f"{callback.images_folder_alias}/{resource}") - - -class ImageUriPrinter(aw.saving.IImageSavingCallback): - """Counts and prints filenames of images while their parent document is converted to flow-form .xaml.""" - - def __init__(self, images_folder_alias: str): - - self.images_folder_alias = images_folder_alias - self.resources = [] # type: List[str] - - def image_saving(self, args: aw.saving.ImageSavingArgs): - - self.resources.add(args.image_file_name) - - # If we specified an image folder alias, we would also need - # to redirect each stream to put its image in the alias folder. - args.image_stream = open(f"{self.images_folder_alias}/{args.image_file_name}", "wb") - args.keep_image_stream_open = False -``` - ## See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlflowsaveoptions/_index.md b/english/python-net/aspose.words.saving/xamlflowsaveoptions/_index.md index c18973c8ce4..fa612ca336f 100644 --- a/english/python-net/aspose.words.saving/xamlflowsaveoptions/_index.md +++ b/english/python-net/aspose.words.saving/xamlflowsaveoptions/_index.md @@ -61,61 +61,6 @@ To learn more, visit the [Specify Save Options](https://docs.aspose.com/words/py |[ create_save_options(save_format)](../saveoptions/create_save_options/#saveformat) | Creates a save options object of a class suitable for the specified save format.
(Inherited from [SaveOptions](../saveoptions/)) | |[ create_save_options(file_name)](../saveoptions/create_save_options/#str) | Creates a save options object of a class suitable for the file extension specified in the given file name.
(Inherited from [SaveOptions](../saveoptions/)) | -### Examples - -Shows how to print the filenames of linked images created while converting a document to flow-form .xaml. - -```python -def test_image_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - - callback = ExXamlFlowSaveOptions.ImageUriPrinter(ARTIFACTS_DIR + "XamlFlowImageFolderAlias") - - # Create a "XamlFlowSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFlowSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FLOW, options.save_format) - - # Use the "images_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked images. - options.images_folder = ARTIFACTS_DIR + "XamlFlowImageFolder" - - # Use the "images_folder_alias" property to use this folder - # when constructing image URIs instead of the images folder's name. - options.images_folder_alias = ARTIFACTS_DIR + "XamlFlowImageFolderAlias" - - options.image_saving_callback = callback - - # A folder specified by "images_folder_alias" will need to contain the resources instead of "images_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.images_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFlowSaveOptions.image_folder.xaml", options) - - for resource in callback.Resources: - print(f"{callback.images_folder_alias}/{resource}") - - -class ImageUriPrinter(aw.saving.IImageSavingCallback): - """Counts and prints filenames of images while their parent document is converted to flow-form .xaml.""" - - def __init__(self, images_folder_alias: str): - - self.images_folder_alias = images_folder_alias - self.resources = [] # type: List[str] - - def image_saving(self, args: aw.saving.ImageSavingArgs): - - self.resources.add(args.image_file_name) - - # If we specified an image folder alias, we would also need - # to redirect each stream to put its image in the alias folder. - args.image_stream = open(f"{self.images_folder_alias}/{args.image_file_name}", "wb") - args.keep_image_stream_open = False -``` - ### See Also * module [aspose.words.saving](../) diff --git a/english/python-net/aspose.words.saving/xamlflowsaveoptions/image_saving_callback/_index.md b/english/python-net/aspose.words.saving/xamlflowsaveoptions/image_saving_callback/_index.md index 00210842d6f..37d7af8c446 100644 --- a/english/python-net/aspose.words.saving/xamlflowsaveoptions/image_saving_callback/_index.md +++ b/english/python-net/aspose.words.saving/xamlflowsaveoptions/image_saving_callback/_index.md @@ -25,61 +25,6 @@ def image_saving_callback(self, value: aspose.words.saving.IImageSavingCallback) ``` -### Examples - -Shows how to print the filenames of linked images created while converting a document to flow-form .xaml. - -```python -def test_image_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - - callback = ExXamlFlowSaveOptions.ImageUriPrinter(ARTIFACTS_DIR + "XamlFlowImageFolderAlias") - - # Create a "XamlFlowSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFlowSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FLOW, options.save_format) - - # Use the "images_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked images. - options.images_folder = ARTIFACTS_DIR + "XamlFlowImageFolder" - - # Use the "images_folder_alias" property to use this folder - # when constructing image URIs instead of the images folder's name. - options.images_folder_alias = ARTIFACTS_DIR + "XamlFlowImageFolderAlias" - - options.image_saving_callback = callback - - # A folder specified by "images_folder_alias" will need to contain the resources instead of "images_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.images_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFlowSaveOptions.image_folder.xaml", options) - - for resource in callback.Resources: - print(f"{callback.images_folder_alias}/{resource}") - - -class ImageUriPrinter(aw.saving.IImageSavingCallback): - """Counts and prints filenames of images while their parent document is converted to flow-form .xaml.""" - - def __init__(self, images_folder_alias: str): - - self.images_folder_alias = images_folder_alias - self.resources = [] # type: List[str] - - def image_saving(self, args: aw.saving.ImageSavingArgs): - - self.resources.add(args.image_file_name) - - # If we specified an image folder alias, we would also need - # to redirect each stream to put its image in the alias folder. - args.image_stream = open(f"{self.images_folder_alias}/{args.image_file_name}", "wb") - args.keep_image_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder/_index.md b/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder/_index.md index 0d85068ef3e..be611a4f659 100644 --- a/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder/_index.md +++ b/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder/_index.md @@ -45,61 +45,6 @@ the [XamlFlowSaveOptions.image_saving_callback](../image_saving_callback/) event -### Examples - -Shows how to print the filenames of linked images created while converting a document to flow-form .xaml. - -```python -def test_image_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - - callback = ExXamlFlowSaveOptions.ImageUriPrinter(ARTIFACTS_DIR + "XamlFlowImageFolderAlias") - - # Create a "XamlFlowSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFlowSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FLOW, options.save_format) - - # Use the "images_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked images. - options.images_folder = ARTIFACTS_DIR + "XamlFlowImageFolder" - - # Use the "images_folder_alias" property to use this folder - # when constructing image URIs instead of the images folder's name. - options.images_folder_alias = ARTIFACTS_DIR + "XamlFlowImageFolderAlias" - - options.image_saving_callback = callback - - # A folder specified by "images_folder_alias" will need to contain the resources instead of "images_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.images_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFlowSaveOptions.image_folder.xaml", options) - - for resource in callback.Resources: - print(f"{callback.images_folder_alias}/{resource}") - - -class ImageUriPrinter(aw.saving.IImageSavingCallback): - """Counts and prints filenames of images while their parent document is converted to flow-form .xaml.""" - - def __init__(self, images_folder_alias: str): - - self.images_folder_alias = images_folder_alias - self.resources = [] # type: List[str] - - def image_saving(self, args: aw.saving.ImageSavingArgs): - - self.resources.add(args.image_file_name) - - # If we specified an image folder alias, we would also need - # to redirect each stream to put its image in the alias folder. - args.image_stream = open(f"{self.images_folder_alias}/{args.image_file_name}", "wb") - args.keep_image_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder_alias/_index.md b/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder_alias/_index.md index 8e9515e0689..dcfd84fa87b 100644 --- a/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder_alias/_index.md +++ b/english/python-net/aspose.words.saving/xamlflowsaveoptions/images_folder_alias/_index.md @@ -45,61 +45,6 @@ will be written to XAML without path regardless of other options. -### Examples - -Shows how to print the filenames of linked images created while converting a document to flow-form .xaml. - -```python -def test_image_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - - callback = ExXamlFlowSaveOptions.ImageUriPrinter(ARTIFACTS_DIR + "XamlFlowImageFolderAlias") - - # Create a "XamlFlowSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFlowSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FLOW, options.save_format) - - # Use the "images_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked images. - options.images_folder = ARTIFACTS_DIR + "XamlFlowImageFolder" - - # Use the "images_folder_alias" property to use this folder - # when constructing image URIs instead of the images folder's name. - options.images_folder_alias = ARTIFACTS_DIR + "XamlFlowImageFolderAlias" - - options.image_saving_callback = callback - - # A folder specified by "images_folder_alias" will need to contain the resources instead of "images_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.images_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFlowSaveOptions.image_folder.xaml", options) - - for resource in callback.Resources: - print(f"{callback.images_folder_alias}/{resource}") - - -class ImageUriPrinter(aw.saving.IImageSavingCallback): - """Counts and prints filenames of images while their parent document is converted to flow-form .xaml.""" - - def __init__(self, images_folder_alias: str): - - self.images_folder_alias = images_folder_alias - self.resources = [] # type: List[str] - - def image_saving(self, args: aw.saving.ImageSavingArgs): - - self.resources.add(args.image_file_name) - - # If we specified an image folder alias, we would also need - # to redirect each stream to put its image in the alias folder. - args.image_stream = open(f"{self.images_folder_alias}/{args.image_file_name}", "wb") - args.keep_image_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.saving/xamlflowsaveoptions/save_format/_index.md b/english/python-net/aspose.words.saving/xamlflowsaveoptions/save_format/_index.md index 0841c620921..a6252edfc2c 100644 --- a/english/python-net/aspose.words.saving/xamlflowsaveoptions/save_format/_index.md +++ b/english/python-net/aspose.words.saving/xamlflowsaveoptions/save_format/_index.md @@ -27,61 +27,6 @@ def save_format(self, value: aspose.words.SaveFormat): ``` -### Examples - -Shows how to print the filenames of linked images created while converting a document to flow-form .xaml. - -```python -def test_image_folder(self): - - doc = aw.Document(MY_DIR + "Rendering.docx") - - callback = ExXamlFlowSaveOptions.ImageUriPrinter(ARTIFACTS_DIR + "XamlFlowImageFolderAlias") - - # Create a "XamlFlowSaveOptions" object, which we can pass to the document's "save" method - # to modify how we save the document to the XAML save format. - options = aw.saving.XamlFlowSaveOptions() - - self.assertEqual(aw.SaveFormat.XAML_FLOW, options.save_format) - - # Use the "images_folder" property to assign a folder in the local file system into which - # Aspose.Words will save all the document's linked images. - options.images_folder = ARTIFACTS_DIR + "XamlFlowImageFolder" - - # Use the "images_folder_alias" property to use this folder - # when constructing image URIs instead of the images folder's name. - options.images_folder_alias = ARTIFACTS_DIR + "XamlFlowImageFolderAlias" - - options.image_saving_callback = callback - - # A folder specified by "images_folder_alias" will need to contain the resources instead of "images_folder". - # We must ensure the folder exists before the callback's streams can put their resources into it. - os.makedirs(options.images_folder_alias) - - doc.save(ARTIFACTS_DIR + "XamlFlowSaveOptions.image_folder.xaml", options) - - for resource in callback.Resources: - print(f"{callback.images_folder_alias}/{resource}") - - -class ImageUriPrinter(aw.saving.IImageSavingCallback): - """Counts and prints filenames of images while their parent document is converted to flow-form .xaml.""" - - def __init__(self, images_folder_alias: str): - - self.images_folder_alias = images_folder_alias - self.resources = [] # type: List[str] - - def image_saving(self, args: aw.saving.ImageSavingArgs): - - self.resources.add(args.image_file_name) - - # If we specified an image folder alias, we would also need - # to redirect each stream to put its image in the alias folder. - args.image_stream = open(f"{self.images_folder_alias}/{args.image_file_name}", "wb") - args.keep_image_stream_open = False -``` - ### See Also * module [aspose.words.saving](../../) diff --git a/english/python-net/aspose.words.shaping/_index.md b/english/python-net/aspose.words.shaping/_index.md index 4117379fe0b..0a6e3f88fbd 100644 --- a/english/python-net/aspose.words.shaping/_index.md +++ b/english/python-net/aspose.words.shaping/_index.md @@ -31,6 +31,7 @@ support for OpenType features using external text shaping engines. | --- | --- | | [Direction](./direction/) | Text direction. | | [FontFeature](./fontfeature/) | Features provide information about how glyphs are used in a font to render a script. https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags | +| [GlyphFlags](./glyphflags/) | Glyph flags. | | [ScriptShapingLevel](./scriptshapinglevel/) | Describes shaping levels required by a script. | | [UnicodeScript](./unicodescript/) | Unicode Character Database property: Script (sc). | | [VariationAxis](./variationaxis/) | Represents OpenType Design-Variation Axis Tag. https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg | diff --git a/english/python-net/aspose.words.shaping/glyph/_index.md b/english/python-net/aspose.words.shaping/glyph/_index.md index 6cd680e2262..415c185aaf4 100644 --- a/english/python-net/aspose.words.shaping/glyph/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/_index.md @@ -23,6 +23,7 @@ Represents a glyph | Name | Description | | --- | --- | +| [additional_advance](./additional_advance/) | Additional advance width which may be used to adjust placement for the subsequent glyph. | | [advance](./advance/) | Advance width indicating placement for the subsequent glyph. | | [advance_offset](./advance_offset/) | Horizontal (x) offset relative to glyph position. Mostly used to attach marks (like diacritics) to base characters. | | [ascender_offset](./ascender_offset/) | Vertical (y) offset relative to glyph position. Mostly used to attach marks (like diacritics) to base characters. | diff --git a/english/python-net/aspose.words.shaping/glyph/additional_advance/_index.md b/english/python-net/aspose.words.shaping/glyph/additional_advance/_index.md new file mode 100644 index 00000000000..583da080828 --- /dev/null +++ b/english/python-net/aspose.words.shaping/glyph/additional_advance/_index.md @@ -0,0 +1,28 @@ +--- +title: Glyph.additional_advance property +linktitle: additional_advance property +articleTitle: additional_advance property +second_title: Aspose.Words for Python +description: "Glyph.additional_advance property. Additional advance width which may be used to adjust placement for the subsequent glyph." +type: docs +weight: 20 +url: /python-net/aspose.words.shaping/glyph/additional_advance/ +--- + +## Glyph.additional_advance property + +Additional advance width which may be used to adjust placement for the subsequent glyph. + + +```python +@property +def additional_advance(self) -> int: + ... + +``` + +### See Also + +* module [aspose.words.shaping](../../) +* class [Glyph](../) + diff --git a/english/python-net/aspose.words.shaping/glyph/advance/_index.md b/english/python-net/aspose.words.shaping/glyph/advance/_index.md index c28254c302c..e3835d5f928 100644 --- a/english/python-net/aspose.words.shaping/glyph/advance/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/advance/_index.md @@ -5,7 +5,7 @@ articleTitle: advance property second_title: Aspose.Words for Python description: "Glyph.advance property. Advance width indicating placement for the subsequent glyph." type: docs -weight: 20 +weight: 30 url: /python-net/aspose.words.shaping/glyph/advance/ --- @@ -19,10 +19,6 @@ Advance width indicating placement for the subsequent glyph. def advance(self) -> int: ... -@advance.setter -def advance(self, value: int): - ... - ``` ### See Also diff --git a/english/python-net/aspose.words.shaping/glyph/advance_offset/_index.md b/english/python-net/aspose.words.shaping/glyph/advance_offset/_index.md index d71a2db4bb1..1cfb9cde483 100644 --- a/english/python-net/aspose.words.shaping/glyph/advance_offset/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/advance_offset/_index.md @@ -5,7 +5,7 @@ articleTitle: advance_offset property second_title: Aspose.Words for Python description: "Glyph.advance_offset property. Horizontal (x) offset relative to glyph position" type: docs -weight: 30 +weight: 40 url: /python-net/aspose.words.shaping/glyph/advance_offset/ --- diff --git a/english/python-net/aspose.words.shaping/glyph/ascender_offset/_index.md b/english/python-net/aspose.words.shaping/glyph/ascender_offset/_index.md index 14e3be96a1e..0e4ba5d6b0a 100644 --- a/english/python-net/aspose.words.shaping/glyph/ascender_offset/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/ascender_offset/_index.md @@ -5,7 +5,7 @@ articleTitle: ascender_offset property second_title: Aspose.Words for Python description: "Glyph.ascender_offset property. Vertical (y) offset relative to glyph position" type: docs -weight: 40 +weight: 50 url: /python-net/aspose.words.shaping/glyph/ascender_offset/ --- diff --git a/english/python-net/aspose.words.shaping/glyph/clone/_index.md b/english/python-net/aspose.words.shaping/glyph/clone/_index.md index bf81b3f7c6f..172f923f2ec 100644 --- a/english/python-net/aspose.words.shaping/glyph/clone/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/clone/_index.md @@ -5,7 +5,7 @@ articleTitle: clone method second_title: Aspose.Words for Python description: "Glyph.clone method. Returns a clone of this instance." type: docs -weight: 60 +weight: 70 url: /python-net/aspose.words.shaping/glyph/clone/ --- diff --git a/english/python-net/aspose.words.shaping/glyph/get_width/_index.md b/english/python-net/aspose.words.shaping/glyph/get_width/_index.md index 326471152c4..347cd5a9044 100644 --- a/english/python-net/aspose.words.shaping/glyph/get_width/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/get_width/_index.md @@ -5,7 +5,7 @@ articleTitle: get_width method second_title: Aspose.Words for Python description: "Glyph.get_width method. Returns width (advance) of the glyph in points." type: docs -weight: 70 +weight: 80 url: /python-net/aspose.words.shaping/glyph/get_width/ --- diff --git a/english/python-net/aspose.words.shaping/glyph/glyph_index/_index.md b/english/python-net/aspose.words.shaping/glyph/glyph_index/_index.md index 8de730cdc4f..c1ba00841e5 100644 --- a/english/python-net/aspose.words.shaping/glyph/glyph_index/_index.md +++ b/english/python-net/aspose.words.shaping/glyph/glyph_index/_index.md @@ -5,7 +5,7 @@ articleTitle: glyph_index property second_title: Aspose.Words for Python description: "Glyph.glyph_index property. Index of the glyph (GID) in the physical font." type: docs -weight: 50 +weight: 60 url: /python-net/aspose.words.shaping/glyph/glyph_index/ --- diff --git a/english/python-net/aspose.words.shaping/glyphflags/_index.md b/english/python-net/aspose.words.shaping/glyphflags/_index.md new file mode 100644 index 00000000000..cec17e39978 --- /dev/null +++ b/english/python-net/aspose.words.shaping/glyphflags/_index.md @@ -0,0 +1,28 @@ +--- +title: GlyphFlags enumeration +linktitle: GlyphFlags enumeration +articleTitle: GlyphFlags enumeration +second_title: Aspose.Words for Python +description: "aspose.words.shaping.GlyphFlags enumeration. Glyph flags." +type: docs +weight: 60 +url: /python-net/aspose.words.shaping/glyphflags/ +--- + +## GlyphFlags enumeration + +Glyph flags. + + +### Members + +| Name | Description | +| --- | --- | +| UNSAFE_TO_BREAK | Indicates that if input text is broken at the beginning of the cluster this glyph is part of, then both sides need to be re-shaped, as the result might be different. | +| UNSAFE_TO_CONCAT | Indicates that if input text is changed on one side of the beginning of the cluster this glyph is part of, then the shaping results for the other side might change. | +| SAFE_TO_INSERT_TATWEEL | In scripts that use elongation (Arabic, Mongolian, Syriac, etc.), this flag signifies that it is safe to insert a U+0640 TATWEEL character before this cluster for elongation. This flag does not determine the script-specific elongation places, but only when it is safe to do the elongation without interrupting text shaping. | + +### See Also + +* module [aspose.words.shaping](../) + diff --git a/english/python-net/aspose.words.shaping/itextshaper/_index.md b/english/python-net/aspose.words.shaping/itextshaper/_index.md index 2f245286601..36f6b245e14 100644 --- a/english/python-net/aspose.words.shaping/itextshaper/_index.md +++ b/english/python-net/aspose.words.shaping/itextshaper/_index.md @@ -5,7 +5,7 @@ articleTitle: ITextShaper class second_title: Aspose.Words for Python description: "aspose.words.shaping.ITextShaper class. Provides methods for text shaping." type: docs -weight: 60 +weight: 70 url: /python-net/aspose.words.shaping/itextshaper/ --- diff --git a/english/python-net/aspose.words.shaping/itextshaperfactory/_index.md b/english/python-net/aspose.words.shaping/itextshaperfactory/_index.md index 5eb25347b4f..fdf73b25b13 100644 --- a/english/python-net/aspose.words.shaping/itextshaperfactory/_index.md +++ b/english/python-net/aspose.words.shaping/itextshaperfactory/_index.md @@ -5,7 +5,7 @@ articleTitle: ITextShaperFactory class second_title: Aspose.Words for Python description: "aspose.words.shaping.ITextShaperFactory class. An interface of a factory for constructing [ITextShaper](../itextshaper/) implementations." type: docs -weight: 70 +weight: 80 url: /python-net/aspose.words.shaping/itextshaperfactory/ --- diff --git a/english/python-net/aspose.words.shaping/scriptshapinglevel/_index.md b/english/python-net/aspose.words.shaping/scriptshapinglevel/_index.md index 3569e8b142a..3d6264bd5a4 100644 --- a/english/python-net/aspose.words.shaping/scriptshapinglevel/_index.md +++ b/english/python-net/aspose.words.shaping/scriptshapinglevel/_index.md @@ -5,7 +5,7 @@ articleTitle: ScriptShapingLevel enumeration second_title: Aspose.Words for Python description: "aspose.words.shaping.ScriptShapingLevel enumeration. Describes shaping levels required by a script." type: docs -weight: 80 +weight: 90 url: /python-net/aspose.words.shaping/scriptshapinglevel/ --- diff --git a/english/python-net/aspose.words.shaping/unicodescript/_index.md b/english/python-net/aspose.words.shaping/unicodescript/_index.md index f483883d4b4..5ea8c654369 100644 --- a/english/python-net/aspose.words.shaping/unicodescript/_index.md +++ b/english/python-net/aspose.words.shaping/unicodescript/_index.md @@ -5,7 +5,7 @@ articleTitle: UnicodeScript enumeration second_title: Aspose.Words for Python description: "aspose.words.shaping.UnicodeScript enumeration. Unicode Character Database property: Script (sc)." type: docs -weight: 90 +weight: 100 url: /python-net/aspose.words.shaping/unicodescript/ --- diff --git a/english/python-net/aspose.words.shaping/variationaxis/_index.md b/english/python-net/aspose.words.shaping/variationaxis/_index.md index e15d1f58d97..adecd80a9d5 100644 --- a/english/python-net/aspose.words.shaping/variationaxis/_index.md +++ b/english/python-net/aspose.words.shaping/variationaxis/_index.md @@ -5,7 +5,7 @@ articleTitle: VariationAxis enumeration second_title: Aspose.Words for Python description: "aspose.words.shaping.VariationAxis enumeration. Represents OpenType Design-Variation Axis Tag" type: docs -weight: 100 +weight: 110 url: /python-net/aspose.words.shaping/variationaxis/ --- diff --git a/english/python-net/aspose.words.shaping/variationaxiscoordinate/_index.md b/english/python-net/aspose.words.shaping/variationaxiscoordinate/_index.md index 77662f2498a..e52b4532cf3 100644 --- a/english/python-net/aspose.words.shaping/variationaxiscoordinate/_index.md +++ b/english/python-net/aspose.words.shaping/variationaxiscoordinate/_index.md @@ -5,7 +5,7 @@ articleTitle: VariationAxisCoordinate class second_title: Aspose.Words for Python description: "aspose.words.shaping.VariationAxisCoordinate class. Represents an axis coordinate." type: docs -weight: 110 +weight: 120 url: /python-net/aspose.words.shaping/variationaxiscoordinate/ --- diff --git a/english/python-net/aspose.words/_index.md b/english/python-net/aspose.words/_index.md index 416e9c9c48a..d8d49d6d9b3 100644 --- a/english/python-net/aspose.words/_index.md +++ b/english/python-net/aspose.words/_index.md @@ -108,6 +108,7 @@ The main classes in this module are: | [NodeCollection](./nodecollection/) | Represents a collection of nodes of a specific type. To learn more, visit the [Aspose.Words Document Object Model (DOM)](https://docs.aspose.com/words/python-net/aspose-words-document-object-model/) documentation article. | | [NodeImporter](./nodeimporter/) | Allows to efficiently perform repeated import of nodes from one document to another. To learn more, visit the [Aspose.Words Document Object Model (DOM)](https://docs.aspose.com/words/python-net/aspose-words-document-object-model/) documentation article. | | [NodeList](./nodelist/) | Represents a collection of nodes matching an XPath query executed using the [CompositeNode.select_nodes()](./compositenode/select_nodes/#str) method. To learn more, visit the [Aspose.Words Document Object Model (DOM)](https://docs.aspose.com/words/python-net/aspose-words-document-object-model/) documentation article. | +| [PageExtractOptions](./pageextractoptions/) | Allows to specify options for document page extracting. | | [PageSetup](./pagesetup/) | Represents the page setup properties of a section. To learn more, visit the [Working with Sections](https://docs.aspose.com/words/python-net/working-with-sections/) documentation article. | | [Paragraph](./paragraph/) | Represents a paragraph of text. To learn more, visit the [Working with Paragraphs](https://docs.aspose.com/words/python-net/working-with-paragraphs/) documentation article. | | [ParagraphCollection](./paragraphcollection/) | Provides typed access to a collection of [Paragraph](./paragraph/) nodes. To learn more, visit the [Working with Paragraphs](https://docs.aspose.com/words/python-net/working-with-paragraphs/) documentation article. | @@ -136,6 +137,7 @@ The main classes in this module are: | [TextColumn](./textcolumn/) | Represents a single text column. [TextColumn](./textcolumn/) is a member of the [TextColumnCollection](./textcolumncollection/) collection. The [TextColumn](./textcolumn/) collection includes all the columns in a section of a document. To learn more, visit the [Working with Sections](https://docs.aspose.com/words/python-net/working-with-sections/) documentation article. | | [TextColumnCollection](./textcolumncollection/) | A collection of [TextColumn](./textcolumn/) objects that represent all the columns of text in a section of a document. To learn more, visit the [Working with Sections](https://docs.aspose.com/words/python-net/working-with-sections/) documentation article. | | [TextWatermarkOptions](./textwatermarkoptions/) | Contains options that can be specified when adding a watermark with text. To learn more, visit the [Working with Watermark](https://docs.aspose.com/words/python-net/working-with-watermark/) documentation article. | +| [UnsupportedEncryptionException](./unsupportedencryptionexception/) | Thrown during document load, when the document is encrypted with an unsupported method. | | [UnsupportedFileFormatException](./unsupportedfileformatexception/) | Thrown during document load, when the document format is not recognized or not supported by Aspose.Words. To learn more, visit the [Programming with Documents](https://docs.aspose.com/words/python-net/programming-with-documents/) documentation article. | | [VariableCollection](./variablecollection/) | A collection of document variables. To learn more, visit the [Work with Document Properties](https://docs.aspose.com/words/python-net/work-with-document-properties/) documentation article. | | [WarningInfo](./warninginfo/) | Contains information about a warning that Aspose.Words issued during document loading or saving. To learn more, visit the [Programming with Documents](https://docs.aspose.com/words/python-net/programming-with-documents/) documentation article. | diff --git a/english/python-net/aspose.words/cleanupoptions/_index.md b/english/python-net/aspose.words/cleanupoptions/_index.md index 33f9a58d142..c630d6ad9c5 100644 --- a/english/python-net/aspose.words/cleanupoptions/_index.md +++ b/english/python-net/aspose.words/cleanupoptions/_index.md @@ -49,8 +49,8 @@ self.assertEqual(8, doc.styles.count) builder = aw.DocumentBuilder(doc=doc) builder.font.style = doc.styles.get_by_name('MyParagraphStyle1') builder.writeln('Hello world!') -list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) -builder.list_format.list = list +doc_list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) +builder.list_format.list = doc_list builder.writeln('Item 1') builder.writeln('Item 2') # Now, there is one unused character style and one unused list style. diff --git a/english/python-net/aspose.words/cleanupoptions/unused_builtin_styles/_index.md b/english/python-net/aspose.words/cleanupoptions/unused_builtin_styles/_index.md index 3ed6c740cfb..79317432b32 100644 --- a/english/python-net/aspose.words/cleanupoptions/unused_builtin_styles/_index.md +++ b/english/python-net/aspose.words/cleanupoptions/unused_builtin_styles/_index.md @@ -44,8 +44,8 @@ self.assertEqual(8, doc.styles.count) builder = aw.DocumentBuilder(doc=doc) builder.font.style = doc.styles.get_by_name('MyParagraphStyle1') builder.writeln('Hello world!') -list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) -builder.list_format.list = list +doc_list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) +builder.list_format.list = doc_list builder.writeln('Item 1') builder.writeln('Item 2') # Now, there is one unused character style and one unused list style. diff --git a/english/python-net/aspose.words/cleanupoptions/unused_lists/_index.md b/english/python-net/aspose.words/cleanupoptions/unused_lists/_index.md index cc1daa2ee80..73a7dd9a63f 100644 --- a/english/python-net/aspose.words/cleanupoptions/unused_lists/_index.md +++ b/english/python-net/aspose.words/cleanupoptions/unused_lists/_index.md @@ -45,8 +45,8 @@ self.assertEqual(8, doc.styles.count) builder = aw.DocumentBuilder(doc=doc) builder.font.style = doc.styles.get_by_name('MyParagraphStyle1') builder.writeln('Hello world!') -list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) -builder.list_format.list = list +doc_list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) +builder.list_format.list = doc_list builder.writeln('Item 1') builder.writeln('Item 2') # Now, there is one unused character style and one unused list style. diff --git a/english/python-net/aspose.words/cleanupoptions/unused_styles/_index.md b/english/python-net/aspose.words/cleanupoptions/unused_styles/_index.md index 336f4b6743a..266c56b39e0 100644 --- a/english/python-net/aspose.words/cleanupoptions/unused_styles/_index.md +++ b/english/python-net/aspose.words/cleanupoptions/unused_styles/_index.md @@ -45,8 +45,8 @@ self.assertEqual(8, doc.styles.count) builder = aw.DocumentBuilder(doc=doc) builder.font.style = doc.styles.get_by_name('MyParagraphStyle1') builder.writeln('Hello world!') -list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) -builder.list_format.list = list +doc_list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) +builder.list_format.list = doc_list builder.writeln('Item 1') builder.writeln('Item 2') # Now, there is one unused character style and one unused list style. diff --git a/english/python-net/aspose.words/document/_index.md b/english/python-net/aspose.words/document/_index.md index 00123c5a1d6..abc191cdfe2 100644 --- a/english/python-net/aspose.words/document/_index.md +++ b/english/python-net/aspose.words/document/_index.md @@ -172,6 +172,7 @@ In Microsoft Word, a valid document needs to have at least one section. |[ copy_styles_from_template(template)](./copy_styles_from_template/#document) | Copies styles from the specified template to a document. | |[ ensure_minimum()](./ensure_minimum/#default) | If the document contains no sections, creates one section with one paragraph. | |[ expand_table_styles_to_direct_formatting()](./expand_table_styles_to_direct_formatting/#default) | Converts formatting specified in table styles into direct formatting on tables in the document. | +|[ extract_pages(index, count, options)](./extract_pages/#int_int_pageextractoptions) | Returns the [Document](./) object representing the specified range of pages and the given page extract options. | |[ extract_pages(index, count)](./extract_pages/#int_int) | Returns the [Document](./) object representing specified range of pages. | |[ get_ancestor(ancestor_type)](../node/get_ancestor/#object) | Gets the first ancestor of the specified object type.
(Inherited from [Node](../node/)) | |[ get_ancestor(ancestor_type)](../node/get_ancestor/#nodetype) | Gets the first ancestor of the specified [NodeType](../nodetype/).
(Inherited from [Node](../node/)) | diff --git a/english/python-net/aspose.words/document/append_document/_index.md b/english/python-net/aspose.words/document/append_document/_index.md index bc4918330ef..b3545831579 100644 --- a/english/python-net/aspose.words/document/append_document/_index.md +++ b/english/python-net/aspose.words/document/append_document/_index.md @@ -105,8 +105,8 @@ dst_doc = aw.Document() builder = aw.DocumentBuilder(doc=dst_doc) builder.insert_break(aw.BreakType.PARAGRAPH_BREAK) dst_doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list = dst_doc.lists[0] -builder.list_format.list = list +doc_list = dst_doc.lists[0] +builder.list_format.list = doc_list i = 1 while i <= 15: builder.write(f'List Item {i}\n') diff --git a/english/python-net/aspose.words/document/cleanup/_index.md b/english/python-net/aspose.words/document/cleanup/_index.md index bec187c4c6a..7c43fa56393 100644 --- a/english/python-net/aspose.words/document/cleanup/_index.md +++ b/english/python-net/aspose.words/document/cleanup/_index.md @@ -52,8 +52,8 @@ self.assertEqual(8, doc.styles.count) builder = aw.DocumentBuilder(doc=doc) builder.font.style = doc.styles.get_by_name('MyParagraphStyle1') builder.writeln('Hello world!') -list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) -builder.list_format.list = list +doc_list = doc.lists.add(list_style=doc.styles.get_by_name('MyListStyle1')) +builder.list_format.list = doc_list builder.writeln('Item 1') builder.writeln('Item 2') # Now, there is one unused character style and one unused list style. diff --git a/english/python-net/aspose.words/document/extract_pages/_index.md b/english/python-net/aspose.words/document/extract_pages/_index.md index 95ab241d586..9f2dd4899f9 100644 --- a/english/python-net/aspose.words/document/extract_pages/_index.md +++ b/english/python-net/aspose.words/document/extract_pages/_index.md @@ -3,12 +3,38 @@ title: Document.extract_pages method linktitle: extract_pages method articleTitle: extract_pages method second_title: Aspose.Words for Python -description: "Document.extract_pages method. Returns the [Document](../) object representing specified range of pages." +description: "aspose.words.Document.extract_pages method" type: docs weight: 640 url: /python-net/aspose.words/document/extract_pages/ --- +## extract_pages(index, count, options) {#int_int_pageextractoptions} + +Returns the [Document](../) object representing the specified range of pages and the given page extract options. + + + +```python +def extract_pages(self, index: int, count: int, options: aspose.words.PageExtractOptions): + ... +``` + +| Parameter | Type | Description | +| --- | --- | --- | +| index | int | The zero-based index of the first page to extract. | +| count | int | Number of pages to be extracted. | +| options | [PageExtractOptions](../../pageextractoptions/) | Provides options for managing the page extracting process. | + +### Remarks + +The resulting document should look like the one in MS Word, as if we had performed 'Print specific pages' – the numbering, +headers/footers and cross tables layout will be preserved. +But due to a large number of nuances, appearing while reducing the number of pages, full match of the layout is a quiet complicated task requiring a lot of effort. +Depending on the document complexity there might be slight differences in the resulting document contents layout comparing to the source document. +Any feedback would be greatly appreciated. + + ## extract_pages(index, count) {#int_int} Returns the [Document](../) object representing specified range of pages. @@ -34,17 +60,39 @@ Depending on the document complexity there might be slight differences in the re Any feedback would be greatly appreciated. -### Examples +## Examples Shows how to get specified range of pages from the document. ```python doc = aw.Document(file_name=MY_DIR + 'Layout entities.docx') -doc = doc.extract_pages(0, 2) +doc = doc.extract_pages(index=0, count=2) doc.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPages.docx') ``` -### See Also +Show how to reset the initial page numbering and save the NUMPAGE field. + +```python +doc = aw.Document(file_name=MY_DIR + 'Page fields.docx') +# Default behavior: +# The extracted page numbering is the same as in the original document, as if we had selected "Print 2 pages" in MS Word. +# The start page will be set to 2 and the field indicating the number of pages will be removed +# and replaced with a constant value equal to the number of pages. +extracted_doc1 = doc.extract_pages(index=1, count=1) +extracted_doc1.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Default.docx') +# Altered behavior: +# The extracted page numbering is reset and a new one begins, +# as if we had copied the contents of the second page and pasted it into a new document. +# The start page will be set to 1 and the field indicating the number of pages will be left unchanged +# and will show the current number of pages. +extract_options = aw.PageExtractOptions() +extract_options.update_page_starting_number = False +extract_options.unlink_pages_number_fields = False +extracted_doc2 = doc.extract_pages(index=1, count=1, options=extract_options) +extracted_doc2.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Options.docx') +``` + +## See Also * module [aspose.words](../../) * class [Document](../) diff --git a/english/python-net/aspose.words/document/variables/_index.md b/english/python-net/aspose.words/document/variables/_index.md index a2b970cba28..5afa742dc4d 100644 --- a/english/python-net/aspose.words/document/variables/_index.md +++ b/english/python-net/aspose.words/document/variables/_index.md @@ -21,53 +21,6 @@ def variables(self) -> aspose.words.VariableCollection: ``` -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/documentbase/warning_callback/_index.md b/english/python-net/aspose.words/documentbase/warning_callback/_index.md index f60d9168602..63d63e12381 100644 --- a/english/python-net/aspose.words/documentbase/warning_callback/_index.md +++ b/english/python-net/aspose.words/documentbase/warning_callback/_index.md @@ -35,6 +35,30 @@ warning callback is specified just for the rendering calls later. +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/imagewatermarkoptions/is_washout/_index.md b/english/python-net/aspose.words/imagewatermarkoptions/is_washout/_index.md index d75dd0aa790..c41e0cdf992 100644 --- a/english/python-net/aspose.words/imagewatermarkoptions/is_washout/_index.md +++ b/english/python-net/aspose.words/imagewatermarkoptions/is_washout/_index.md @@ -27,21 +27,6 @@ def is_washout(self, value: bool): ``` -### Examples - -Shows how to create a watermark from an image in the local file system. - -```python -doc = aw.Document() -# Modify the image watermark's appearance with an ImageWatermarkOptions object, -# then pass it while creating a watermark from an image file. -image_watermark_options = aw.ImageWatermarkOptions() -image_watermark_options.scale = 5 -image_watermark_options.is_washout = False -doc.watermark.set_image(drawing.Image.from_file(IMAGE_DIR + 'Logo.jpg'), image_watermark_options) -doc.save(ARTIFACTS_DIR + 'Document.image_watermark.docx') -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/imagewatermarkoptions/scale/_index.md b/english/python-net/aspose.words/imagewatermarkoptions/scale/_index.md index 5e9bc0395f0..ca1d470b51f 100644 --- a/english/python-net/aspose.words/imagewatermarkoptions/scale/_index.md +++ b/english/python-net/aspose.words/imagewatermarkoptions/scale/_index.md @@ -41,21 +41,6 @@ the page margins. -### Examples - -Shows how to create a watermark from an image in the local file system. - -```python -doc = aw.Document() -# Modify the image watermark's appearance with an ImageWatermarkOptions object, -# then pass it while creating a watermark from an image file. -image_watermark_options = aw.ImageWatermarkOptions() -image_watermark_options.scale = 5 -image_watermark_options.is_washout = False -doc.watermark.set_image(drawing.Image.from_file(IMAGE_DIR + 'Logo.jpg'), image_watermark_options) -doc.save(ARTIFACTS_DIR + 'Document.image_watermark.docx') -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/iwarningcallback/_index.md b/english/python-net/aspose.words/iwarningcallback/_index.md index 455b16c4771..04c93ef8472 100644 --- a/english/python-net/aspose.words/iwarningcallback/_index.md +++ b/english/python-net/aspose.words/iwarningcallback/_index.md @@ -21,6 +21,30 @@ capture loss of fidelity warnings that can occur during document loading or savi | --- | --- | |[ warning(info)](./warning/#warninginfo) | Aspose.Words invokes this method when it encounters some issue during document loading or saving that might result in loss of formatting or data fidelity. | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../) diff --git a/english/python-net/aspose.words/iwarningcallback/warning/_index.md b/english/python-net/aspose.words/iwarningcallback/warning/_index.md index d09b44cbe09..345216c649b 100644 --- a/english/python-net/aspose.words/iwarningcallback/warning/_index.md +++ b/english/python-net/aspose.words/iwarningcallback/warning/_index.md @@ -24,6 +24,30 @@ def warning(self, info: aspose.words.WarningInfo): | --- | --- | --- | | info | [WarningInfo](../../warninginfo/) | | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/nodelist/__getitem__/_index.md b/english/python-net/aspose.words/nodelist/__getitem__/_index.md index 9f72b824c53..4a5b25d6a23 100644 --- a/english/python-net/aspose.words/nodelist/__getitem__/_index.md +++ b/english/python-net/aspose.words/nodelist/__getitem__/_index.md @@ -37,44 +37,6 @@ If index is negative and its absolute value is greater than the number of items -### Examples - -Shows how to use XPaths to navigate a NodeList. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc=doc) -# Insert some nodes with a DocumentBuilder. -builder.writeln('Hello world!') -builder.start_table() -builder.insert_cell() -builder.write('Cell 1') -builder.insert_cell() -builder.write('Cell 2') -builder.end_table() -builder.insert_image(file_name=IMAGE_DIR + 'Logo.jpg') -# Our document contains three Run nodes. -node_list = doc.select_nodes('//Run') -self.assertEqual(3, node_list.count) -self.assertTrue(any([n.get_text().strip() == 'Hello world!' for n in node_list])) -self.assertTrue(any([n.get_text().strip() == 'Cell 1' for n in node_list])) -self.assertTrue(any([n.get_text().strip() == 'Cell 2' for n in node_list])) -# Use a double forward slash to select all Run nodes -# that are indirect descendants of a Table node, which would be the runs inside the two cells we inserted. -node_list = doc.select_nodes('//Table//Run') -self.assertEqual(2, node_list.count) -self.assertTrue(any([n.get_text().strip() == 'Cell 1' for n in node_list])) -self.assertTrue(any([n.get_text().strip() == 'Cell 2' for n in node_list])) -# Single forward slashes specify direct descendant relationships, -# which we skipped when we used double slashes. -self.assertEqual(doc.select_nodes('//Table//Run'), doc.select_nodes('//Table/Row/Cell/Paragraph/Run')) -# Access the shape that contains the image we inserted. -node_list = doc.select_nodes('//Shape') -self.assertEqual(1, node_list.count) -shape = node_list[0].as_shape() -self.assertTrue(shape.has_image) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/nodelist/_index.md b/english/python-net/aspose.words/nodelist/_index.md index 69f23fce699..ad3971f6993 100644 --- a/english/python-net/aspose.words/nodelist/_index.md +++ b/english/python-net/aspose.words/nodelist/_index.md @@ -52,182 +52,6 @@ of nodes matching the XPath query. | --- | --- | |[ to_array()](./to_array/#default) | Copies all nodes from the collection to a new array of nodes. | -### Examples - -Shows how to find all hyperlinks in a Word document, and then change their URLs and display names. - -```python -class ExReplaceHyperlinks(ApiExampleBase): - - def test_fields(self): - - doc = aw.Document(MY_DIR + "Hyperlinks.docx") - - # Hyperlinks in a Word documents are fields. To begin looking for hyperlinks, we must first find all the fields. - # Use the "select_nodes" method to find all the fields in the document via an XPath. - field_starts = doc.select_nodes("//FieldStart") - - for field_start in field_starts: - field_start = field_start.as_field_start() - - if field_start.field_type == aw.fields.FieldType.FIELD_HYPERLINK: - hyperlink = Hyperlink(field_start) - - # Hyperlinks that link to bookmarks do not have URLs. - if hyperlink.is_local: - continue - - # Give each URL hyperlink a new URL and name. - hyperlink.target = "http://www.aspose.com" - hyperlink.name = "Aspose - The .NET & Java Component Publisher" - - doc.save(ARTIFACTS_DIR + "ReplaceHyperlinks.fields.docx") - - -class Hyperlink: - """HYPERLINK fields contain and display hyperlinks in the document body. A field in Aspose.Words - consists of several nodes, and it might be difficult to work with all those nodes directly. - This implementation will work only if the hyperlink code and name each consist of only one Run node. - - The node structure for fields is as follows: - - [FieldStart][Run - field code][FieldSeparator][Run - field result][FieldEnd] - - Below are two example field codes of HYPERLINK fields: - HYPERLINK "url" - HYPERLINK \\l "bookmark name" - - A field's "result" property contains text that the field displays in the document body to the user.""" - def __init__(self, field_start: aw.fields.FieldStart): - - if field_start is None: - raise ValueError("field_start") - if field_start.field_type != aw.fields.FieldType.FIELD_HYPERLINK: - raise ValueError("Field start type must be FieldHyperlink.") - - self.field_start = field_start - - # Find the field separator node. - self.field_separator = Hyperlink.find_next_sibling(self.field_start, aw.NodeType.FIELD_SEPARATOR) - if self.field_separator is None: - raise Exception("Cannot find field separator.") - - # Normally, we can always find the field's end node, but the example document - # contains a paragraph break inside a hyperlink, which puts the field end - # in the next paragraph. It will be much more complicated to handle fields which span several - # paragraphs correctly. In this case allowing field end to be null is enough. - self.field_end = Hyperlink.find_next_sibling(self.field_separator, aw.NodeType.FIELD_END) - - # Field code looks something like "HYPERLINK "http:\\www.myurl.com"", but it can consist of several runs. - field_code = Hyperlink.get_text_same_parent(self.field_start.next_sibling, self.field_separator) - - pattern = r""" - \S+ # One or more non spaces HYPERLINK or other word in other languages. - \s+ # One or more spaces. - (?:""\s+)? # Non-capturing optional "" and one or more spaces. - (\\l\s+)? # Optional \l flag followed by one or more spaces. - " # One apostrophe. - ([^"]+) # One or more characters, excluding the apostrophe (hyperlink target). - " # One closing apostrophe. - """ - - match = re.match(pattern, field_code.strip(), re.VERBOSE) - - # The hyperlink is local if \l is present in the field code. - self._is_local = len(match.group(2)) > 0 - self._target = match.groups(3) - - @property - def name(self) -> str: - """Gets the display name of the hyperlink.""" - return Hyperlink.GetTextSameParent(self.field_separator, self.field_end) - - @name.setter - def name(self, value: str): - """Sets the display name of the hyperlink.""" - - # Hyperlink display name is stored in the field result, which is a Run - # node between field separator and field end. - field_result = self.field_separator.next_sibling.as_run() - field_result.text = value - - # If the field result consists of more than one run, delete these runs. - Hyperlink.remove_same_parent(field_result.next_sibling, self.field_end) - - @property - def target(self) -> str: - """Gets the target URL or bookmark name of the hyperlink.""" - return self._target - - @target.setter - def target(self, value: str) -> str: - """Sets the target URL or bookmark name of the hyperlink.""" - self._target = value - self.update_field_code() - - @property - def is_local(self) -> bool: - """True if the hyperlinks target is a bookmark inside the document. False if the hyperlink is a URL.""" - return self._is_local - - @is_local.setter - def is_local(self, value: bool): - self._is_local = value - self.update_field_code() - - def update_field_code(self): - - # A field's field code is in a Run node between the field's start node and field separator. - field_code = self.field_start.next_sibling.as_run() - field_code.text = 'HYPERLINK {0}"{1}"'.format( - "\\l " if self.is_local else "", self.target) - - # If the field code consists of more than one run, delete these runs. - Hyperlink.remove_same_parent(field_code.next_sibling, self.field_separator) - - @staticmethod - def find_next_sibling(start_node: aw.Node, node_type: aw.NodeType) -> aw.Node: - """Goes through siblings starting from the start node until it finds a node of the specified type or None.""" - - node = start_node - while node is not None: - if node.node_type == node_type: - return node - - node = node.next_sibling - - return None - - @staticmethod - def get_text_same_parent(start_node: aw.Node, end_node: aw.Node) -> str: - """Retrieves text from start up to but not including the end node.""" - - if end_node is not None and start_node.parent_node != end_node.parent_node: - raise ValueError("Start and end nodes are expected to have the same parent.") - - text = '' - child = start_node - while child != end_node: - text += child.get_text() - child = child.next_sibling - - return text - - @staticmethod - def remove_same_parent(start_node: aw.Node, end_node: aw.Node): - """Removes nodes from start up to but not including the end node. - Assumes that the start and end nodes have the same parent.""" - - if end_node is not None and start_node.parent_node != end_node.parent_node: - raise ValueError("Start and end nodes are expected to have the same parent.") - - cur_child = start_node - while cur_child is not None and cur_child != end_node: - next_child = cur_child.next_sibling - cur_child.remove() - cur_child = next_child -``` - ### See Also * module [aspose.words](../) diff --git a/english/python-net/aspose.words/nodelist/count/_index.md b/english/python-net/aspose.words/nodelist/count/_index.md index 2360363989b..e795c6d40f4 100644 --- a/english/python-net/aspose.words/nodelist/count/_index.md +++ b/english/python-net/aspose.words/nodelist/count/_index.md @@ -21,44 +21,6 @@ def count(self) -> int: ``` -### Examples - -Shows how to use XPaths to navigate a NodeList. - -```python -doc = aw.Document() -builder = aw.DocumentBuilder(doc=doc) -# Insert some nodes with a DocumentBuilder. -builder.writeln('Hello world!') -builder.start_table() -builder.insert_cell() -builder.write('Cell 1') -builder.insert_cell() -builder.write('Cell 2') -builder.end_table() -builder.insert_image(file_name=IMAGE_DIR + 'Logo.jpg') -# Our document contains three Run nodes. -node_list = doc.select_nodes('//Run') -self.assertEqual(3, node_list.count) -self.assertTrue(any([n.get_text().strip() == 'Hello world!' for n in node_list])) -self.assertTrue(any([n.get_text().strip() == 'Cell 1' for n in node_list])) -self.assertTrue(any([n.get_text().strip() == 'Cell 2' for n in node_list])) -# Use a double forward slash to select all Run nodes -# that are indirect descendants of a Table node, which would be the runs inside the two cells we inserted. -node_list = doc.select_nodes('//Table//Run') -self.assertEqual(2, node_list.count) -self.assertTrue(any([n.get_text().strip() == 'Cell 1' for n in node_list])) -self.assertTrue(any([n.get_text().strip() == 'Cell 2' for n in node_list])) -# Single forward slashes specify direct descendant relationships, -# which we skipped when we used double slashes. -self.assertEqual(doc.select_nodes('//Table//Run'), doc.select_nodes('//Table/Row/Cell/Paragraph/Run')) -# Access the shape that contains the image we inserted. -node_list = doc.select_nodes('//Shape') -self.assertEqual(1, node_list.count) -shape = node_list[0].as_shape() -self.assertTrue(shape.has_image) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/numberstyle/_index.md b/english/python-net/aspose.words/numberstyle/_index.md index 7a12b5c133b..95ec50edee5 100644 --- a/english/python-net/aspose.words/numberstyle/_index.md +++ b/english/python-net/aspose.words/numberstyle/_index.md @@ -92,8 +92,8 @@ doc = aw.Document() # We can begin and end a list by using a document builder's "ListFormat" property. # Each paragraph that we add between a list's start and the end will become an item in the list. # Create a list from a Microsoft Word template, and customize the first two of its list levels. -list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) -list_level = list.list_levels[0] +doc_list = doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT) +list_level = doc_list.list_levels[0] list_level.font.color = aspose.pydrawing.Color.red list_level.font.size = 24 list_level.number_style = aw.NumberStyle.ORDINAL_TEXT @@ -102,7 +102,7 @@ list_level.number_format = '\x00' list_level.number_position = -36 list_level.text_position = 144 list_level.tab_position = 144 -list_level = list.list_levels[1] +list_level = doc_list.list_levels[1] list_level.alignment = aw.lists.ListLevelAlignment.RIGHT list_level.number_style = aw.NumberStyle.BULLET list_level.font.name = 'Wingdings' @@ -114,7 +114,7 @@ list_level.trailing_character = aw.lists.ListTrailingCharacter.SPACE list_level.number_position = 144 # Create paragraphs and apply both list levels of our custom list formatting to them. builder = aw.DocumentBuilder(doc=doc) -builder.list_format.list = list +builder.list_format.list = doc_list builder.writeln('The quick brown fox...') builder.writeln('The quick brown fox...') builder.list_format.list_indent() diff --git a/english/python-net/aspose.words/pageextractoptions/__init__/_index.md b/english/python-net/aspose.words/pageextractoptions/__init__/_index.md new file mode 100644 index 00000000000..5b98bd73258 --- /dev/null +++ b/english/python-net/aspose.words/pageextractoptions/__init__/_index.md @@ -0,0 +1,23 @@ +--- +title: PageExtractOptions constructor +linktitle: PageExtractOptions constructor +articleTitle: PageExtractOptions constructor +second_title: Aspose.Words for Python +description: "PageExtractOptions constructor. " +type: docs +weight: 10 +url: /python-net/aspose.words/pageextractoptions/__init__/ +--- + +## PageExtractOptions() {#default} + +```python +def __init__(self): + ... +``` + +### See Also + +* module [aspose.words](../../) +* class [PageExtractOptions](../) + diff --git a/english/python-net/aspose.words/pageextractoptions/_index.md b/english/python-net/aspose.words/pageextractoptions/_index.md new file mode 100644 index 00000000000..d6adbed4dc3 --- /dev/null +++ b/english/python-net/aspose.words/pageextractoptions/_index.md @@ -0,0 +1,56 @@ +--- +title: PageExtractOptions class +linktitle: PageExtractOptions class +articleTitle: PageExtractOptions class +second_title: Aspose.Words for Python +description: "aspose.words.PageExtractOptions class. Allows to specify options for document page extracting." +type: docs +weight: 870 +url: /python-net/aspose.words/pageextractoptions/ +--- + +## PageExtractOptions class + +Allows to specify options for document page extracting. + + +### Constructors +| Name | Description | +| --- | --- | +| [PageExtractOptions()](./__init__/#default) | The default constructor. | + +### Properties + +| Name | Description | +| --- | --- | +| [unlink_pages_number_fields](./unlink_pages_number_fields/) | Specifies whether NUMPAGES fields in the resulting document will be replaced with their actual resulting values. Default value is ``True``. | +| [update_page_starting_number](./update_page_starting_number/) | Specifies whether the start page number in the resulting document shall be updated. Default value is ``True``. | + +### Examples + +Show how to reset the initial page numbering and save the NUMPAGE field. + +```python +doc = aw.Document(file_name=MY_DIR + 'Page fields.docx') +# Default behavior: +# The extracted page numbering is the same as in the original document, as if we had selected "Print 2 pages" in MS Word. +# The start page will be set to 2 and the field indicating the number of pages will be removed +# and replaced with a constant value equal to the number of pages. +extracted_doc1 = doc.extract_pages(index=1, count=1) +extracted_doc1.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Default.docx') +# Altered behavior: +# The extracted page numbering is reset and a new one begins, +# as if we had copied the contents of the second page and pasted it into a new document. +# The start page will be set to 1 and the field indicating the number of pages will be left unchanged +# and will show the current number of pages. +extract_options = aw.PageExtractOptions() +extract_options.update_page_starting_number = False +extract_options.unlink_pages_number_fields = False +extracted_doc2 = doc.extract_pages(index=1, count=1, options=extract_options) +extracted_doc2.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Options.docx') +``` + +### See Also + +* module [aspose.words](../) + diff --git a/english/python-net/aspose.words/pageextractoptions/unlink_pages_number_fields/_index.md b/english/python-net/aspose.words/pageextractoptions/unlink_pages_number_fields/_index.md new file mode 100644 index 00000000000..ae24bb1091f --- /dev/null +++ b/english/python-net/aspose.words/pageextractoptions/unlink_pages_number_fields/_index.md @@ -0,0 +1,58 @@ +--- +title: PageExtractOptions.unlink_pages_number_fields property +linktitle: unlink_pages_number_fields property +articleTitle: unlink_pages_number_fields property +second_title: Aspose.Words for Python +description: "PageExtractOptions.unlink_pages_number_fields property. Specifies whether NUMPAGES fields in the resulting document will be replaced with their actual resulting values" +type: docs +weight: 20 +url: /python-net/aspose.words/pageextractoptions/unlink_pages_number_fields/ +--- + +## PageExtractOptions.unlink_pages_number_fields property + +Specifies whether NUMPAGES fields in the resulting document will be replaced with their actual resulting values. +Default value is ``True``. + + + +```python +@property +def unlink_pages_number_fields(self) -> bool: + ... + +@unlink_pages_number_fields.setter +def unlink_pages_number_fields(self, value: bool): + ... + +``` + +### Examples + +Show how to reset the initial page numbering and save the NUMPAGE field. + +```python +doc = aw.Document(file_name=MY_DIR + 'Page fields.docx') +# Default behavior: +# The extracted page numbering is the same as in the original document, as if we had selected "Print 2 pages" in MS Word. +# The start page will be set to 2 and the field indicating the number of pages will be removed +# and replaced with a constant value equal to the number of pages. +extracted_doc1 = doc.extract_pages(index=1, count=1) +extracted_doc1.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Default.docx') +# Altered behavior: +# The extracted page numbering is reset and a new one begins, +# as if we had copied the contents of the second page and pasted it into a new document. +# The start page will be set to 1 and the field indicating the number of pages will be left unchanged +# and will show the current number of pages. +extract_options = aw.PageExtractOptions() +extract_options.update_page_starting_number = False +extract_options.unlink_pages_number_fields = False +extracted_doc2 = doc.extract_pages(index=1, count=1, options=extract_options) +extracted_doc2.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Options.docx') +``` + +### See Also + +* module [aspose.words](../../) +* class [PageExtractOptions](../) + diff --git a/english/python-net/aspose.words/pageextractoptions/update_page_starting_number/_index.md b/english/python-net/aspose.words/pageextractoptions/update_page_starting_number/_index.md new file mode 100644 index 00000000000..2f7b7ca862b --- /dev/null +++ b/english/python-net/aspose.words/pageextractoptions/update_page_starting_number/_index.md @@ -0,0 +1,58 @@ +--- +title: PageExtractOptions.update_page_starting_number property +linktitle: update_page_starting_number property +articleTitle: update_page_starting_number property +second_title: Aspose.Words for Python +description: "PageExtractOptions.update_page_starting_number property. Specifies whether the start page number in the resulting document shall be updated" +type: docs +weight: 30 +url: /python-net/aspose.words/pageextractoptions/update_page_starting_number/ +--- + +## PageExtractOptions.update_page_starting_number property + +Specifies whether the start page number in the resulting document shall be updated. +Default value is ``True``. + + + +```python +@property +def update_page_starting_number(self) -> bool: + ... + +@update_page_starting_number.setter +def update_page_starting_number(self, value: bool): + ... + +``` + +### Examples + +Show how to reset the initial page numbering and save the NUMPAGE field. + +```python +doc = aw.Document(file_name=MY_DIR + 'Page fields.docx') +# Default behavior: +# The extracted page numbering is the same as in the original document, as if we had selected "Print 2 pages" in MS Word. +# The start page will be set to 2 and the field indicating the number of pages will be removed +# and replaced with a constant value equal to the number of pages. +extracted_doc1 = doc.extract_pages(index=1, count=1) +extracted_doc1.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Default.docx') +# Altered behavior: +# The extracted page numbering is reset and a new one begins, +# as if we had copied the contents of the second page and pasted it into a new document. +# The start page will be set to 1 and the field indicating the number of pages will be left unchanged +# and will show the current number of pages. +extract_options = aw.PageExtractOptions() +extract_options.update_page_starting_number = False +extract_options.unlink_pages_number_fields = False +extracted_doc2 = doc.extract_pages(index=1, count=1, options=extract_options) +extracted_doc2.save(file_name=ARTIFACTS_DIR + 'Document.ExtractPagesWithOptions.Options.docx') +``` + +### See Also + +* module [aspose.words](../../) +* class [PageExtractOptions](../) + diff --git a/english/python-net/aspose.words/pagesetup/_index.md b/english/python-net/aspose.words/pagesetup/_index.md index 175e5743cb2..a455b3387c3 100644 --- a/english/python-net/aspose.words/pagesetup/_index.md +++ b/english/python-net/aspose.words/pagesetup/_index.md @@ -5,7 +5,7 @@ articleTitle: PageSetup class second_title: Aspose.Words for Python description: "aspose.words.PageSetup class. Represents the page setup properties of a section" type: docs -weight: 870 +weight: 880 url: /python-net/aspose.words/pagesetup/ --- diff --git a/english/python-net/aspose.words/pagesetup/text_columns/_index.md b/english/python-net/aspose.words/pagesetup/text_columns/_index.md index 4782b9a045d..6d8178053f9 100644 --- a/english/python-net/aspose.words/pagesetup/text_columns/_index.md +++ b/english/python-net/aspose.words/pagesetup/text_columns/_index.md @@ -27,7 +27,7 @@ Shows how to create multiple evenly spaced columns in a section. ```python doc = aw.Document() -builder = aw.DocumentBuilder(doc) +builder = aw.DocumentBuilder(doc=doc) columns = builder.page_setup.text_columns columns.spacing = 100 columns.set_count(2) diff --git a/english/python-net/aspose.words/pageverticalalignment/_index.md b/english/python-net/aspose.words/pageverticalalignment/_index.md index fb8a5398340..bdec649629c 100644 --- a/english/python-net/aspose.words/pageverticalalignment/_index.md +++ b/english/python-net/aspose.words/pageverticalalignment/_index.md @@ -5,7 +5,7 @@ articleTitle: PageVerticalAlignment enumeration second_title: Aspose.Words for Python description: "aspose.words.PageVerticalAlignment enumeration. Specifies vertical justification of text on each page." type: docs -weight: 880 +weight: 890 url: /python-net/aspose.words/pageverticalalignment/ --- diff --git a/english/python-net/aspose.words/papersize/_index.md b/english/python-net/aspose.words/papersize/_index.md index 894ac66a360..2efda97aec9 100644 --- a/english/python-net/aspose.words/papersize/_index.md +++ b/english/python-net/aspose.words/papersize/_index.md @@ -5,7 +5,7 @@ articleTitle: PaperSize enumeration second_title: Aspose.Words for Python description: "aspose.words.PaperSize enumeration. Specifies paper size." type: docs -weight: 890 +weight: 900 url: /python-net/aspose.words/papersize/ --- diff --git a/english/python-net/aspose.words/paragraph/_index.md b/english/python-net/aspose.words/paragraph/_index.md index 3128a5567d2..3c70e84c9d0 100644 --- a/english/python-net/aspose.words/paragraph/_index.md +++ b/english/python-net/aspose.words/paragraph/_index.md @@ -5,7 +5,7 @@ articleTitle: Paragraph class second_title: Aspose.Words for Python description: "aspose.words.Paragraph class. Represents a paragraph of text" type: docs -weight: 900 +weight: 910 url: /python-net/aspose.words/paragraph/ --- diff --git a/english/python-net/aspose.words/paragraphalignment/_index.md b/english/python-net/aspose.words/paragraphalignment/_index.md index 19530261257..a4e8d666181 100644 --- a/english/python-net/aspose.words/paragraphalignment/_index.md +++ b/english/python-net/aspose.words/paragraphalignment/_index.md @@ -5,7 +5,7 @@ articleTitle: ParagraphAlignment enumeration second_title: Aspose.Words for Python description: "aspose.words.ParagraphAlignment enumeration. Specifies text alignment in a paragraph." type: docs -weight: 910 +weight: 920 url: /python-net/aspose.words/paragraphalignment/ --- diff --git a/english/python-net/aspose.words/paragraphcollection/_index.md b/english/python-net/aspose.words/paragraphcollection/_index.md index 90bb63dedac..63f9684b17e 100644 --- a/english/python-net/aspose.words/paragraphcollection/_index.md +++ b/english/python-net/aspose.words/paragraphcollection/_index.md @@ -5,7 +5,7 @@ articleTitle: ParagraphCollection class second_title: Aspose.Words for Python description: "aspose.words.ParagraphCollection class. Provides typed access to a collection of [Paragraph](../paragraph/) nodes" type: docs -weight: 920 +weight: 930 url: /python-net/aspose.words/paragraphcollection/ --- diff --git a/english/python-net/aspose.words/paragraphformat/_index.md b/english/python-net/aspose.words/paragraphformat/_index.md index 9766a5661d4..c5dcb2e3164 100644 --- a/english/python-net/aspose.words/paragraphformat/_index.md +++ b/english/python-net/aspose.words/paragraphformat/_index.md @@ -5,7 +5,7 @@ articleTitle: ParagraphFormat class second_title: Aspose.Words for Python description: "aspose.words.ParagraphFormat class. Represents all the formatting for a paragraph" type: docs -weight: 930 +weight: 940 url: /python-net/aspose.words/paragraphformat/ --- diff --git a/english/python-net/aspose.words/phoneticguide/_index.md b/english/python-net/aspose.words/phoneticguide/_index.md index 9b8aaf5a475..9014d5313d2 100644 --- a/english/python-net/aspose.words/phoneticguide/_index.md +++ b/english/python-net/aspose.words/phoneticguide/_index.md @@ -5,7 +5,7 @@ articleTitle: PhoneticGuide class second_title: Aspose.Words for Python description: "aspose.words.PhoneticGuide class. Represents Phonetic Guide." type: docs -weight: 940 +weight: 950 url: /python-net/aspose.words/phoneticguide/ --- diff --git a/english/python-net/aspose.words/plaintextdocument/_index.md b/english/python-net/aspose.words/plaintextdocument/_index.md index 1690eb6c250..9dc76cd9143 100644 --- a/english/python-net/aspose.words/plaintextdocument/_index.md +++ b/english/python-net/aspose.words/plaintextdocument/_index.md @@ -5,7 +5,7 @@ articleTitle: PlainTextDocument class second_title: Aspose.Words for Python description: "aspose.words.PlainTextDocument class. Allows to extract plain-text representation of the document's content" type: docs -weight: 950 +weight: 960 url: /python-net/aspose.words/plaintextdocument/ --- diff --git a/english/python-net/aspose.words/protectiontype/_index.md b/english/python-net/aspose.words/protectiontype/_index.md index cb7578ee867..4310be7d748 100644 --- a/english/python-net/aspose.words/protectiontype/_index.md +++ b/english/python-net/aspose.words/protectiontype/_index.md @@ -5,7 +5,7 @@ articleTitle: ProtectionType enumeration second_title: Aspose.Words for Python description: "aspose.words.ProtectionType enumeration. Protection type for a document." type: docs -weight: 960 +weight: 970 url: /python-net/aspose.words/protectiontype/ --- diff --git a/english/python-net/aspose.words/range/_index.md b/english/python-net/aspose.words/range/_index.md index 3d12e67ff83..6c23d390490 100644 --- a/english/python-net/aspose.words/range/_index.md +++ b/english/python-net/aspose.words/range/_index.md @@ -5,7 +5,7 @@ articleTitle: Range class second_title: Aspose.Words for Python description: "aspose.words.Range class. Represents a contiguous area in a document" type: docs -weight: 970 +weight: 980 url: /python-net/aspose.words/range/ --- diff --git a/english/python-net/aspose.words/revision/_index.md b/english/python-net/aspose.words/revision/_index.md index 80725956f95..d89e77be409 100644 --- a/english/python-net/aspose.words/revision/_index.md +++ b/english/python-net/aspose.words/revision/_index.md @@ -5,7 +5,7 @@ articleTitle: Revision class second_title: Aspose.Words for Python description: "aspose.words.Revision class. Represents a revision (tracked change) in a document node or style" type: docs -weight: 980 +weight: 990 url: /python-net/aspose.words/revision/ --- diff --git a/english/python-net/aspose.words/revisioncollection/_index.md b/english/python-net/aspose.words/revisioncollection/_index.md index bd33fd060a4..f37cb555366 100644 --- a/english/python-net/aspose.words/revisioncollection/_index.md +++ b/english/python-net/aspose.words/revisioncollection/_index.md @@ -5,7 +5,7 @@ articleTitle: RevisionCollection class second_title: Aspose.Words for Python description: "aspose.words.RevisionCollection class. A collection of [Revision](../revision/) objects that represent revisions in the document" type: docs -weight: 990 +weight: 1000 url: /python-net/aspose.words/revisioncollection/ --- diff --git a/english/python-net/aspose.words/revisiongroup/_index.md b/english/python-net/aspose.words/revisiongroup/_index.md index 7bfdbf6c029..0117dd0cd6d 100644 --- a/english/python-net/aspose.words/revisiongroup/_index.md +++ b/english/python-net/aspose.words/revisiongroup/_index.md @@ -5,7 +5,7 @@ articleTitle: RevisionGroup class second_title: Aspose.Words for Python description: "aspose.words.RevisionGroup class. Represents a group of sequential [Revision](../revision/) objects" type: docs -weight: 1000 +weight: 1010 url: /python-net/aspose.words/revisiongroup/ --- diff --git a/english/python-net/aspose.words/revisiongroupcollection/_index.md b/english/python-net/aspose.words/revisiongroupcollection/_index.md index 89e161ea0f8..b784bb1172f 100644 --- a/english/python-net/aspose.words/revisiongroupcollection/_index.md +++ b/english/python-net/aspose.words/revisiongroupcollection/_index.md @@ -5,7 +5,7 @@ articleTitle: RevisionGroupCollection class second_title: Aspose.Words for Python description: "aspose.words.RevisionGroupCollection class. A collection of [RevisionGroup](../revisiongroup/) objects that represent revision groups in the document" type: docs -weight: 1010 +weight: 1020 url: /python-net/aspose.words/revisiongroupcollection/ --- diff --git a/english/python-net/aspose.words/revisionsview/_index.md b/english/python-net/aspose.words/revisionsview/_index.md index a55048924bb..bc1bccabe01 100644 --- a/english/python-net/aspose.words/revisionsview/_index.md +++ b/english/python-net/aspose.words/revisionsview/_index.md @@ -5,7 +5,7 @@ articleTitle: RevisionsView enumeration second_title: Aspose.Words for Python description: "aspose.words.RevisionsView enumeration. Allows to specify whether to work with the original or revised version of a document." type: docs -weight: 1030 +weight: 1040 url: /python-net/aspose.words/revisionsview/ --- diff --git a/english/python-net/aspose.words/revisiontype/_index.md b/english/python-net/aspose.words/revisiontype/_index.md index bcf988d98e1..088519bb6bb 100644 --- a/english/python-net/aspose.words/revisiontype/_index.md +++ b/english/python-net/aspose.words/revisiontype/_index.md @@ -5,7 +5,7 @@ articleTitle: RevisionType enumeration second_title: Aspose.Words for Python description: "aspose.words.RevisionType enumeration. Specifies the type of change being tracked in [Revision](../revision/)." type: docs -weight: 1020 +weight: 1030 url: /python-net/aspose.words/revisiontype/ --- diff --git a/english/python-net/aspose.words/run/_index.md b/english/python-net/aspose.words/run/_index.md index 0ec80a6a202..8c811024790 100644 --- a/english/python-net/aspose.words/run/_index.md +++ b/english/python-net/aspose.words/run/_index.md @@ -5,7 +5,7 @@ articleTitle: Run class second_title: Aspose.Words for Python description: "aspose.words.Run class. Represents a run of characters with the same font formatting" type: docs -weight: 1040 +weight: 1050 url: /python-net/aspose.words/run/ --- diff --git a/english/python-net/aspose.words/runcollection/_index.md b/english/python-net/aspose.words/runcollection/_index.md index 892e2eee075..4629f550475 100644 --- a/english/python-net/aspose.words/runcollection/_index.md +++ b/english/python-net/aspose.words/runcollection/_index.md @@ -5,7 +5,7 @@ articleTitle: RunCollection class second_title: Aspose.Words for Python description: "aspose.words.RunCollection class. Provides typed access to a collection of [Run](../run/) nodes" type: docs -weight: 1050 +weight: 1060 url: /python-net/aspose.words/runcollection/ --- diff --git a/english/python-net/aspose.words/saveformat/_index.md b/english/python-net/aspose.words/saveformat/_index.md index bb90bb0d1dd..01484622931 100644 --- a/english/python-net/aspose.words/saveformat/_index.md +++ b/english/python-net/aspose.words/saveformat/_index.md @@ -5,7 +5,7 @@ articleTitle: SaveFormat enumeration second_title: Aspose.Words for Python description: "aspose.words.SaveFormat enumeration. Indicates the format in which the document is saved." type: docs -weight: 1060 +weight: 1070 url: /python-net/aspose.words/saveformat/ --- diff --git a/english/python-net/aspose.words/section/_index.md b/english/python-net/aspose.words/section/_index.md index ae91724286a..60fc51381ad 100644 --- a/english/python-net/aspose.words/section/_index.md +++ b/english/python-net/aspose.words/section/_index.md @@ -5,7 +5,7 @@ articleTitle: Section class second_title: Aspose.Words for Python description: "aspose.words.Section class. Represents a single section in a document" type: docs -weight: 1070 +weight: 1080 url: /python-net/aspose.words/section/ --- diff --git a/english/python-net/aspose.words/sectioncollection/_index.md b/english/python-net/aspose.words/sectioncollection/_index.md index 904e1b5dd63..9ffeda43e13 100644 --- a/english/python-net/aspose.words/sectioncollection/_index.md +++ b/english/python-net/aspose.words/sectioncollection/_index.md @@ -5,7 +5,7 @@ articleTitle: SectionCollection class second_title: Aspose.Words for Python description: "aspose.words.SectionCollection class. A collection of [Section](../section/) objects in the document" type: docs -weight: 1080 +weight: 1090 url: /python-net/aspose.words/sectioncollection/ --- diff --git a/english/python-net/aspose.words/sectionlayoutmode/_index.md b/english/python-net/aspose.words/sectionlayoutmode/_index.md index 4696848f506..d5169ed5fa5 100644 --- a/english/python-net/aspose.words/sectionlayoutmode/_index.md +++ b/english/python-net/aspose.words/sectionlayoutmode/_index.md @@ -5,7 +5,7 @@ articleTitle: SectionLayoutMode enumeration second_title: Aspose.Words for Python description: "aspose.words.SectionLayoutMode enumeration. Specifies the layout mode for a section allowing to define the document grid behavior." type: docs -weight: 1090 +weight: 1100 url: /python-net/aspose.words/sectionlayoutmode/ --- diff --git a/english/python-net/aspose.words/sectionstart/_index.md b/english/python-net/aspose.words/sectionstart/_index.md index 1a3a0057ef8..54e060bf072 100644 --- a/english/python-net/aspose.words/sectionstart/_index.md +++ b/english/python-net/aspose.words/sectionstart/_index.md @@ -5,7 +5,7 @@ articleTitle: SectionStart enumeration second_title: Aspose.Words for Python description: "aspose.words.SectionStart enumeration. The type of break at the beginning of the section." type: docs -weight: 1100 +weight: 1110 url: /python-net/aspose.words/sectionstart/ --- diff --git a/english/python-net/aspose.words/shading/_index.md b/english/python-net/aspose.words/shading/_index.md index fe60795c403..00baf8043df 100644 --- a/english/python-net/aspose.words/shading/_index.md +++ b/english/python-net/aspose.words/shading/_index.md @@ -5,7 +5,7 @@ articleTitle: Shading class second_title: Aspose.Words for Python description: "aspose.words.Shading class. Contains shading attributes for an object" type: docs -weight: 1110 +weight: 1120 url: /python-net/aspose.words/shading/ --- diff --git a/english/python-net/aspose.words/signaturelineoptions/_index.md b/english/python-net/aspose.words/signaturelineoptions/_index.md index 63ac67d23a4..4cf1203e97c 100644 --- a/english/python-net/aspose.words/signaturelineoptions/_index.md +++ b/english/python-net/aspose.words/signaturelineoptions/_index.md @@ -5,7 +5,7 @@ articleTitle: SignatureLineOptions class second_title: Aspose.Words for Python description: "aspose.words.SignatureLineOptions class. Allows to specify options for signature line being inserted" type: docs -weight: 1120 +weight: 1130 url: /python-net/aspose.words/signaturelineoptions/ --- diff --git a/english/python-net/aspose.words/signaturelineoptions/signer/_index.md b/english/python-net/aspose.words/signaturelineoptions/signer/_index.md index 235689c198b..7039caf2b66 100644 --- a/english/python-net/aspose.words/signaturelineoptions/signer/_index.md +++ b/english/python-net/aspose.words/signaturelineoptions/signer/_index.md @@ -27,73 +27,6 @@ def signer(self, value: str): ``` -### Examples - -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/signaturelineoptions/signer_title/_index.md b/english/python-net/aspose.words/signaturelineoptions/signer_title/_index.md index dc6ca7afa3f..7edb18a71c4 100644 --- a/english/python-net/aspose.words/signaturelineoptions/signer_title/_index.md +++ b/english/python-net/aspose.words/signaturelineoptions/signer_title/_index.md @@ -27,73 +27,6 @@ def signer_title(self, value: str): ``` -### Examples - -Shows how to add a signature line to a document, and then sign it using a digital certificate. - -```python -def test_sign(self): - - signee_name = "Ron Williams" - src_document_path = MY_DIR + "Document.docx" - dst_document_path = ARTIFACTS_DIR + "SignDocumentCustom.sign.docx" - certificate_path = MY_DIR + "morzal.pfx" - certificate_password = "aw" - - for signee_info in self._create_signees(): - if signee_info.name == signee_name: - self._sign_document(src_document_path, dst_document_path, signee_info, certificate_path, - certificate_password) - break - else: - raise Exception("Signee does not exist.") - -def _sign_document(self, src_document_path: str, dst_document_path: str, - signee_info, certificate_path: str, certificate_password: str): - """Creates a copy of a source document signed using provided signee information and X509 certificate.""" - - document = aw.Document(src_document_path) - builder = aw.DocumentBuilder(document) - - # Configure and insert a signature line, an object in the document that will display a signature that we sign it with. - signature_line_options = aw.SignatureLineOptions() - signature_line_options.signer = signee_info.name - signature_line_options.signer_title = signee_info.position - - signature_line = builder.insert_signature_line(signature_line_options).signature_line - signature_line.id = signee_info.person_id - - # First, we will save an unsigned version of our document. - builder.document.save(dst_document_path) - - certificate_holder = aw.digitalsignatures.CertificateHolder.create(certificate_path, certificate_password) - - sign_options = aw.digitalsignatures.SignOptions() - sign_options.signature_line_id = signee_info.person_id - sign_options.signature_line_image = signee_info.image - - # Overwrite the unsigned document we saved above with a version signed using the certificate. - aw.digitalsignatures.DigitalSignatureUtil.sign(dst_document_path, dst_document_path, certificate_holder, - sign_options) - -class Signee: - - def __init__(self, guid: uuid.UUID, name: str, position: str, image: bytes): - self.person_id = guid - self.name = name - self.position = position - self.image = image - -def _create_signees(self): - - return [ - ExSignDocumentCustom.Signee(uuid.uuid4(), "Ron Williams", "Chief Executive Officer", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")), - ExSignDocumentCustom.Signee(uuid.uuid4(), "Stephen Morse", "Head of Compliance", - self.image_to_byte_array(IMAGE_DIR + "Logo.jpg")) - ] -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/specialchar/_index.md b/english/python-net/aspose.words/specialchar/_index.md index 43c6dd69832..6896e8e50b3 100644 --- a/english/python-net/aspose.words/specialchar/_index.md +++ b/english/python-net/aspose.words/specialchar/_index.md @@ -5,7 +5,7 @@ articleTitle: SpecialChar class second_title: Aspose.Words for Python description: "aspose.words.SpecialChar class. Base class for special characters in the document" type: docs -weight: 1130 +weight: 1140 url: /python-net/aspose.words/specialchar/ --- diff --git a/english/python-net/aspose.words/story/_index.md b/english/python-net/aspose.words/story/_index.md index 1b4556bc089..2321ce88d7c 100644 --- a/english/python-net/aspose.words/story/_index.md +++ b/english/python-net/aspose.words/story/_index.md @@ -5,7 +5,7 @@ articleTitle: Story class second_title: Aspose.Words for Python description: "aspose.words.Story class. Base class for elements that contain block-level nodes [Paragraph](../paragraph/) and [Table](../../aspose.words.tables/table/)" type: docs -weight: 1140 +weight: 1150 url: /python-net/aspose.words/story/ --- diff --git a/english/python-net/aspose.words/storytype/_index.md b/english/python-net/aspose.words/storytype/_index.md index 3a69e1cb046..840f4349330 100644 --- a/english/python-net/aspose.words/storytype/_index.md +++ b/english/python-net/aspose.words/storytype/_index.md @@ -5,7 +5,7 @@ articleTitle: StoryType enumeration second_title: Aspose.Words for Python description: "aspose.words.StoryType enumeration. Text of a Word document is stored in stories" type: docs -weight: 1150 +weight: 1160 url: /python-net/aspose.words/storytype/ --- diff --git a/english/python-net/aspose.words/style/_index.md b/english/python-net/aspose.words/style/_index.md index dbd4c0c2996..45cfbb1ff71 100644 --- a/english/python-net/aspose.words/style/_index.md +++ b/english/python-net/aspose.words/style/_index.md @@ -5,7 +5,7 @@ articleTitle: Style class second_title: Aspose.Words for Python description: "aspose.words.Style class. Represents a single built-in or user-defined style" type: docs -weight: 1160 +weight: 1170 url: /python-net/aspose.words/style/ --- diff --git a/english/python-net/aspose.words/stylecollection/_index.md b/english/python-net/aspose.words/stylecollection/_index.md index 9d57e790f55..f60172a28ad 100644 --- a/english/python-net/aspose.words/stylecollection/_index.md +++ b/english/python-net/aspose.words/stylecollection/_index.md @@ -5,7 +5,7 @@ articleTitle: StyleCollection class second_title: Aspose.Words for Python description: "aspose.words.StyleCollection class. A collection of [Style](../style/) objects that represent both the built-in and user-defined styles in a document" type: docs -weight: 1170 +weight: 1180 url: /python-net/aspose.words/stylecollection/ --- diff --git a/english/python-net/aspose.words/styleidentifier/_index.md b/english/python-net/aspose.words/styleidentifier/_index.md index da55d338776..09187d78ef7 100644 --- a/english/python-net/aspose.words/styleidentifier/_index.md +++ b/english/python-net/aspose.words/styleidentifier/_index.md @@ -5,7 +5,7 @@ articleTitle: StyleIdentifier enumeration second_title: Aspose.Words for Python description: "aspose.words.StyleIdentifier enumeration. Locale independent style identifier." type: docs -weight: 1180 +weight: 1190 url: /python-net/aspose.words/styleidentifier/ --- diff --git a/english/python-net/aspose.words/styletype/_index.md b/english/python-net/aspose.words/styletype/_index.md index f02b280b8d1..f59fbcf4221 100644 --- a/english/python-net/aspose.words/styletype/_index.md +++ b/english/python-net/aspose.words/styletype/_index.md @@ -5,7 +5,7 @@ articleTitle: StyleType enumeration second_title: Aspose.Words for Python description: "aspose.words.StyleType enumeration. Represents type of the style." type: docs -weight: 1190 +weight: 1200 url: /python-net/aspose.words/styletype/ --- diff --git a/english/python-net/aspose.words/subdocument/_index.md b/english/python-net/aspose.words/subdocument/_index.md index 685c469d94d..7a4c475ee38 100644 --- a/english/python-net/aspose.words/subdocument/_index.md +++ b/english/python-net/aspose.words/subdocument/_index.md @@ -5,7 +5,7 @@ articleTitle: SubDocument class second_title: Aspose.Words for Python description: "aspose.words.SubDocument class. Represents a SubDocument - which is a reference to an externally stored document" type: docs -weight: 1200 +weight: 1210 url: /python-net/aspose.words/subdocument/ --- diff --git a/english/python-net/aspose.words/tabalignment/_index.md b/english/python-net/aspose.words/tabalignment/_index.md index 1542312f1ea..6f8b09e3eb8 100644 --- a/english/python-net/aspose.words/tabalignment/_index.md +++ b/english/python-net/aspose.words/tabalignment/_index.md @@ -5,7 +5,7 @@ articleTitle: TabAlignment enumeration second_title: Aspose.Words for Python description: "aspose.words.TabAlignment enumeration. Specifies the alignment/type of a tab stop." type: docs -weight: 1210 +weight: 1220 url: /python-net/aspose.words/tabalignment/ --- diff --git a/english/python-net/aspose.words/tableader/_index.md b/english/python-net/aspose.words/tableader/_index.md index 146782e453a..9ee28b75c49 100644 --- a/english/python-net/aspose.words/tableader/_index.md +++ b/english/python-net/aspose.words/tableader/_index.md @@ -5,7 +5,7 @@ articleTitle: TabLeader enumeration second_title: Aspose.Words for Python description: "aspose.words.TabLeader enumeration. Specifies the type of the leader line displayed under the tab character." type: docs -weight: 1220 +weight: 1230 url: /python-net/aspose.words/tableader/ --- diff --git a/english/python-net/aspose.words/tablestyle/_index.md b/english/python-net/aspose.words/tablestyle/_index.md index b2b939a1a55..56a1d7ce237 100644 --- a/english/python-net/aspose.words/tablestyle/_index.md +++ b/english/python-net/aspose.words/tablestyle/_index.md @@ -5,7 +5,7 @@ articleTitle: TableStyle class second_title: Aspose.Words for Python description: "aspose.words.TableStyle class. Represents a table style" type: docs -weight: 1250 +weight: 1260 url: /python-net/aspose.words/tablestyle/ --- diff --git a/english/python-net/aspose.words/tabstop/_index.md b/english/python-net/aspose.words/tabstop/_index.md index 12e21a24d6a..7aa83df70bb 100644 --- a/english/python-net/aspose.words/tabstop/_index.md +++ b/english/python-net/aspose.words/tabstop/_index.md @@ -5,7 +5,7 @@ articleTitle: TabStop class second_title: Aspose.Words for Python description: "aspose.words.TabStop class. Represents a single custom tab stop" type: docs -weight: 1230 +weight: 1240 url: /python-net/aspose.words/tabstop/ --- diff --git a/english/python-net/aspose.words/tabstopcollection/_index.md b/english/python-net/aspose.words/tabstopcollection/_index.md index e4ead2bebb6..32b05b871a6 100644 --- a/english/python-net/aspose.words/tabstopcollection/_index.md +++ b/english/python-net/aspose.words/tabstopcollection/_index.md @@ -5,7 +5,7 @@ articleTitle: TabStopCollection class second_title: Aspose.Words for Python description: "aspose.words.TabStopCollection class. A collection of [TabStop](../tabstop/) objects that represent custom tabs for a paragraph or a style" type: docs -weight: 1240 +weight: 1250 url: /python-net/aspose.words/tabstopcollection/ --- diff --git a/english/python-net/aspose.words/textcolumn/_index.md b/english/python-net/aspose.words/textcolumn/_index.md index 5c507f3a38b..8e7fd2fee63 100644 --- a/english/python-net/aspose.words/textcolumn/_index.md +++ b/english/python-net/aspose.words/textcolumn/_index.md @@ -5,7 +5,7 @@ articleTitle: TextColumn class second_title: Aspose.Words for Python description: "aspose.words.TextColumn class. Represents a single text column" type: docs -weight: 1260 +weight: 1270 url: /python-net/aspose.words/textcolumn/ --- diff --git a/english/python-net/aspose.words/textcolumncollection/_index.md b/english/python-net/aspose.words/textcolumncollection/_index.md index 5b491798c7b..8dde9a7fab6 100644 --- a/english/python-net/aspose.words/textcolumncollection/_index.md +++ b/english/python-net/aspose.words/textcolumncollection/_index.md @@ -5,7 +5,7 @@ articleTitle: TextColumnCollection class second_title: Aspose.Words for Python description: "aspose.words.TextColumnCollection class. A collection of [TextColumn](../textcolumn/) objects that represent all the columns of text in a section of a document" type: docs -weight: 1270 +weight: 1280 url: /python-net/aspose.words/textcolumncollection/ --- @@ -62,7 +62,7 @@ Shows how to create multiple evenly spaced columns in a section. ```python doc = aw.Document() -builder = aw.DocumentBuilder(doc) +builder = aw.DocumentBuilder(doc=doc) columns = builder.page_setup.text_columns columns.spacing = 100 columns.set_count(2) diff --git a/english/python-net/aspose.words/textcolumncollection/count/_index.md b/english/python-net/aspose.words/textcolumncollection/count/_index.md index 74036aebfe8..d429191017b 100644 --- a/english/python-net/aspose.words/textcolumncollection/count/_index.md +++ b/english/python-net/aspose.words/textcolumncollection/count/_index.md @@ -21,6 +21,22 @@ def count(self) -> int: ``` +### Examples + +Shows how to create multiple evenly spaced columns in a section. + +```python +doc = aw.Document() +builder = aw.DocumentBuilder(doc=doc) +columns = builder.page_setup.text_columns +columns.spacing = 100 +columns.set_count(2) +builder.writeln('Column 1.') +builder.insert_break(aw.BreakType.COLUMN_BREAK) +builder.writeln('Column 2.') +doc.save(file_name=ARTIFACTS_DIR + 'PageSetup.ColumnsSameWidth.docx') +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/textcolumncollection/set_count/_index.md b/english/python-net/aspose.words/textcolumncollection/set_count/_index.md index dac775641f1..b728775c4d2 100644 --- a/english/python-net/aspose.words/textcolumncollection/set_count/_index.md +++ b/english/python-net/aspose.words/textcolumncollection/set_count/_index.md @@ -38,7 +38,7 @@ Shows how to create multiple evenly spaced columns in a section. ```python doc = aw.Document() -builder = aw.DocumentBuilder(doc) +builder = aw.DocumentBuilder(doc=doc) columns = builder.page_setup.text_columns columns.spacing = 100 columns.set_count(2) diff --git a/english/python-net/aspose.words/textcolumncollection/spacing/_index.md b/english/python-net/aspose.words/textcolumncollection/spacing/_index.md index 69ee3c43c08..afaf3b272ca 100644 --- a/english/python-net/aspose.words/textcolumncollection/spacing/_index.md +++ b/english/python-net/aspose.words/textcolumncollection/spacing/_index.md @@ -37,7 +37,7 @@ Shows how to create multiple evenly spaced columns in a section. ```python doc = aw.Document() -builder = aw.DocumentBuilder(doc) +builder = aw.DocumentBuilder(doc=doc) columns = builder.page_setup.text_columns columns.spacing = 100 columns.set_count(2) diff --git a/english/python-net/aspose.words/textcolumncollection/width/_index.md b/english/python-net/aspose.words/textcolumncollection/width/_index.md index 9fe127a1258..6aa7f75aeba 100644 --- a/english/python-net/aspose.words/textcolumncollection/width/_index.md +++ b/english/python-net/aspose.words/textcolumncollection/width/_index.md @@ -28,6 +28,22 @@ Has effect only when [TextColumnCollection.evenly_spaced](../evenly_spaced/) is +### Examples + +Shows how to create multiple evenly spaced columns in a section. + +```python +doc = aw.Document() +builder = aw.DocumentBuilder(doc=doc) +columns = builder.page_setup.text_columns +columns.spacing = 100 +columns.set_count(2) +builder.writeln('Column 1.') +builder.insert_break(aw.BreakType.COLUMN_BREAK) +builder.writeln('Column 2.') +doc.save(file_name=ARTIFACTS_DIR + 'PageSetup.ColumnsSameWidth.docx') +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/textdmleffect/_index.md b/english/python-net/aspose.words/textdmleffect/_index.md index 976764dd060..22c4b316e76 100644 --- a/english/python-net/aspose.words/textdmleffect/_index.md +++ b/english/python-net/aspose.words/textdmleffect/_index.md @@ -5,7 +5,7 @@ articleTitle: TextDmlEffect enumeration second_title: Aspose.Words for Python description: "aspose.words.TextDmlEffect enumeration. Dml text effect for text runs." type: docs -weight: 1280 +weight: 1290 url: /python-net/aspose.words/textdmleffect/ --- diff --git a/english/python-net/aspose.words/texteffect/_index.md b/english/python-net/aspose.words/texteffect/_index.md index 5aa8f61f6b4..9efad5a4d80 100644 --- a/english/python-net/aspose.words/texteffect/_index.md +++ b/english/python-net/aspose.words/texteffect/_index.md @@ -5,7 +5,7 @@ articleTitle: TextEffect enumeration second_title: Aspose.Words for Python description: "aspose.words.TextEffect enumeration. Animation effect for text runs." type: docs -weight: 1290 +weight: 1300 url: /python-net/aspose.words/texteffect/ --- diff --git a/english/python-net/aspose.words/textorientation/_index.md b/english/python-net/aspose.words/textorientation/_index.md index 7f8760449e4..af895eb3dee 100644 --- a/english/python-net/aspose.words/textorientation/_index.md +++ b/english/python-net/aspose.words/textorientation/_index.md @@ -5,7 +5,7 @@ articleTitle: TextOrientation enumeration second_title: Aspose.Words for Python description: "aspose.words.TextOrientation enumeration. Specifies orientation of text on a page, in a table cell or a text frame." type: docs -weight: 1300 +weight: 1310 url: /python-net/aspose.words/textorientation/ --- diff --git a/english/python-net/aspose.words/textureindex/_index.md b/english/python-net/aspose.words/textureindex/_index.md index 83a3cd0738d..1866aa96df1 100644 --- a/english/python-net/aspose.words/textureindex/_index.md +++ b/english/python-net/aspose.words/textureindex/_index.md @@ -5,7 +5,7 @@ articleTitle: TextureIndex enumeration second_title: Aspose.Words for Python description: "aspose.words.TextureIndex enumeration. Specifies shading texture." type: docs -weight: 1320 +weight: 1330 url: /python-net/aspose.words/textureindex/ --- diff --git a/english/python-net/aspose.words/textwatermarkoptions/_index.md b/english/python-net/aspose.words/textwatermarkoptions/_index.md index 508043805cd..37a49323316 100644 --- a/english/python-net/aspose.words/textwatermarkoptions/_index.md +++ b/english/python-net/aspose.words/textwatermarkoptions/_index.md @@ -5,7 +5,7 @@ articleTitle: TextWatermarkOptions class second_title: Aspose.Words for Python description: "aspose.words.TextWatermarkOptions class. Contains options that can be specified when adding a watermark with text" type: docs -weight: 1310 +weight: 1320 url: /python-net/aspose.words/textwatermarkoptions/ --- diff --git a/english/python-net/aspose.words/underline/_index.md b/english/python-net/aspose.words/underline/_index.md index 742fdf66c87..ce72173672b 100644 --- a/english/python-net/aspose.words/underline/_index.md +++ b/english/python-net/aspose.words/underline/_index.md @@ -5,7 +5,7 @@ articleTitle: Underline enumeration second_title: Aspose.Words for Python description: "aspose.words.Underline enumeration. Indicates type of the underline applied to a font." type: docs -weight: 1330 +weight: 1340 url: /python-net/aspose.words/underline/ --- diff --git a/english/python-net/aspose.words/unsupportedencryptionexception/_index.md b/english/python-net/aspose.words/unsupportedencryptionexception/_index.md new file mode 100644 index 00000000000..22555d50b40 --- /dev/null +++ b/english/python-net/aspose.words/unsupportedencryptionexception/_index.md @@ -0,0 +1,20 @@ +--- +title: UnsupportedEncryptionException class +linktitle: UnsupportedEncryptionException class +articleTitle: UnsupportedEncryptionException class +second_title: Aspose.Words for Python +description: "aspose.words.UnsupportedEncryptionException class. Thrown during document load, when the document is encrypted with an unsupported method." +type: docs +weight: 1350 +url: /python-net/aspose.words/unsupportedencryptionexception/ +--- + +## UnsupportedEncryptionException class + +Thrown during document load, when the document is encrypted with an unsupported method. + + +### See Also + +* module [aspose.words](../) + diff --git a/english/python-net/aspose.words/unsupportedfileformatexception/_index.md b/english/python-net/aspose.words/unsupportedfileformatexception/_index.md index 797e364ce84..96189d06916 100644 --- a/english/python-net/aspose.words/unsupportedfileformatexception/_index.md +++ b/english/python-net/aspose.words/unsupportedfileformatexception/_index.md @@ -5,7 +5,7 @@ articleTitle: UnsupportedFileFormatException class second_title: Aspose.Words for Python description: "aspose.words.UnsupportedFileFormatException class. Thrown during document load, when the document format is not recognized or not supported by Aspose.Words" type: docs -weight: 1340 +weight: 1360 url: /python-net/aspose.words/unsupportedfileformatexception/ --- diff --git a/english/python-net/aspose.words/variablecollection/_index.md b/english/python-net/aspose.words/variablecollection/_index.md index 143121b707e..8528125e00a 100644 --- a/english/python-net/aspose.words/variablecollection/_index.md +++ b/english/python-net/aspose.words/variablecollection/_index.md @@ -5,7 +5,7 @@ articleTitle: VariableCollection class second_title: Aspose.Words for Python description: "aspose.words.VariableCollection class. A collection of document variables" type: docs -weight: 1350 +weight: 1370 url: /python-net/aspose.words/variablecollection/ --- @@ -50,53 +50,6 @@ Variable names are case-insensitive. |[ remove(name)](./remove/#str) | Removes a document variable with the specified name from the collection. | |[ remove_at(index)](./remove_at/#int) | Removes a document variable at the specified index. | -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../) diff --git a/english/python-net/aspose.words/variablecollection/add/_index.md b/english/python-net/aspose.words/variablecollection/add/_index.md index e4843da272b..d6ea1c6ba40 100644 --- a/english/python-net/aspose.words/variablecollection/add/_index.md +++ b/english/python-net/aspose.words/variablecollection/add/_index.md @@ -24,53 +24,6 @@ def add(self, name: str, value: str): | name | str | The case-insensitive name of the variable to add. | | value | str | The value of the variable. The value cannot be ``None``, if value is null empty string will be used instead. | -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/variablecollection/clear/_index.md b/english/python-net/aspose.words/variablecollection/clear/_index.md index 930f5012a87..63516c37d89 100644 --- a/english/python-net/aspose.words/variablecollection/clear/_index.md +++ b/english/python-net/aspose.words/variablecollection/clear/_index.md @@ -19,53 +19,6 @@ def clear(self): ... ``` -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/variablecollection/contains/_index.md b/english/python-net/aspose.words/variablecollection/contains/_index.md index 8fed917e82b..09135d19737 100644 --- a/english/python-net/aspose.words/variablecollection/contains/_index.md +++ b/english/python-net/aspose.words/variablecollection/contains/_index.md @@ -28,53 +28,6 @@ def contains(self, name: str): ``True`` if item is found in the collection; otherwise, ``False``. -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/variablecollection/count/_index.md b/english/python-net/aspose.words/variablecollection/count/_index.md index 9042b56ae75..7b491e09948 100644 --- a/english/python-net/aspose.words/variablecollection/count/_index.md +++ b/english/python-net/aspose.words/variablecollection/count/_index.md @@ -21,53 +21,6 @@ def count(self) -> int: ``` -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/variablecollection/index_of_key/_index.md b/english/python-net/aspose.words/variablecollection/index_of_key/_index.md index 38b9c3965dd..94be3aaeae7 100644 --- a/english/python-net/aspose.words/variablecollection/index_of_key/_index.md +++ b/english/python-net/aspose.words/variablecollection/index_of_key/_index.md @@ -28,53 +28,6 @@ def index_of_key(self, name: str): The zero based index. Negative value if not found. -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/variablecollection/remove/_index.md b/english/python-net/aspose.words/variablecollection/remove/_index.md index b65255a4a7f..b91e9318512 100644 --- a/english/python-net/aspose.words/variablecollection/remove/_index.md +++ b/english/python-net/aspose.words/variablecollection/remove/_index.md @@ -23,53 +23,6 @@ def remove(self, name: str): | --- | --- | --- | | name | str | The case-insensitive name of the variable. | -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/variablecollection/remove_at/_index.md b/english/python-net/aspose.words/variablecollection/remove_at/_index.md index 0ea5a22b6b3..046ed55ae55 100644 --- a/english/python-net/aspose.words/variablecollection/remove_at/_index.md +++ b/english/python-net/aspose.words/variablecollection/remove_at/_index.md @@ -23,53 +23,6 @@ def remove_at(self, index: int): | --- | --- | --- | | index | int | The zero based index. | -### Examples - -Shows how to work with a document's variable collection. - -```python -doc = aw.Document() -variables = doc.variables -# Every document has a collection of key/value pair variables, which we can add items to. -variables.add('Home address', '123 Main St.') -variables.add('City', 'London') -variables.add('Bedrooms', '3') -self.assertEqual(3, variables.count) -# We can display the values of variables in the document body using DOCVARIABLE fields. -builder = aw.DocumentBuilder(doc) -field = builder.insert_field(aw.fields.FieldType.FIELD_DOC_VARIABLE, True) -field = field.as_field_doc_variable() -field.variable_name = 'Home address' -field.update() -self.assertEqual('123 Main St.', field.result) -# Assigning values to existing keys will update them. -variables.add('Home address', '456 Queen St.') -# We will then have to update DOCVARIABLE fields to ensure they display an up-to-date value. -self.assertEqual('123 Main St.', field.result) -field.update() -self.assertEqual('456 Queen St.', field.result) -# Verify that the document variables with a certain name or value exist. -self.assertTrue(variables.contains('City')) -self.assertTrue(any((str(var) == 'London' for var in variables))) -# The collection of variables automatically sorts variables alphabetically by name. -self.assertEqual(0, variables.index_of_key('Bedrooms')) -self.assertEqual(1, variables.index_of_key('City')) -self.assertEqual(2, variables.index_of_key('Home address')) -# Enumerate over the collection of variables. -for entry in doc.variables: - print(f'Name: {entry.key}, Value: {entry.value}') -# Below are three ways of removing document variables from a collection. -# 1 - By name: -variables.remove('City') -self.assertFalse(variables.contains('City')) -# 2 - By index: -variables.remove_at(1) -self.assertFalse(variables.contains('Home address')) -# 3 - Clear the whole collection at once: -variables.clear() -self.assertEqual(0, variables.count) -``` - ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/visitoraction/_index.md b/english/python-net/aspose.words/visitoraction/_index.md index 11d59e9adfe..6819125d9a1 100644 --- a/english/python-net/aspose.words/visitoraction/_index.md +++ b/english/python-net/aspose.words/visitoraction/_index.md @@ -5,7 +5,7 @@ articleTitle: VisitorAction enumeration second_title: Aspose.Words for Python description: "aspose.words.VisitorAction enumeration. Allows the visitor to control the enumeration of nodes." type: docs -weight: 1360 +weight: 1380 url: /python-net/aspose.words/visitoraction/ --- diff --git a/english/python-net/aspose.words/warninginfo/_index.md b/english/python-net/aspose.words/warninginfo/_index.md index 4982ada1388..049a899dc0f 100644 --- a/english/python-net/aspose.words/warninginfo/_index.md +++ b/english/python-net/aspose.words/warninginfo/_index.md @@ -5,7 +5,7 @@ articleTitle: WarningInfo class second_title: Aspose.Words for Python description: "aspose.words.WarningInfo class. Contains information about a warning that Aspose.Words issued during document loading or saving" type: docs -weight: 1370 +weight: 1390 url: /python-net/aspose.words/warninginfo/ --- @@ -33,6 +33,30 @@ and passed by Aspose.Words to the [IWarningCallback.warning()](../iwarningcallba | [source](./source/) | Returns the source of the warning. | | [warning_type](./warning_type/) | Returns the type of the warning. | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../) diff --git a/english/python-net/aspose.words/warninginfo/description/_index.md b/english/python-net/aspose.words/warninginfo/description/_index.md index a5214da2851..28f43d712b5 100644 --- a/english/python-net/aspose.words/warninginfo/description/_index.md +++ b/english/python-net/aspose.words/warninginfo/description/_index.md @@ -21,6 +21,30 @@ def description(self) -> str: ``` +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/warninginfo/warning_type/_index.md b/english/python-net/aspose.words/warninginfo/warning_type/_index.md index acf2fe100c3..9e24fa52317 100644 --- a/english/python-net/aspose.words/warninginfo/warning_type/_index.md +++ b/english/python-net/aspose.words/warninginfo/warning_type/_index.md @@ -21,6 +21,30 @@ def warning_type(self) -> aspose.words.WarningType: ``` +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/warninginfocollection/_index.md b/english/python-net/aspose.words/warninginfocollection/_index.md index e04ac1ebe0a..8bc324070db 100644 --- a/english/python-net/aspose.words/warninginfocollection/_index.md +++ b/english/python-net/aspose.words/warninginfocollection/_index.md @@ -5,7 +5,7 @@ articleTitle: WarningInfoCollection class second_title: Aspose.Words for Python description: "aspose.words.WarningInfoCollection class. Represents a typed collection of [WarningInfo](../warninginfo/) objects" type: docs -weight: 1380 +weight: 1400 url: /python-net/aspose.words/warninginfocollection/ --- @@ -52,6 +52,30 @@ to the [LoadOptions.warning_callback](../../aspose.words.loading/loadoptions/war |[ clear()](./clear/#default) | Removes all elements from the collection. | |[ warning(info)](./warning/#warninginfo) | Implements the [IWarningCallback](../iwarningcallback/) interface. Adds a warning to this collection. | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../) diff --git a/english/python-net/aspose.words/warninginfocollection/clear/_index.md b/english/python-net/aspose.words/warninginfocollection/clear/_index.md index c1eff78afcd..82a841e467b 100644 --- a/english/python-net/aspose.words/warninginfocollection/clear/_index.md +++ b/english/python-net/aspose.words/warninginfocollection/clear/_index.md @@ -19,6 +19,30 @@ def clear(self): ... ``` +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/warninginfocollection/warning/_index.md b/english/python-net/aspose.words/warninginfocollection/warning/_index.md index 10283fd0f2e..ade175ce284 100644 --- a/english/python-net/aspose.words/warninginfocollection/warning/_index.md +++ b/english/python-net/aspose.words/warninginfocollection/warning/_index.md @@ -24,6 +24,30 @@ def warning(self, info: aspose.words.WarningInfo): | --- | --- | --- | | info | [WarningInfo](../../warninginfo/) | | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/warningsource/_index.md b/english/python-net/aspose.words/warningsource/_index.md index 4dd3533b339..8be8955707c 100644 --- a/english/python-net/aspose.words/warningsource/_index.md +++ b/english/python-net/aspose.words/warningsource/_index.md @@ -5,7 +5,7 @@ articleTitle: WarningSource enumeration second_title: Aspose.Words for Python description: "aspose.words.WarningSource enumeration. Specifies the module that produces a warning during document loading or saving." type: docs -weight: 1390 +weight: 1410 url: /python-net/aspose.words/warningsource/ --- diff --git a/english/python-net/aspose.words/warningtype/_index.md b/english/python-net/aspose.words/warningtype/_index.md index 92008007cc4..cc3397a2034 100644 --- a/english/python-net/aspose.words/warningtype/_index.md +++ b/english/python-net/aspose.words/warningtype/_index.md @@ -5,7 +5,7 @@ articleTitle: WarningType enumeration second_title: Aspose.Words for Python description: "aspose.words.WarningType enumeration. Specifies the type of a warning that is issued by Aspose.Words during document loading or saving." type: docs -weight: 1400 +weight: 1420 url: /python-net/aspose.words/warningtype/ --- @@ -30,6 +30,30 @@ Specifies the type of a warning that is issued by Aspose.Words during document l | UNEXPECTED_CONTENT | Generic unexpected content, no specific code. | | HINT | Advises of a potential problem or suggests an improvement. | +### Examples + +Shows how to set the property for finding the closest match for a missing font from the available font sources. + +```python +# Open a document that contains text formatted with a font that does not exist in any of our font sources. +doc = aw.Document(file_name=MY_DIR + 'Missing font.docx') +# Assign a callback for handling font substitution warnings. +warning_collector = aw.WarningInfoCollection() +doc.warning_callback = warning_collector +# Set a default font name and enable font substitution. +font_settings = aw.fonts.FontSettings() +font_settings.substitution_settings.default_font_substitution.default_font_name = 'Arial' +font_settings.substitution_settings.font_info_substitution.enabled = True +# Original font metrics should be used after font substitution. +doc.layout_options.keep_original_font_metrics = True +# We will get a font substitution warning if we save a document with a missing font. +doc.font_settings = font_settings +doc.save(file_name=ARTIFACTS_DIR + 'FontSettings.EnableFontSubstitution.pdf') +for info in warning_collector: + if info.warning_type == aw.WarningType.FONT_SUBSTITUTION: + print(info.description) +``` + ### See Also * module [aspose.words](../) diff --git a/english/python-net/aspose.words/watermark/_index.md b/english/python-net/aspose.words/watermark/_index.md index 19b62407d1b..b6057e8f54b 100644 --- a/english/python-net/aspose.words/watermark/_index.md +++ b/english/python-net/aspose.words/watermark/_index.md @@ -5,7 +5,7 @@ articleTitle: Watermark class second_title: Aspose.Words for Python description: "aspose.words.Watermark class. Represents class to work with document watermark" type: docs -weight: 1410 +weight: 1430 url: /python-net/aspose.words/watermark/ --- diff --git a/english/python-net/aspose.words/watermarklayout/_index.md b/english/python-net/aspose.words/watermarklayout/_index.md index 0295dd5bf37..3d50e216431 100644 --- a/english/python-net/aspose.words/watermarklayout/_index.md +++ b/english/python-net/aspose.words/watermarklayout/_index.md @@ -5,7 +5,7 @@ articleTitle: WatermarkLayout enumeration second_title: Aspose.Words for Python description: "aspose.words.WatermarkLayout enumeration. Defines layout of the watermark relative to the watermark center." type: docs -weight: 1420 +weight: 1440 url: /python-net/aspose.words/watermarklayout/ --- diff --git a/english/python-net/aspose.words/watermarktype/_index.md b/english/python-net/aspose.words/watermarktype/_index.md index 97ae821d571..2fed8a9e540 100644 --- a/english/python-net/aspose.words/watermarktype/_index.md +++ b/english/python-net/aspose.words/watermarktype/_index.md @@ -5,7 +5,7 @@ articleTitle: WatermarkType enumeration second_title: Aspose.Words for Python description: "aspose.words.WatermarkType enumeration. Specifies the watermark type." type: docs -weight: 1430 +weight: 1450 url: /python-net/aspose.words/watermarktype/ ---