Added in the ability to create borders for paragraphs
This commit is contained in:
23
demo/demo26.js
Normal file
23
demo/demo26.js
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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);
|
||||
|
||||
let borderParagraph = new docx.Paragraph("I have a border on all but one side!");
|
||||
console.log(borderParagraph.Borders);
|
||||
borderParagraph.Borders.addTopBorder();
|
||||
borderParagraph.Borders.addBottomBorder();
|
||||
borderParagraph.Borders.addLeftBorder();
|
||||
console.log(borderParagraph.Borders);
|
||||
|
||||
doc.addParagraph(borderParagraph);
|
||||
|
||||
let exporter = new docx.LocalPacker(doc);
|
||||
exporter.packPdf('My Document');
|
Reference in New Issue
Block a user