Add new demo and remove tslint disable
This commit is contained in:
15
demo/demo25.js
Normal file
15
demo/demo25.js
Normal file
@ -0,0 +1,15 @@
|
||||
const fs = require("fs");
|
||||
const docx = require("../build");
|
||||
|
||||
var doc = new docx.Document();
|
||||
|
||||
var paragraph = new docx.Paragraph("Hello World");
|
||||
var institutionText = new docx.TextRun("Foo").bold();
|
||||
var dateText = new docx.TextRun("Bar").tab().bold();
|
||||
paragraph.addRun(institutionText);
|
||||
paragraph.addRun(dateText);
|
||||
|
||||
doc.addParagraph(paragraph);
|
||||
|
||||
var exporter = new docx.LocalPacker(doc);
|
||||
exporter.packPdf("My Document");
|
@ -174,6 +174,14 @@ Example showing how to use the Buffer packer and then write that buffer to the f
|
||||
|
||||
_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo19.js_
|
||||
|
||||
## PDF Packing
|
||||
|
||||
Example of how to use the `LocalPacker` to create a PDF document
|
||||
|
||||
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo25.js ":include")
|
||||
|
||||
_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo25.js_
|
||||
|
||||
## Bookmarks
|
||||
|
||||
Example showing how to make bookmarks to make internal hyperlinks within the document
|
||||
|
@ -1,5 +1,3 @@
|
||||
// tslint:disable:object-literal-key-quotes
|
||||
// This tslint disable is needed, or it simply won't work
|
||||
import * as fs from "fs";
|
||||
import * as request from "request-promise";
|
||||
|
||||
|
Reference in New Issue
Block a user