Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>(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.<br>(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.<br>(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.<br>(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.<br>(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.<br>(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.<br>(Inherited from [CompositeNode](../../aspose.words/compositenode/)) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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](../)

Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
@@ -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](../)

Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
@@ -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](../)

Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
@@ -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](../)

Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
---

Expand Down
Original file line number Diff line number Diff line change
@@ -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](../)

Original file line number Diff line number Diff line change
@@ -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](../)

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading