Skip to content

Commit 1cf30bb

Browse files
Merge pull request #179 from aspose-words/main
Aspose.Words for Node.js via .Net API references
2 parents f5176b3 + d539bfa commit 1cf30bb

File tree

58 files changed

+1179
-1278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1179
-1278
lines changed

english/nodejs-net/Aspose.Words.DigitalSignatures/certificateholder/_index.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -38,51 +38,6 @@ This class is applied in [DigitalSignatureUtil](../digitalsignatureutil/) and [P
3838

3939
### Examples
4040

41-
Shows how to digitally sign documents.
42-
43-
```js
44-
// Create an X.509 certificate from a PKCS#12 store, which should contain a private key.
45-
let certificateHolder = aw.DigitalSignatures.CertificateHolder.create(base.myDir + "morzal.pfx", "aw");
46-
47-
// Create a comment and date which will be applied with our new digital signature.
48-
let signOptions = new aw.DigitalSignatures.SignOptions
49-
{
50-
Comments = "My comment",
51-
SignTime = Date.now()
52-
};
53-
54-
// Take an unsigned document from the local file system via a file stream,
55-
// then create a signed copy of it determined by the filename of the output file stream.
56-
using (Stream streamIn = new FileStream(base.myDir + "Document.docx", FileMode.open))
57-
{
58-
using (Stream streamOut = new FileStream(base.artifactsDir + "DigitalSignatureUtil.SignDocument.docx", FileMode.OpenOrCreate))
59-
{
60-
aw.DigitalSignatures.DigitalSignatureUtil.sign(streamIn, streamOut, certificateHolder, signOptions);
61-
}
62-
}
63-
```
64-
65-
Shows how to sign encrypted document file.
66-
67-
```js
68-
// Create an X.509 certificate from a PKCS#12 store, which should contain a private key.
69-
let certificateHolder = aw.DigitalSignatures.CertificateHolder.create(base.myDir + "morzal.pfx", "aw");
70-
71-
// Create a comment, date, and decryption password which will be applied with our new digital signature.
72-
let signOptions = new aw.DigitalSignatures.SignOptions
73-
{
74-
Comments = "Comment",
75-
SignTime = Date.now(),
76-
DecryptionPassword = "docPassword"
77-
};
78-
79-
// Set a local system filename for the unsigned input document, and an output filename for its new digitally signed copy.
80-
string inputFileName = base.myDir + "Encrypted.docx";
81-
string outputFileName = base.artifactsDir + "DigitalSignatureUtil.decryptionPassword.docx";
82-
83-
aw.DigitalSignatures.DigitalSignatureUtil.sign(inputFileName, outputFileName, certificateHolder, signOptions);
84-
```
85-
8641
Shows how to add a signature line to a document, and then sign it using a digital certificate.
8742

8843
```js
@@ -142,6 +97,51 @@ function createSignees() {
14297
}
14398
```
14499

100+
Shows how to digitally sign documents.
101+
102+
```js
103+
// Create an X.509 certificate from a PKCS#12 store, which should contain a private key.
104+
let certificateHolder = aw.DigitalSignatures.CertificateHolder.create(base.myDir + "morzal.pfx", "aw");
105+
106+
// Create a comment and date which will be applied with our new digital signature.
107+
let signOptions = new aw.DigitalSignatures.SignOptions
108+
{
109+
Comments = "My comment",
110+
SignTime = Date.now()
111+
};
112+
113+
// Take an unsigned document from the local file system via a file stream,
114+
// then create a signed copy of it determined by the filename of the output file stream.
115+
using (Stream streamIn = new FileStream(base.myDir + "Document.docx", FileMode.open))
116+
{
117+
using (Stream streamOut = new FileStream(base.artifactsDir + "DigitalSignatureUtil.SignDocument.docx", FileMode.OpenOrCreate))
118+
{
119+
aw.DigitalSignatures.DigitalSignatureUtil.sign(streamIn, streamOut, certificateHolder, signOptions);
120+
}
121+
}
122+
```
123+
124+
Shows how to sign encrypted document file.
125+
126+
```js
127+
// Create an X.509 certificate from a PKCS#12 store, which should contain a private key.
128+
let certificateHolder = aw.DigitalSignatures.CertificateHolder.create(base.myDir + "morzal.pfx", "aw");
129+
130+
// Create a comment, date, and decryption password which will be applied with our new digital signature.
131+
let signOptions = new aw.DigitalSignatures.SignOptions
132+
{
133+
Comments = "Comment",
134+
SignTime = Date.now(),
135+
DecryptionPassword = "docPassword"
136+
};
137+
138+
// Set a local system filename for the unsigned input document, and an output filename for its new digitally signed copy.
139+
string inputFileName = base.myDir + "Encrypted.docx";
140+
string outputFileName = base.artifactsDir + "DigitalSignatureUtil.decryptionPassword.docx";
141+
142+
aw.DigitalSignatures.DigitalSignatureUtil.sign(inputFileName, outputFileName, certificateHolder, signOptions);
143+
```
144+
145145
### See Also
146146

147147
* module [Aspose.Words.DigitalSignatures](../)

english/nodejs-net/Aspose.Words.Fields/fieldtype/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ Specifies Microsoft Word field types.
118118

119119
### Examples
120120

121+
Shows how to insert a field into a document using a field code.
122+
123+
```js
124+
let doc = new aw.Document();
125+
let builder = new aw.DocumentBuilder(doc);
126+
127+
let field = builder.insertField("DATE \\@ \"dddd, MMMM dd, yyyy\"");
128+
129+
expect(field.type).toEqual(aw.Fields.FieldType.FieldDate);
130+
expect(field.getFieldCode()).toEqual("DATE \\@ \"dddd, MMMM dd, yyyy\"");
131+
132+
// This overload of the InsertField method automatically updates inserted fields.
133+
expect((Date.now() - Date.parse(field.result)) / 86400000).toBeLessThanOrEqual(1);
134+
```
135+
121136
Shows how to work with a FieldStart node.
122137

123138
```js
@@ -144,21 +159,6 @@ expect(field.getFieldCode()).toEqual(" DATE \\@ \"dddd, MMMM dd, yyyy\"");
144159
field.update();
145160
```
146161

147-
Shows how to insert a field into a document using a field code.
148-
149-
```js
150-
let doc = new aw.Document();
151-
let builder = new aw.DocumentBuilder(doc);
152-
153-
let field = builder.insertField("DATE \\@ \"dddd, MMMM dd, yyyy\"");
154-
155-
expect(field.type).toEqual(aw.Fields.FieldType.FieldDate);
156-
expect(field.getFieldCode()).toEqual("DATE \\@ \"dddd, MMMM dd, yyyy\"");
157-
158-
// This overload of the InsertField method automatically updates inserted fields.
159-
expect((Date.now() - Date.parse(field.result)) / 86400000).toBeLessThanOrEqual(1);
160-
```
161-
162162
### See Also
163163

164164
* module [Aspose.Words.Fields](../)

english/nodejs-net/Aspose.Words.Loading/chmloadoptions/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To learn more, visit the [Specify Load Options](https://docs.aspose.com/words/no
4040
| [originalFileName](./originalFileName/) | The name of the CHM file. Default value is ``null``. |
4141
| [password](../loadoptions/password/) | Gets or sets the password for opening an encrypted document. Can be ``null`` or empty string. Default is ``null``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4242
| [preserveIncludePictureField](../loadoptions/preserveIncludePictureField/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``false``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
43-
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
43+
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
4444
| [resourceLoadingCallback](../loadoptions/resourceLoadingCallback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4545
| [tempFolder](../loadoptions/tempFolder/) | Allows to use temporary files when reading document. By default this property is ``null`` and no temporary files are used.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4646
| [updateDirtyFields](../loadoptions/updateDirtyFields/) | Specifies whether to update the fields with the ``dirty`` attribute.<br>(Inherited from [LoadOptions](../loadoptions/)) |

english/nodejs-net/Aspose.Words.Loading/htmlloadoptions/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To learn more, visit the [Specify Load Options](https://docs.aspose.com/words/no
4545
| [password](../loadoptions/password/) | Gets or sets the password for opening an encrypted document. Can be ``null`` or empty string. Default is ``null``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4646
| [preferredControlType](./preferredControlType/) | Gets or sets preferred type of document nodes that will represent imported \<input\> and \<select\> elements. Default value is [HtmlControlType.FormField](../htmlcontroltype/#FormField). |
4747
| [preserveIncludePictureField](../loadoptions/preserveIncludePictureField/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``false``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
48-
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
48+
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
4949
| [resourceLoadingCallback](../loadoptions/resourceLoadingCallback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.<br>(Inherited from [LoadOptions](../loadoptions/)) |
5050
| [supportFontFaceRules](./supportFontFaceRules/) | Gets or sets a value indicating whether to support @font-face rules and whether to load declared fonts. Default value is ``false``. |
5151
| [supportVml](./supportVml/) | Gets or sets a value indicating whether to support VML images. |

english/nodejs-net/Aspose.Words.Loading/loadoptions/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To learn more, visit the [Specify Load Options](https://docs.aspose.com/words/no
4040
| [mswVersion](./mswVersion/) | Allows to specify that the document loading process should match a specific MS Word version. Default value is [MsWordVersion.Word2019](../../aspose.words.settings/mswordversion/#Word2019) |
4141
| [password](./password/) | Gets or sets the password for opening an encrypted document. Can be ``null`` or empty string. Default is ``null``. |
4242
| [preserveIncludePictureField](./preserveIncludePictureField/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``false``. |
43-
| [recoveryMode](./recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover). |
43+
| [recoveryMode](./recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover). |
4444
| [resourceLoadingCallback](./resourceLoadingCallback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. |
4545
| [tempFolder](./tempFolder/) | Allows to use temporary files when reading document. By default this property is ``null`` and no temporary files are used. |
4646
| [updateDirtyFields](./updateDirtyFields/) | Specifies whether to update the fields with the ``dirty`` attribute. |

english/nodejs-net/Aspose.Words.Loading/loadoptions/recoveryMode/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ url: /nodejs-net/aspose.words.loading/loadoptions/recoveryMode/
1111

1212
## LoadOptions.recoveryMode property
1313

14-
Defines how the document should be handled if errors occur during loading.
15-
Use this property to specify whether the system should attempt to recover the document
16-
or follow another defined behavior.
17-
The default value is [DocumentRecoveryMode.TryRecover](../../documentrecoverymode/#TryRecover).
14+
Defines how the document should be handled if errors occur during loading.
15+
Use this property to specify whether the system should attempt to recover the document
16+
or follow another defined behavior.
17+
The default value is [DocumentRecoveryMode.TryRecover](../../documentrecoverymode/#TryRecover).
1818

1919

2020

english/nodejs-net/Aspose.Words.Loading/loadoptions/tempFolder/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,6 @@ Aspose.Words automatically deletes all temporary files when reading is complete.
3131

3232
### Examples
3333

34-
Shows how to load a document using temporary files.
35-
36-
```js
37-
// Note that such an approach can reduce memory usage but degrades speed
38-
const loadOptions = new aw.Loading.LoadOptions();
39-
loadOptions.tempFolder = "C:\\Temp\\";
40-
41-
// Ensure that the directory exists and load
42-
if (!fs.existsSync(loadOptions.tempFolder)){
43-
fs.mkdirSync(loadOptions.tempFolder);
44-
}
45-
46-
const doc = new aw.Document(base.myDir + "Document.docx", loadOptions);
47-
```
48-
4934
Shows how to use the hard drive instead of memory when loading a document.
5035

5136
```js
@@ -66,6 +51,21 @@ let doc = new aw.Document(base.myDir + "Document.docx", options);
6651
expect(fs.readdirSync(options.tempFolder).length).toEqual(0);
6752
```
6853

54+
Shows how to load a document using temporary files.
55+
56+
```js
57+
// Note that such an approach can reduce memory usage but degrades speed
58+
const loadOptions = new aw.Loading.LoadOptions();
59+
loadOptions.tempFolder = "C:\\Temp\\";
60+
61+
// Ensure that the directory exists and load
62+
if (!fs.existsSync(loadOptions.tempFolder)){
63+
fs.mkdirSync(loadOptions.tempFolder);
64+
}
65+
66+
const doc = new aw.Document(base.myDir + "Document.docx", loadOptions);
67+
```
68+
6969
### See Also
7070

7171
* module [Aspose.Words.Loading](../../)

english/nodejs-net/Aspose.Words.Loading/markdownloadoptions/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Allows to specify additional options when loading [LoadFormat.Markdown](../../as
3939
| [password](../loadoptions/password/) | Gets or sets the password for opening an encrypted document. Can be ``null`` or empty string. Default is ``null``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4040
| [preserveEmptyLines](./preserveEmptyLines/) | Gets or sets a boolean value indicating whether to preserve empty lines while load a [LoadFormat.Markdown](../../aspose.words/loadformat/#Markdown) document. The default value is ``false``. Normally, empty lines between block-level elements in Markdown are ignored. Empty lines at the beginning and end of the document are also ignored. This option allows to import such empty lines. |
4141
| [preserveIncludePictureField](../loadoptions/preserveIncludePictureField/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``false``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
42-
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
42+
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
4343
| [resourceLoadingCallback](../loadoptions/resourceLoadingCallback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4444
| [softLineBreakCharacter](./softLineBreakCharacter/) | Gets or sets a character value representing `soft line break`. The default value is ``SPACE (U+0020)``. |
4545
| [tempFolder](../loadoptions/tempFolder/) | Allows to use temporary files when reading document. By default this property is ``null`` and no temporary files are used.<br>(Inherited from [LoadOptions](../loadoptions/)) |

english/nodejs-net/Aspose.Words.Loading/pdfloadoptions/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To learn more, visit the [Specify Load Options](https://docs.aspose.com/words/no
4141
| [pageIndex](./pageIndex/) | Gets or sets the 0-based index of the first page to read. Default is 0. |
4242
| [password](../loadoptions/password/) | Gets or sets the password for opening an encrypted document. Can be ``null`` or empty string. Default is ``null``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4343
| [preserveIncludePictureField](../loadoptions/preserveIncludePictureField/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``false``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
44-
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
44+
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
4545
| [resourceLoadingCallback](../loadoptions/resourceLoadingCallback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4646
| [skipPdfImages](./skipPdfImages/) | Gets or sets the flag indicating whether images must be skipped while loading PDF document. Default is ``false``. |
4747
| [tempFolder](../loadoptions/tempFolder/) | Allows to use temporary files when reading document. By default this property is ``null`` and no temporary files are used.<br>(Inherited from [LoadOptions](../loadoptions/)) |

english/nodejs-net/Aspose.Words.Loading/rtfloadoptions/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To learn more, visit the [Specify Load Options](https://docs.aspose.com/words/no
4040
| [password](../loadoptions/password/) | Gets or sets the password for opening an encrypted document. Can be ``null`` or empty string. Default is ``null``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4141
| [preserveIncludePictureField](../loadoptions/preserveIncludePictureField/) | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is ``false``.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4242
| [recognizeUtf8Text](./recognizeUtf8Text/) | When set to ``true``, will try to detect UTF8 characters, they will be preserved during import. |
43-
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
43+
| [recoveryMode](../loadoptions/recoveryMode/) | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is [DocumentRecoveryMode.TryRecover](../documentrecoverymode/#TryRecover).<br>(Inherited from [LoadOptions](../loadoptions/)) |
4444
| [resourceLoadingCallback](../loadoptions/resourceLoadingCallback/) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4545
| [tempFolder](../loadoptions/tempFolder/) | Allows to use temporary files when reading document. By default this property is ``null`` and no temporary files are used.<br>(Inherited from [LoadOptions](../loadoptions/)) |
4646
| [updateDirtyFields](../loadoptions/updateDirtyFields/) | Specifies whether to update the fields with the ``dirty`` attribute.<br>(Inherited from [LoadOptions](../loadoptions/)) |

0 commit comments

Comments
 (0)