Add hyperlink to demo
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
// Import from 'docx' rather than '../build' if you install from npm
|
// Import from 'docx' rather than '../build' if you install from npm
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
|
ExternalHyperlink,
|
||||||
HeadingLevel,
|
HeadingLevel,
|
||||||
ImageRun,
|
ImageRun,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
@ -39,7 +40,19 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
|
|||||||
},
|
},
|
||||||
footer_text: {
|
footer_text: {
|
||||||
type: PatchType.PARAGRAPH,
|
type: PatchType.PARAGRAPH,
|
||||||
children: [new TextRun("replaced just as well")],
|
children: [
|
||||||
|
new TextRun("replaced just as"),
|
||||||
|
new TextRun(" well"),
|
||||||
|
new ExternalHyperlink({
|
||||||
|
children: [
|
||||||
|
new TextRun({
|
||||||
|
text: "BBC News Link",
|
||||||
|
style: "Hyperlink",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
link: "https://www.bbc.co.uk/news",
|
||||||
|
}),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
image_test: {
|
image_test: {
|
||||||
type: PatchType.PARAGRAPH,
|
type: PatchType.PARAGRAPH,
|
||||||
|
Reference in New Issue
Block a user