Skip to content

Commit 0972564

Browse files
Merge pull request #154 from aspose-words/main
Aspose.Words for Node.js 25.8.0 api refs updated
2 parents 7a9fe95 + 83b748f commit 0972564

File tree

128 files changed

+1744
-1545
lines changed

Some content is hidden

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

128 files changed

+1744
-1545
lines changed

english/nodejs-net/Aspose.Words.Drawing/relativehorizontalposition/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,43 @@ Specifies to what the horizontal position of a shape or text frame is relative.
3030

3131
### Examples
3232

33-
Shows how to insert an image, and use it as a watermark.
33+
Shows how to insert a floating image to the center of a page.
3434

3535
```js
3636
let doc = new aw.Document();
3737
let builder = new aw.DocumentBuilder(doc);
3838

39-
// Insert the image into the header so that it will be visible on every page.
40-
builder.moveToHeaderFooter(aw.HeaderFooterType.HeaderPrimary);
41-
let shape = builder.insertImage(base.imageDir + "Transparent background logo.png");
39+
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
40+
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
4241
shape.wrapType = aw.Drawing.WrapType.None;
4342
shape.behindText = true;
44-
45-
// Place the image at the center of the page.
4643
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
4744
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
48-
shape.left = (builder.pageSetup.pageWidth - shape.width) / 2;
49-
shape.top = (builder.pageSetup.pageHeight - shape.height) / 2;
45+
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
46+
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
5047

51-
doc.save(base.artifactsDir + "DocumentBuilder.InsertWatermark.docx");
48+
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
5249
```
5350

54-
Shows how to insert a floating image to the center of a page.
51+
Shows how to insert an image, and use it as a watermark.
5552

5653
```js
5754
let doc = new aw.Document();
5855
let builder = new aw.DocumentBuilder(doc);
5956

60-
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
61-
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
57+
// Insert the image into the header so that it will be visible on every page.
58+
builder.moveToHeaderFooter(aw.HeaderFooterType.HeaderPrimary);
59+
let shape = builder.insertImage(base.imageDir + "Transparent background logo.png");
6260
shape.wrapType = aw.Drawing.WrapType.None;
6361
shape.behindText = true;
62+
63+
// Place the image at the center of the page.
6464
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
6565
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
66-
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
67-
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
66+
shape.left = (builder.pageSetup.pageWidth - shape.width) / 2;
67+
shape.top = (builder.pageSetup.pageHeight - shape.height) / 2;
6868

69-
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
69+
doc.save(base.artifactsDir + "DocumentBuilder.InsertWatermark.docx");
7070
```
7171

7272
### See Also

english/nodejs-net/Aspose.Words.Drawing/relativeverticalposition/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,43 @@ Specifies to what the vertical position of a shape or text frame is relative.
3131

3232
### Examples
3333

34-
Shows how to insert an image, and use it as a watermark.
34+
Shows how to insert a floating image to the center of a page.
3535

3636
```js
3737
let doc = new aw.Document();
3838
let builder = new aw.DocumentBuilder(doc);
3939

40-
// Insert the image into the header so that it will be visible on every page.
41-
builder.moveToHeaderFooter(aw.HeaderFooterType.HeaderPrimary);
42-
let shape = builder.insertImage(base.imageDir + "Transparent background logo.png");
40+
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
41+
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
4342
shape.wrapType = aw.Drawing.WrapType.None;
4443
shape.behindText = true;
45-
46-
// Place the image at the center of the page.
4744
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
4845
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
49-
shape.left = (builder.pageSetup.pageWidth - shape.width) / 2;
50-
shape.top = (builder.pageSetup.pageHeight - shape.height) / 2;
46+
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
47+
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
5148

52-
doc.save(base.artifactsDir + "DocumentBuilder.InsertWatermark.docx");
49+
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
5350
```
5451

55-
Shows how to insert a floating image to the center of a page.
52+
Shows how to insert an image, and use it as a watermark.
5653

5754
```js
5855
let doc = new aw.Document();
5956
let builder = new aw.DocumentBuilder(doc);
6057

61-
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
62-
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
58+
// Insert the image into the header so that it will be visible on every page.
59+
builder.moveToHeaderFooter(aw.HeaderFooterType.HeaderPrimary);
60+
let shape = builder.insertImage(base.imageDir + "Transparent background logo.png");
6361
shape.wrapType = aw.Drawing.WrapType.None;
6462
shape.behindText = true;
63+
64+
// Place the image at the center of the page.
6565
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
6666
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
67-
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
68-
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
67+
shape.left = (builder.pageSetup.pageWidth - shape.width) / 2;
68+
shape.top = (builder.pageSetup.pageHeight - shape.height) / 2;
6969

70-
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
70+
doc.save(base.artifactsDir + "DocumentBuilder.InsertWatermark.docx");
7171
```
7272

