diff --git a/english/python-net/aspose.words.ai/openaimodel/__init__/_index.md b/english/python-net/aspose.words.ai/openaimodel/__init__/_index.md index 47fe43c6006..c03a05009ce 100644 --- a/english/python-net/aspose.words.ai/openaimodel/__init__/_index.md +++ b/english/python-net/aspose.words.ai/openaimodel/__init__/_index.md @@ -45,15 +45,15 @@ def __init__(self, name: str): Shows how to create an OpenAI model instance directly using an API key and model name. ```python -api_key = system_helper.environment.Environment.get_environment_variable("API_KEY") +api_key = system_helper.environment.Environment.get_environment_variable('API_KEY') # Create an OpenAI model instance using the constructor with model name and API key. -model = aw.ai.OpenAiModel(name="gpt-4o-mini", api_key=api_key) -doc = aw.Document(file_name=MY_DIR + "Big document.docx") +model = aw.ai.OpenAiModel(name='gpt-4o-mini', api_key=api_key) +doc = aw.Document(file_name=MY_DIR + 'Big document.docx') # Summarize the document using the OpenAI model with short summary length. summarize_options = aw.ai.SummarizeOptions() summarize_options.summary_length = aw.ai.SummaryLength.VERY_SHORT summary = model.summarize(source_document=doc, options=summarize_options) -summary.save(file_name=ARTIFACTS_DIR + "OpenAiModel.OpenAiModelConstructor.docx") +summary.save(file_name=ARTIFACTS_DIR + 'OpenAiModel.OpenAiModelConstructor.docx') ``` ## See Also diff --git a/english/python-net/aspose.words.buildingblocks/glossarydocument/_index.md b/english/python-net/aspose.words.buildingblocks/glossarydocument/_index.md index b1d21163b06..75b79b0e830 100644 --- a/english/python-net/aspose.words.buildingblocks/glossarydocument/_index.md +++ b/english/python-net/aspose.words.buildingblocks/glossarydocument/_index.md @@ -88,6 +88,7 @@ Corresponds to the **glossaryDocument** and **docParts** elements in OOXML. |[ get_text()](../../aspose.words/node/get_text/#default) | Gets the text of this node and of all its children.
(Inherited from [Node](../../aspose.words/node/)) | |[ import_node(src_node, is_import_children)](../../aspose.words/documentbase/import_node/#node_bool) | Imports a node from another document to the current document.
(Inherited from [DocumentBase](../../aspose.words/documentbase/)) | |[ import_node(src_node, is_import_children, import_format_mode)](../../aspose.words/documentbase/import_node/#node_bool_importformatmode) | Imports a node from another document to the current document with an option to control formatting.
(Inherited from [DocumentBase](../../aspose.words/documentbase/)) | +|[ import_node(src_node, is_import_children, import_format_mode, import_format_options)](../../aspose.words/documentbase/import_node/#node_bool_importformatmode_importformatoptions) | Imports a node from another document to the current document with an option to control formatting.
(Inherited from [DocumentBase](../../aspose.words/documentbase/)) | |[ index_of(child)](../../aspose.words/compositenode/index_of/#node) | Returns the index of the specified child node in the child node array.
(Inherited from [CompositeNode](../../aspose.words/compositenode/)) | |[ insert_after(new_child, ref_child)](../../aspose.words/compositenode/insert_after/#node_node) | Inserts the specified node immediately after the specified reference node.
(Inherited from [CompositeNode](../../aspose.words/compositenode/)) | |[ insert_before(new_child, ref_child)](../../aspose.words/compositenode/insert_before/#node_node) | Inserts the specified node immediately before the specified reference node.
(Inherited from [CompositeNode](../../aspose.words/compositenode/)) | diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/_index.md index f3526585b52..62e26f14b1d 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/_index.md @@ -21,14 +21,20 @@ To learn more, visit the [Work with Digital Signatures](https://docs.aspose.com/ | Name | Description | | --- | --- | +| [application_version](./application_version/) | Gets the application version for the digital signature. | | [certificate_holder](./certificate_holder/) | Returns the certificate holder object that contains the certificate was used to sign the document. | +| [color_depth](./color_depth/) | Gets the color depth for the digital signature. | | [comments](./comments/) | Gets the signing purpose comment. | +| [horizontal_resolution](./horizontal_resolution/) | Gets the horizontal resolution for the digital signature. | | [is_valid](./is_valid/) | Returns ``True`` if this digital signature is valid and the document has not been tampered with. | | [issuer_name](./issuer_name/) | Returns the subject distinguished name of the certificate isuuer. | +| [office_version](./office_version/) | Gets the Office version for the digital signature. | | [sign_time](./sign_time/) | Gets the time the document was signed. | | [signature_type](./signature_type/) | Gets the type of the digital signature. | | [signature_value](./signature_value/) | Gets an array of bytes representing a signature value. | | [subject_name](./subject_name/) | Returns the subject distinguished name of the certificate that was used to sign the document. | +| [vertical_resolution](./vertical_resolution/) | Gets the vertical resolution for the digital signature. | +| [windows_version](./windows_version/) | Gets the Windows version for the digital signature. | ### Examples diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/application_version/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/application_version/_index.md new file mode 100644 index 00000000000..99d78e78ffa --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/application_version/_index.md @@ -0,0 +1,28 @@ +--- +title: DigitalSignature.application_version property +linktitle: application_version property +articleTitle: application_version property +second_title: Aspose.Words for Python +description: "DigitalSignature.application_version property. Gets the application version for the digital signature." +type: docs +weight: 10 +url: /python-net/aspose.words.digitalsignatures/digitalsignature/application_version/ +--- + +## DigitalSignature.application_version property + +Gets the application version for the digital signature. + + +```python +@property +def application_version(self) -> str: + ... + +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [DigitalSignature](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/certificate_holder/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/certificate_holder/_index.md index 32ccf223011..60b5bdd7428 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/certificate_holder/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/certificate_holder/_index.md @@ -5,7 +5,7 @@ articleTitle: certificate_holder property second_title: Aspose.Words for Python description: "DigitalSignature.certificate_holder property. Returns the certificate holder object that contains the certificate was used to sign the document." type: docs -weight: 10 +weight: 20 url: /python-net/aspose.words.digitalsignatures/digitalsignature/certificate_holder/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/color_depth/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/color_depth/_index.md new file mode 100644 index 00000000000..929e0d311b8 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/color_depth/_index.md @@ -0,0 +1,28 @@ +--- +title: DigitalSignature.color_depth property +linktitle: color_depth property +articleTitle: color_depth property +second_title: Aspose.Words for Python +description: "DigitalSignature.color_depth property. Gets the color depth for the digital signature." +type: docs +weight: 30 +url: /python-net/aspose.words.digitalsignatures/digitalsignature/color_depth/ +--- + +## DigitalSignature.color_depth property + +Gets the color depth for the digital signature. + + +```python +@property +def color_depth(self) -> int: + ... + +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [DigitalSignature](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/comments/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/comments/_index.md index 910cbc0bcc3..f76b546ce12 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/comments/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/comments/_index.md @@ -5,7 +5,7 @@ articleTitle: comments property second_title: Aspose.Words for Python description: "DigitalSignature.comments property. Gets the signing purpose comment." type: docs -weight: 20 +weight: 40 url: /python-net/aspose.words.digitalsignatures/digitalsignature/comments/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/horizontal_resolution/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/horizontal_resolution/_index.md new file mode 100644 index 00000000000..cb10d12d474 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/horizontal_resolution/_index.md @@ -0,0 +1,28 @@ +--- +title: DigitalSignature.horizontal_resolution property +linktitle: horizontal_resolution property +articleTitle: horizontal_resolution property +second_title: Aspose.Words for Python +description: "DigitalSignature.horizontal_resolution property. Gets the horizontal resolution for the digital signature." +type: docs +weight: 50 +url: /python-net/aspose.words.digitalsignatures/digitalsignature/horizontal_resolution/ +--- + +## DigitalSignature.horizontal_resolution property + +Gets the horizontal resolution for the digital signature. + + +```python +@property +def horizontal_resolution(self) -> int: + ... + +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [DigitalSignature](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/is_valid/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/is_valid/_index.md index ac2ba80c5cf..8815af28281 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/is_valid/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/is_valid/_index.md @@ -5,7 +5,7 @@ articleTitle: is_valid property second_title: Aspose.Words for Python description: "DigitalSignature.is_valid property. Returns ``True`` if this digital signature is valid and the document has not been tampered with." type: docs -weight: 30 +weight: 60 url: /python-net/aspose.words.digitalsignatures/digitalsignature/is_valid/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/issuer_name/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/issuer_name/_index.md index 88fc0f89e03..52086590d03 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/issuer_name/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/issuer_name/_index.md @@ -5,7 +5,7 @@ articleTitle: issuer_name property second_title: Aspose.Words for Python description: "DigitalSignature.issuer_name property. Returns the subject distinguished name of the certificate isuuer." type: docs -weight: 40 +weight: 70 url: /python-net/aspose.words.digitalsignatures/digitalsignature/issuer_name/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/office_version/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/office_version/_index.md new file mode 100644 index 00000000000..f25b5e4a5b2 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/office_version/_index.md @@ -0,0 +1,28 @@ +--- +title: DigitalSignature.office_version property +linktitle: office_version property +articleTitle: office_version property +second_title: Aspose.Words for Python +description: "DigitalSignature.office_version property. Gets the Office version for the digital signature." +type: docs +weight: 80 +url: /python-net/aspose.words.digitalsignatures/digitalsignature/office_version/ +--- + +## DigitalSignature.office_version property + +Gets the Office version for the digital signature. + + +```python +@property +def office_version(self) -> str: + ... + +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [DigitalSignature](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/sign_time/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/sign_time/_index.md index 97a74c71354..2cf5840b03d 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/sign_time/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/sign_time/_index.md @@ -5,7 +5,7 @@ articleTitle: sign_time property second_title: Aspose.Words for Python description: "DigitalSignature.sign_time property. Gets the time the document was signed." type: docs -weight: 50 +weight: 90 url: /python-net/aspose.words.digitalsignatures/digitalsignature/sign_time/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_type/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_type/_index.md index 87ed18ddefd..66e45873f37 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_type/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_type/_index.md @@ -5,7 +5,7 @@ articleTitle: signature_type property second_title: Aspose.Words for Python description: "DigitalSignature.signature_type property. Gets the type of the digital signature." type: docs -weight: 60 +weight: 100 url: /python-net/aspose.words.digitalsignatures/digitalsignature/signature_type/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_value/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_value/_index.md index 750cea9847c..4a6a6fd6035 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_value/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/signature_value/_index.md @@ -5,7 +5,7 @@ articleTitle: signature_value property second_title: Aspose.Words for Python description: "DigitalSignature.signature_value property. Gets an array of bytes representing a signature value." type: docs -weight: 70 +weight: 110 url: /python-net/aspose.words.digitalsignatures/digitalsignature/signature_value/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/subject_name/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/subject_name/_index.md index 709ebce5700..b0554b75932 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignature/subject_name/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/subject_name/_index.md @@ -5,7 +5,7 @@ articleTitle: subject_name property second_title: Aspose.Words for Python description: "DigitalSignature.subject_name property. Returns the subject distinguished name of the certificate that was used to sign the document." type: docs -weight: 80 +weight: 120 url: /python-net/aspose.words.digitalsignatures/digitalsignature/subject_name/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/vertical_resolution/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/vertical_resolution/_index.md new file mode 100644 index 00000000000..6408143f6a0 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/vertical_resolution/_index.md @@ -0,0 +1,28 @@ +--- +title: DigitalSignature.vertical_resolution property +linktitle: vertical_resolution property +articleTitle: vertical_resolution property +second_title: Aspose.Words for Python +description: "DigitalSignature.vertical_resolution property. Gets the vertical resolution for the digital signature." +type: docs +weight: 130 +url: /python-net/aspose.words.digitalsignatures/digitalsignature/vertical_resolution/ +--- + +## DigitalSignature.vertical_resolution property + +Gets the vertical resolution for the digital signature. + + +```python +@property +def vertical_resolution(self) -> int: + ... + +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [DigitalSignature](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/digitalsignature/windows_version/_index.md b/english/python-net/aspose.words.digitalsignatures/digitalsignature/windows_version/_index.md new file mode 100644 index 00000000000..cd16a469ff5 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignature/windows_version/_index.md @@ -0,0 +1,28 @@ +--- +title: DigitalSignature.windows_version property +linktitle: windows_version property +articleTitle: windows_version property +second_title: Aspose.Words for Python +description: "DigitalSignature.windows_version property. Gets the Windows version for the digital signature." +type: docs +weight: 140 +url: /python-net/aspose.words.digitalsignatures/digitalsignature/windows_version/ +--- + +## DigitalSignature.windows_version property + +Gets the Windows version for the digital signature. + + +```python +@property +def windows_version(self) -> str: + ... + +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [DigitalSignature](../) + 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 e5f10ea1bb4..629cde883ea 100644 --- a/english/python-net/aspose.words.digitalsignatures/digitalsignatureutil/sign/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/digitalsignatureutil/sign/_index.md @@ -147,6 +147,31 @@ 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 sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + Shows how to sign documents with X.509 certificates. ```python diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/_index.md index 3c1b5faf30d..d68af39f36d 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/_index.md @@ -26,12 +26,18 @@ To learn more, visit the [Work with Digital Signatures](https://docs.aspose.com/ | Name | Description | | --- | --- | +| [application_version](./application_version/) | Gets or sets the application version for the digital signature. Default value is "12.0". | +| [color_depth](./color_depth/) | Gets or sets the color depth for the digital signature. Default value is 32. | | [comments](./comments/) | Specifies comments on the digital signature. Default value is **empty string**(). | | [decryption_password](./decryption_password/) | The password to decrypt source document. Default value is **empty string** (). | +| [horizontal_resolution](./horizontal_resolution/) | Gets or sets the horizontal resolution for the digital signature. Default value is 1920. | +| [office_version](./office_version/) | Gets or sets the Office version for the digital signature. Default value is "12.0". | | [provider_id](./provider_id/) | Specifies the class ID of the signature provider. Default value is **Empty (all zeroes) Guid**. | | [sign_time](./sign_time/) | The date of signing. Default value is **current time** (datetime.datetime.now) | | [signature_line_id](./signature_line_id/) | Signature line identifier. Default value is **Empty (all zeroes) Guid**. | | [signature_line_image](./signature_line_image/) | The image that will be shown in associated [SignatureLine](../../aspose.words.drawing/signatureline/). Default value is ``None``. | +| [vertical_resolution](./vertical_resolution/) | Gets or sets the vertical resolution for the digital signature. Default value is 1200. | +| [windows_version](./windows_version/) | Gets or sets the Windows version for the digital signature. Default value is "6.1". | | [xml_dsig_level](./xml_dsig_level/) | Specifies the level of a digital signature based on XML-DSig standard. The default value is [XmlDsigLevel.XML_D_SIG](../xmldsiglevel/#XML_D_SIG). | ### See Also diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/application_version/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/application_version/_index.md new file mode 100644 index 00000000000..57f8d16c37a --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/application_version/_index.md @@ -0,0 +1,60 @@ +--- +title: SignOptions.application_version property +linktitle: application_version property +articleTitle: application_version property +second_title: Aspose.Words for Python +description: "SignOptions.application_version property. Gets or sets the application version for the digital signature" +type: docs +weight: 20 +url: /python-net/aspose.words.digitalsignatures/signoptions/application_version/ +--- + +## SignOptions.application_version property + +Gets or sets the application version for the digital signature. +Default value is "12.0". + + +```python +@property +def application_version(self) -> str: + ... + +@application_version.setter +def application_version(self, value: str): + ... + +``` + +### Examples + +Shows how to sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [SignOptions](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/color_depth/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/color_depth/_index.md new file mode 100644 index 00000000000..17f8ed4dab4 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/color_depth/_index.md @@ -0,0 +1,60 @@ +--- +title: SignOptions.color_depth property +linktitle: color_depth property +articleTitle: color_depth property +second_title: Aspose.Words for Python +description: "SignOptions.color_depth property. Gets or sets the color depth for the digital signature" +type: docs +weight: 30 +url: /python-net/aspose.words.digitalsignatures/signoptions/color_depth/ +--- + +## SignOptions.color_depth property + +Gets or sets the color depth for the digital signature. +Default value is 32. + + +```python +@property +def color_depth(self) -> int: + ... + +@color_depth.setter +def color_depth(self, value: int): + ... + +``` + +### Examples + +Shows how to sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [SignOptions](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/comments/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/comments/_index.md index 06a32603876..3ee9fd2d566 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/comments/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/comments/_index.md @@ -5,7 +5,7 @@ articleTitle: comments property second_title: Aspose.Words for Python description: "SignOptions.comments property. Specifies comments on the digital signature" type: docs -weight: 20 +weight: 40 url: /python-net/aspose.words.digitalsignatures/signoptions/comments/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/decryption_password/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/decryption_password/_index.md index 048713b533d..be1d026d4ba 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/decryption_password/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/decryption_password/_index.md @@ -5,7 +5,7 @@ articleTitle: decryption_password property second_title: Aspose.Words for Python description: "SignOptions.decryption_password property. The password to decrypt source document" type: docs -weight: 30 +weight: 50 url: /python-net/aspose.words.digitalsignatures/signoptions/decryption_password/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/horizontal_resolution/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/horizontal_resolution/_index.md new file mode 100644 index 00000000000..7f50c292350 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/horizontal_resolution/_index.md @@ -0,0 +1,60 @@ +--- +title: SignOptions.horizontal_resolution property +linktitle: horizontal_resolution property +articleTitle: horizontal_resolution property +second_title: Aspose.Words for Python +description: "SignOptions.horizontal_resolution property. Gets or sets the horizontal resolution for the digital signature" +type: docs +weight: 60 +url: /python-net/aspose.words.digitalsignatures/signoptions/horizontal_resolution/ +--- + +## SignOptions.horizontal_resolution property + +Gets or sets the horizontal resolution for the digital signature. +Default value is 1920. + + +```python +@property +def horizontal_resolution(self) -> int: + ... + +@horizontal_resolution.setter +def horizontal_resolution(self, value: int): + ... + +``` + +### Examples + +Shows how to sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [SignOptions](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/office_version/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/office_version/_index.md new file mode 100644 index 00000000000..ab589fb398b --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/office_version/_index.md @@ -0,0 +1,60 @@ +--- +title: SignOptions.office_version property +linktitle: office_version property +articleTitle: office_version property +second_title: Aspose.Words for Python +description: "SignOptions.office_version property. Gets or sets the Office version for the digital signature" +type: docs +weight: 70 +url: /python-net/aspose.words.digitalsignatures/signoptions/office_version/ +--- + +## SignOptions.office_version property + +Gets or sets the Office version for the digital signature. +Default value is "12.0". + + +```python +@property +def office_version(self) -> str: + ... + +@office_version.setter +def office_version(self, value: str): + ... + +``` + +### Examples + +Shows how to sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [SignOptions](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/provider_id/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/provider_id/_index.md index 9983f271191..fd5956feb99 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/provider_id/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/provider_id/_index.md @@ -5,7 +5,7 @@ articleTitle: provider_id property second_title: Aspose.Words for Python description: "SignOptions.provider_id property. Specifies the class ID of the signature provider" type: docs -weight: 40 +weight: 80 url: /python-net/aspose.words.digitalsignatures/signoptions/provider_id/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/sign_time/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/sign_time/_index.md index 7e38466c6a7..808e277c4e7 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/sign_time/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/sign_time/_index.md @@ -5,7 +5,7 @@ articleTitle: sign_time property second_title: Aspose.Words for Python description: "SignOptions.sign_time property. The date of signing" type: docs -weight: 50 +weight: 90 url: /python-net/aspose.words.digitalsignatures/signoptions/sign_time/ --- 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 e8b61701560..192dbf2419b 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 @@ -5,7 +5,7 @@ articleTitle: signature_line_id property second_title: Aspose.Words for Python description: "SignOptions.signature_line_id property. Signature line identifier" type: docs -weight: 60 +weight: 100 url: /python-net/aspose.words.digitalsignatures/signoptions/signature_line_id/ --- 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 7f86555d7a8..1798e7fbec5 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 @@ -5,7 +5,7 @@ articleTitle: signature_line_image property second_title: Aspose.Words for Python description: "SignOptions.signature_line_image property. The image that will be shown in associated [SignatureLine](../../../aspose.words.drawing/signatureline/)" type: docs -weight: 70 +weight: 110 url: /python-net/aspose.words.digitalsignatures/signoptions/signature_line_image/ --- diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/vertical_resolution/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/vertical_resolution/_index.md new file mode 100644 index 00000000000..a39107ba345 --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/vertical_resolution/_index.md @@ -0,0 +1,60 @@ +--- +title: SignOptions.vertical_resolution property +linktitle: vertical_resolution property +articleTitle: vertical_resolution property +second_title: Aspose.Words for Python +description: "SignOptions.vertical_resolution property. Gets or sets the vertical resolution for the digital signature" +type: docs +weight: 120 +url: /python-net/aspose.words.digitalsignatures/signoptions/vertical_resolution/ +--- + +## SignOptions.vertical_resolution property + +Gets or sets the vertical resolution for the digital signature. +Default value is 1200. + + +```python +@property +def vertical_resolution(self) -> int: + ... + +@vertical_resolution.setter +def vertical_resolution(self, value: int): + ... + +``` + +### Examples + +Shows how to sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [SignOptions](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/windows_version/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/windows_version/_index.md new file mode 100644 index 00000000000..df928d116aa --- /dev/null +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/windows_version/_index.md @@ -0,0 +1,60 @@ +--- +title: SignOptions.windows_version property +linktitle: windows_version property +articleTitle: windows_version property +second_title: Aspose.Words for Python +description: "SignOptions.windows_version property. Gets or sets the Windows version for the digital signature" +type: docs +weight: 130 +url: /python-net/aspose.words.digitalsignatures/signoptions/windows_version/ +--- + +## SignOptions.windows_version property + +Gets or sets the Windows version for the digital signature. +Default value is "6.1". + + +```python +@property +def windows_version(self) -> str: + ... + +@windows_version.setter +def windows_version(self, value: str): + ... + +``` + +### Examples + +Shows how to sign a document with additional signing options. + +```python +sign_options = aw.digitalsignatures.SignOptions() +sign_options.windows_version = '10.0' +sign_options.application_version = '16.0.19127' +sign_options.office_version = '16.0.19127/27' +sign_options.horizontal_resolution = 1024 +sign_options.vertical_resolution = 768 +sign_options.color_depth = 24 +cert_bytes = system_helper.io.File.read_all_bytes(MY_DIR + 'morzal.pfx') +cert = aw.digitalsignatures.CertificateHolder.create(cert_bytes=cert_bytes, password='aw') +aw.digitalsignatures.DigitalSignatureUtil.sign(src_file_name=MY_DIR + 'Digitally signed.docx', dst_file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx', cert_holder=cert, sign_options=sign_options) +signed_doc = aw.Document(file_name=ARTIFACTS_DIR + 'DigitalSignatureUtil.docx') +signature = signed_doc.digital_signatures[0] +self.assertEqual(1, signed_doc.digital_signatures.count) +self.assertTrue(signature.is_valid) +self.assertEqual('10.0', signature.windows_version) +self.assertEqual('16.0.19127', signature.application_version) +self.assertEqual('16.0.19127/27', signature.office_version) +self.assertEqual(1024, signature.horizontal_resolution) +self.assertEqual(768, signature.vertical_resolution) +self.assertEqual(24, signature.color_depth) +``` + +### See Also + +* module [aspose.words.digitalsignatures](../../) +* class [SignOptions](../) + diff --git a/english/python-net/aspose.words.digitalsignatures/signoptions/xml_dsig_level/_index.md b/english/python-net/aspose.words.digitalsignatures/signoptions/xml_dsig_level/_index.md index c40791167db..03f7a9eb648 100644 --- a/english/python-net/aspose.words.digitalsignatures/signoptions/xml_dsig_level/_index.md +++ b/english/python-net/aspose.words.digitalsignatures/signoptions/xml_dsig_level/_index.md @@ -5,7 +5,7 @@ articleTitle: xml_dsig_level property second_title: Aspose.Words for Python description: "SignOptions.xml_dsig_level property. Specifies the level of a digital signature based on XML-DSig standard" type: docs -weight: 80 +weight: 140 url: /python-net/aspose.words.digitalsignatures/signoptions/xml_dsig_level/ --- diff --git a/english/python-net/aspose.words/document/_index.md b/english/python-net/aspose.words/document/_index.md index 282319d1947..715e88e2665 100644 --- a/english/python-net/aspose.words/document/_index.md +++ b/english/python-net/aspose.words/document/_index.md @@ -182,6 +182,7 @@ In Microsoft Word, a valid document needs to have at least one section. |[ get_text()](../node/get_text/#default) | Gets the text of this node and of all its children.
(Inherited from [Node](../node/)) | |[ import_node(src_node, is_import_children)](../documentbase/import_node/#node_bool) | Imports a node from another document to the current document.
(Inherited from [DocumentBase](../documentbase/)) | |[ import_node(src_node, is_import_children, import_format_mode)](../documentbase/import_node/#node_bool_importformatmode) | Imports a node from another document to the current document with an option to control formatting.
(Inherited from [DocumentBase](../documentbase/)) | +|[ import_node(src_node, is_import_children, import_format_mode, import_format_options)](../documentbase/import_node/#node_bool_importformatmode_importformatoptions) | Imports a node from another document to the current document with an option to control formatting.
(Inherited from [DocumentBase](../documentbase/)) | |[ index_of(child)](../compositenode/index_of/#node) | Returns the index of the specified child node in the child node array.
(Inherited from [CompositeNode](../compositenode/)) | |[ insert_after(new_child, ref_child)](../compositenode/insert_after/#node_node) | Inserts the specified node immediately after the specified reference node.
(Inherited from [CompositeNode](../compositenode/)) | |[ insert_before(new_child, ref_child)](../compositenode/insert_before/#node_node) | Inserts the specified node immediately before the specified reference node.
(Inherited from [CompositeNode](../compositenode/)) | diff --git a/english/python-net/aspose.words/documentbase/_index.md b/english/python-net/aspose.words/documentbase/_index.md index d03a1d78a95..4a18bea464c 100644 --- a/english/python-net/aspose.words/documentbase/_index.md +++ b/english/python-net/aspose.words/documentbase/_index.md @@ -72,6 +72,7 @@ root node of the tree that contains all other nodes of the document. |[ get_text()](../node/get_text/#default) | Gets the text of this node and of all its children.
(Inherited from [Node](../node/)) | |[ import_node(src_node, is_import_children)](./import_node/#node_bool) | Imports a node from another document to the current document. | |[ import_node(src_node, is_import_children, import_format_mode)](./import_node/#node_bool_importformatmode) | Imports a node from another document to the current document with an option to control formatting. | +|[ import_node(src_node, is_import_children, import_format_mode, import_format_options)](./import_node/#node_bool_importformatmode_importformatoptions) | Imports a node from another document to the current document with an option to control formatting. | |[ index_of(child)](../compositenode/index_of/#node) | Returns the index of the specified child node in the child node array.
(Inherited from [CompositeNode](../compositenode/)) | |[ insert_after(new_child, ref_child)](../compositenode/insert_after/#node_node) | Inserts the specified node immediately after the specified reference node.
(Inherited from [CompositeNode](../compositenode/)) | |[ insert_before(new_child, ref_child)](../compositenode/insert_before/#node_node) | Inserts the specified node immediately before the specified reference node.
(Inherited from [CompositeNode](../compositenode/)) | diff --git a/english/python-net/aspose.words/documentbase/import_node/_index.md b/english/python-net/aspose.words/documentbase/import_node/_index.md index f2e57d52f13..4d469a9ad24 100644 --- a/english/python-net/aspose.words/documentbase/import_node/_index.md +++ b/english/python-net/aspose.words/documentbase/import_node/_index.md @@ -87,6 +87,49 @@ of the source node is created. +### Returns + +The cloned, imported node. The node belongs to the destination document, but has no parent. + + +## import_node(src_node, is_import_children, import_format_mode, import_format_options) {#node_bool_importformatmode_importformatoptions} + +Imports a node from another document to the current document with an option to control formatting. + + + + +```python +def import_node(self, src_node: aspose.words.Node, is_import_children: bool, import_format_mode: aspose.words.ImportFormatMode, import_format_options: aspose.words.ImportFormatOptions): + ... +``` + +| Parameter | Type | Description | +| --- | --- | --- | +| src_node | [Node](../../node/) | The node to imported. | +| is_import_children | bool | ``True`` to import all child nodes recursively; otherwise, ``False``. | +| import_format_mode | [ImportFormatMode](../../importformatmode/) | Specifies how to merge style formatting that clashes. | +| import_format_options | [ImportFormatOptions](../../importformatoptions/) | Allows to specify various additional formating options. | + +### Remarks + +This overload is useful to control how styles and list formatting are imported. + +Importing a node creates a copy of the source node belonging to the importing document. +The returned node has no parent. The source node is not altered or removed from the original document. + +Before a node from another document can be inserted into this document, it must be imported. +During import, document-specific properties such as references to styles and lists are translated +from the original to the importing document. After the node was imported, it can be inserted +into the appropriate place in the document using [CompositeNode.insert_before()](../../compositenode/insert_before/#node_node) or +[CompositeNode.insert_after()](../../compositenode/insert_after/#node_node). + +If the source node already belongs to the destination document, then simply a deep clone +of the source node is created. + + + + ### Returns The cloned, imported node. The node belongs to the destination document, but has no parent. @@ -144,6 +187,26 @@ self.assertEqual(dst_style.font.name, dst_doc.styles.get_by_name('My style').fon self.assertEqual(src_style.font.name, dst_doc.styles.get_by_name('My style_0').font.name) ``` +Shows how to import a node with resolving source theme colors of shapes. + +```python +src_doc = aw.Document() +builder = aw.DocumentBuilder(doc=src_doc) +# Move to the primary footer and insert a shape that uses theme colors. +builder.move_to_header_footer(aw.HeaderFooterType.FOOTER_PRIMARY) +shape = builder.insert_shape(shape_type=aw.drawing.ShapeType.RECTANGLE, width=100, height=50) +shape.stroke.fore_theme_color = aw.themes.ThemeColor.DARK1 +dst_doc = aw.Document() +# Import the source footer into the destination document with theme colors resolved, +# so the shape preserves its actual color from the source document. +footer = src_doc.first_section.headers_footers.get_by_header_footer_type(aw.HeaderFooterType.FOOTER_PRIMARY) +options = aw.ImportFormatOptions() +options.resolve_theme_colors = True +imported_footer = dst_doc.import_node(src_node=footer, is_import_children=True, import_format_mode=aw.ImportFormatMode.KEEP_SOURCE_FORMATTING, import_format_options=options).as_header_footer() +dst_doc.first_section.headers_footers.add(imported_footer) +dst_doc.save(file_name=ARTIFACTS_DIR + 'DocumentBase.ImportNodeWithResolveThemeColors.docx') +``` + ## See Also * module [aspose.words](../../) diff --git a/english/python-net/aspose.words/documentbuilder/insert_html/_index.md b/english/python-net/aspose.words/documentbuilder/insert_html/_index.md index ebfc2a00422..db208a4fc8a 100644 --- a/english/python-net/aspose.words/documentbuilder/insert_html/_index.md +++ b/english/python-net/aspose.words/documentbuilder/insert_html/_index.md @@ -48,7 +48,7 @@ def insert_html(self, html: str, use_builder_formatting: bool): You can use this method to insert an HTML fragment or whole HTML document. When *useBuilderFormatting* is``False``, -[DocumentBuilder](../) formating is ignored and formatting of inserted text +[DocumentBuilder](../) formatting is ignored and formatting of inserted text is based on default HTML formatting. As a result, the text looks as it is rendered in browsers. diff --git a/english/python-net/aspose.words/importformatoptions/_index.md b/english/python-net/aspose.words/importformatoptions/_index.md index 14f02054463..76e42d33435 100644 --- a/english/python-net/aspose.words/importformatoptions/_index.md +++ b/english/python-net/aspose.words/importformatoptions/_index.md @@ -33,6 +33,7 @@ To learn more, visit the [Specify Load Options](https://docs.aspose.com/words/py | [ignore_text_boxes](./ignore_text_boxes/) | Gets or sets a boolean value that specifies that source formatting of textboxes content ignored if [ImportFormatMode.KEEP_SOURCE_FORMATTING](../importformatmode/#KEEP_SOURCE_FORMATTING) mode is used. The default value is ``True``. | | [keep_source_numbering](./keep_source_numbering/) | Gets or sets a boolean value that specifies how the numbering will be imported when it clashes in source and destination documents. The default value is ``False``. | | [merge_pasted_lists](./merge_pasted_lists/) | Gets or sets a boolean value that specifies whether pasted lists will be merged with surrounding lists. The default value is ``False``. | +| [resolve_theme_colors](./resolve_theme_colors/) | Gets or sets a boolean value that specifies whether to resolve theme colors of the shapes forcibly. The default value is ``False``. | | [smart_style_behavior](./smart_style_behavior/) | Gets or sets a boolean value that specifies how styles will be imported when they have equal names in source and destination documents. The default value is ``False``. | ### Examples diff --git a/english/python-net/aspose.words/importformatoptions/resolve_theme_colors/_index.md b/english/python-net/aspose.words/importformatoptions/resolve_theme_colors/_index.md new file mode 100644 index 00000000000..47b1ca9dcc3 --- /dev/null +++ b/english/python-net/aspose.words/importformatoptions/resolve_theme_colors/_index.md @@ -0,0 +1,72 @@ +--- +title: ImportFormatOptions.resolve_theme_colors property +linktitle: resolve_theme_colors property +articleTitle: resolve_theme_colors property +second_title: Aspose.Words for Python +description: "ImportFormatOptions.resolve_theme_colors property. Gets or sets a boolean value that specifies whether to resolve theme colors of the shapes forcibly" +type: docs +weight: 90 +url: /python-net/aspose.words/importformatoptions/resolve_theme_colors/ +--- + +## ImportFormatOptions.resolve_theme_colors property + +Gets or sets a boolean value that specifies whether to resolve theme colors of the shapes forcibly. +The default value is ``False``. + + + +```python +@property +def resolve_theme_colors(self) -> bool: + ... + +@resolve_theme_colors.setter +def resolve_theme_colors(self, value: bool): + ... + +``` + +### Remarks + +Please note that this option is only relevant for the [ImportFormatMode.KEEP_SOURCE_FORMATTING](../../importformatmode/#KEEP_SOURCE_FORMATTING) mode. + + +Normally, Aspose.Words doesn't resolve source theme colors when importing styles can be preserved +without expanding formatting attributes into direct ones. However, in this case the actual colors +of the imported shapes can differ from the ones they had in the original document. The reason for +this is the different theme colors in the source and destination documents. Setting this option +to ``True`` forces to resolve source shape theme colors and hence to preserve the actual +color of the shapes they have in the source document. + + + + + +### Examples + +Shows how to import a node with resolving source theme colors of shapes. + +```python +src_doc = aw.Document() +builder = aw.DocumentBuilder(doc=src_doc) +# Move to the primary footer and insert a shape that uses theme colors. +builder.move_to_header_footer(aw.HeaderFooterType.FOOTER_PRIMARY) +shape = builder.insert_shape(shape_type=aw.drawing.ShapeType.RECTANGLE, width=100, height=50) +shape.stroke.fore_theme_color = aw.themes.ThemeColor.DARK1 +dst_doc = aw.Document() +# Import the source footer into the destination document with theme colors resolved, +# so the shape preserves its actual color from the source document. +footer = src_doc.first_section.headers_footers.get_by_header_footer_type(aw.HeaderFooterType.FOOTER_PRIMARY) +options = aw.ImportFormatOptions() +options.resolve_theme_colors = True +imported_footer = dst_doc.import_node(src_node=footer, is_import_children=True, import_format_mode=aw.ImportFormatMode.KEEP_SOURCE_FORMATTING, import_format_options=options).as_header_footer() +dst_doc.first_section.headers_footers.add(imported_footer) +dst_doc.save(file_name=ARTIFACTS_DIR + 'DocumentBase.ImportNodeWithResolveThemeColors.docx') +``` + +### See Also + +* module [aspose.words](../../) +* class [ImportFormatOptions](../) + diff --git a/english/python-net/aspose.words/importformatoptions/smart_style_behavior/_index.md b/english/python-net/aspose.words/importformatoptions/smart_style_behavior/_index.md index 21c283fb961..48fe42c3726 100644 --- a/english/python-net/aspose.words/importformatoptions/smart_style_behavior/_index.md +++ b/english/python-net/aspose.words/importformatoptions/smart_style_behavior/_index.md @@ -5,7 +5,7 @@ articleTitle: smart_style_behavior property second_title: Aspose.Words for Python description: "ImportFormatOptions.smart_style_behavior property. Gets or sets a boolean value that specifies how styles will be imported when they have equal names in source and destination documents" type: docs -weight: 90 +weight: 100 url: /python-net/aspose.words/importformatoptions/smart_style_behavior/ ---