mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
373 B
TypeScript
11 lines
373 B
TypeScript
import * as fs from 'fs';
|
|
import * as pdf from 'html-pdf';
|
|
|
|
var html = fs.readFileSync('./test/businesscard.html', 'utf8');
|
|
var options: pdf.CreateOptions = { format: 'Letter' };
|
|
|
|
pdf.create(html, options).toFile('./businesscard.pdf', (err: Error, res: pdf.FileInfo) => {
|
|
if (err) return console.log(err);
|
|
console.log(res); // { filename: '/app/businesscard.pdf' }
|
|
});
|