Format demo

This commit is contained in:
Dolan
2019-01-03 20:47:00 +00:00
parent dbfb80e660
commit bb277a4a76

View File

@ -1,11 +1,12 @@
// Simple example to add text to a document // Simple example to add text to a document
// 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 { 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(); link.bold();
paragraph.addHyperLink(link); paragraph.addHyperLink(link);
doc.addParagraph(paragraph); doc.addParagraph(paragraph);