7373
### See Also

english/nodejs-net/Aspose.Words.Drawing/shape/_index.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -222,48 +222,6 @@ Shapes that can have text, can contain [Paragraph](../../aspose.words/paragraph/
222222

223223
### Examples
224224

225-
Shows how to delete all shapes from a document.
226-
227-
```js
228-
let doc = new aw.Document();
229-
let builder = new aw.DocumentBuilder(doc);
230-
231-
// Insert two shapes along with a group shape with another shape inside it.
232-
builder.insertShape(aw.Drawing.ShapeType.Rectangle, 400, 200);
233-
builder.insertShape(aw.Drawing.ShapeType.Star, 300, 300);
234-
235-
let group = new aw.Drawing.GroupShape(doc);
236-
group.bounds2 = new aw.JSRectangleF(100, 50, 200, 100);
237-
group.coordOrigin2 = new aw.JSPoint(-1000, -500);
238-
239-
let subShape = new aw.Drawing.Shape(doc, aw.Drawing.ShapeType.Cube);
240-
subShape.width = 500;
241-
subShape.height = 700;
242-
subShape.left = 0;
243-
subShape.top = 0;
244-
245-
group.appendChild(subShape);
246-
builder.insertNode(group);
247-
248-
expect(doc.getChildNodes(aw.NodeType.Shape, true).count).toEqual(3);
249-
expect(doc.getChildNodes(aw.NodeType.GroupShape, true).count).toEqual(1);
250-
251-
// Remove all Shape nodes from the document.
252-
let shapes = doc.getChildNodes(aw.NodeType.Shape, true);
253-
shapes.clear();
254-
255-
// All shapes are gone, but the group shape is still in the document.
256-
expect(doc.getChildNodes(aw.NodeType.GroupShape, true).count).toEqual(1);
257-
expect(doc.getChildNodes(aw.NodeType.Shape, true).count).toEqual(0);
258-
259-
// Remove all group shapes separately.
260-
let groupShapes = doc.getChildNodes(aw.NodeType.GroupShape, true);
261-
groupShapes.clear();
262-
263-
expect(doc.getChildNodes(aw.NodeType.GroupShape, true).count).toEqual(0);
264-
expect(doc.getChildNodes(aw.NodeType.Shape, true).count).toEqual(0);
265-
```
266-
267225
Shows how to extract images from a document, and save them to the local file system as individual files.
268226

269227
```js
@@ -309,6 +267,48 @@ shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
309267
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
310268
```
311269

270+
Shows how to delete all shapes from a document.
271+
272+
```js
273+
let doc = new aw.Document();
274+
let builder = new aw.DocumentBuilder(doc);
275+
276+
// Insert two shapes along with a group shape with another shape inside it.
277+
builder.insertShape(aw.Drawing.ShapeType.Rectangle, 400, 200);
278+
builder.insertShape(aw.Drawing.ShapeType.Star, 300, 300);
279+
280+
let group = new aw.Drawing.GroupShape(doc);
281+
group.bounds2 = new aw.JSRectangleF(100, 50, 200, 100);
282+
group.coordOrigin2 = new aw.JSPoint(-1000, -500);
283+
284+
let subShape = new aw.Drawing.Shape(doc, aw.Drawing.ShapeType.Cube);
285+
subShape.width = 500;
286+
subShape.height = 700;
287+
subShape.left = 0;
288+
subShape.top = 0;
289+
290+
group.appendChild(subShape);
291+
builder.insertNode(group);
292+
293+
expect(doc.getChildNodes(aw.NodeType.Shape, true).count).toEqual(3);
294+
expect(doc.getChildNodes(aw.NodeType.GroupShape, true).count).toEqual(1);
295+
296+
// Remove all Shape nodes from the document.
297+
let shapes = doc.getChildNodes(aw.NodeType.Shape, true);
298+
shapes.clear();
299+
300+
// All shapes are gone, but the group shape is still in the document.
301+
expect(doc.getChildNodes(aw.NodeType.GroupShape, true).count).toEqual(1);
302+
expect(doc.getChildNodes(aw.NodeType.Shape, true).count).toEqual(0);
303+
304+
// Remove all group shapes separately.
305+
let groupShapes = doc.getChildNodes(aw.NodeType.GroupShape, true);
306+
groupShapes.clear();
307+
308+
expect(doc.getChildNodes(aw.NodeType.GroupShape, true).count).toEqual(0);
309+
expect(doc.getChildNodes(aw.NodeType.Shape, true).count).toEqual(0);
310+
```
311+
312312
### See Also
313313

314314
* module [Aspose.Words.Drawing](../)

english/nodejs-net/Aspose.Words.Drawing/shapebase/wrapType/_index.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ Has effect only for top level shapes.
2929

3030
### Examples
3131

32+
Shows how to insert a floating image to the center of a page.
33+
34+
```js
35+
let doc = new aw.Document();
36+
let builder = new aw.DocumentBuilder(doc);
37+
38+
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
39+
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
40+
shape.wrapType = aw.Drawing.WrapType.None;
41+
shape.behindText = true;
42+
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
43+
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
44+
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
45+
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
46+
47+
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
48+
```
49+
3250
Shows how to create and format a text box.
3351

3452
```js
@@ -57,24 +75,6 @@ doc.firstSection.body.firstParagraph.appendChild(textBox);
5775
doc.save(base.artifactsDir + "Shape.CreateTextBox.docx");
5876
```
5977

60-
Shows how to insert a floating image to the center of a page.
61-
62-
```js
63-
let doc = new aw.Document();
64-
let builder = new aw.DocumentBuilder(doc);
65-
66-
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
67-
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
68-
shape.wrapType = aw.Drawing.WrapType.None;
69-
shape.behindText = true;
70-
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
71-
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
72-
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
73-
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
74-
75-
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
76-
```
77-
7878
### See Also
7979

8080
* module [Aspose.Words.Drawing](../../)

english/nodejs-net/Aspose.Words.Drawing/wraptype/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,43 @@ Specifies how text is wrapped around a shape or picture.
2727

2828
### Examples
2929

30-
Shows how to insert an image, and use it as a watermark.
30+
Shows how to insert a floating image to the center of a page.
3131

3232
```js
3333
let doc = new aw.Document();
3434
let builder = new aw.DocumentBuilder(doc);
3535

36-
// Insert the image into the header so that it will be visible on every page.
37-
builder.moveToHeaderFooter(aw.HeaderFooterType.HeaderPrimary);
38-
let shape = builder.insertImage(base.imageDir + "Transparent background logo.png");
36+
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
37+
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
3938
shape.wrapType = aw.Drawing.WrapType.None;
4039
shape.behindText = true;
41-
42-
// Place the image at the center of the page.
4340
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
4441
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
45-
shape.left = (builder.pageSetup.pageWidth - shape.width) / 2;
46-
shape.top = (builder.pageSetup.pageHeight - shape.height) / 2;
42+
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
43+
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
4744

48-
doc.save(base.artifactsDir + "DocumentBuilder.InsertWatermark.docx");
45+
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
4946
```
5047

51-
Shows how to insert a floating image to the center of a page.
48+
Shows how to insert an image, and use it as a watermark.
5249

5350
```js
5451
let doc = new aw.Document();
5552
let builder = new aw.DocumentBuilder(doc);
5653

57-
// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
58-
let shape = builder.insertImage(base.imageDir + "Logo.jpg");
54+
// Insert the image into the header so that it will be visible on every page.
55+
builder.moveToHeaderFooter(aw.HeaderFooterType.HeaderPrimary);
56+
let shape = builder.insertImage(base.imageDir + "Transparent background logo.png");
5957
shape.wrapType = aw.Drawing.WrapType.None;
6058
shape.behindText = true;
59+
60+
// Place the image at the center of the page.
6161
shape.relativeHorizontalPosition = aw.Drawing.RelativeHorizontalPosition.Page;
6262
shape.relativeVerticalPosition = aw.Drawing.RelativeVerticalPosition.Page;
63-
shape.horizontalAlignment = aw.Drawing.HorizontalAlignment.Center;
64-
shape.verticalAlignment = aw.Drawing.VerticalAlignment.Center;
63+
shape.left = (builder.pageSetup.pageWidth - shape.width) / 2;
64+
shape.top = (builder.pageSetup.pageHeight - shape.height) / 2;
6565

66-
doc.save(base.artifactsDir + "Image.CreateFloatingPageCenter.docx");
66+
doc.save(base.artifactsDir + "DocumentBuilder.InsertWatermark.docx");
6767
```
6868

6969
### See Also

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,6 @@ 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-
136121
Shows how to work with a FieldStart node.
137122

138123
```js
@@ -159,6 +144,21 @@ expect(field.getFieldCode()).toEqual(" DATE \\@ \"dddd, MMMM dd, yyyy\"");
159144
field.update();
160145
```
161146

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](../)

0 commit comments

Comments
 (0)