diff --git a/demo/demo35.ts b/demo/demo35.ts index a91ad2347d..029c3fbfff 100644 --- a/demo/demo35.ts +++ b/demo/demo35.ts @@ -1,11 +1,12 @@ // Simple example to add text to a document // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph } from "../build"; + +const doc = new Document(); +const paragraph = new Paragraph(); +const link = doc.createHyperlink("http://www.example.com", "Hyperlink"); -var doc = new Document(); -var paragraph = new Paragraph(); -var link = doc.createHyperlink('http://www.example.com', 'Hyperlink'); link.bold(); paragraph.addHyperLink(link); doc.addParagraph(paragraph);