2018-08-19 11:59:38 -04:00
|
|
|
/*
|
|
|
|
* Creates two paragraphs, one with a border and one without
|
|
|
|
*/
|
|
|
|
|
|
|
|
const docx = require("../build");
|
|
|
|
|
|
|
|
let doc = new docx.Document();
|
|
|
|
|
|
|
|
let paragraph = new docx.Paragraph("No border!");
|
|
|
|
|
|
|
|
doc.addParagraph(paragraph);
|
|
|
|
|
2018-08-19 19:37:36 -04:00
|
|
|
let borderParagraph = new docx.Paragraph("I have borders on my top and bottom sides!").createBorder();
|
2018-08-19 11:59:38 -04:00
|
|
|
borderParagraph.Borders.addTopBorder();
|
|
|
|
borderParagraph.Borders.addBottomBorder();
|
|
|
|
|
|
|
|
doc.addParagraph(borderParagraph);
|
|
|
|
|
|
|
|
let exporter = new docx.LocalPacker(doc);
|
2018-08-19 19:37:36 -04:00
|
|
|
exporter.pack('My Document');
|