javascript - Meteor 1.4 and pdfmake -
i trying generate simple pdf meteor application. code in method is:
var fonts = { roboto: { normal: process.cwd().split('.meteor')[0] + "public/fonts/roboto -regular.ttf", bold: process.cwd().split('.meteor')[0] + "public/fonts/roboto-medium.ttf", italics: process.cwd().split('.meteor')[0] + "public/fonts/roboto-italic.ttf", bolditalics: process.cwd().split('.meteor')[0]+ "public/fonts/roboto-italic.ttf" } }; var pdfprinter = require('pdfmake/src/printer'); var printer = new pdfprinter(fonts); export const generateprojectlistpdf = () =>{ var docdefinition = { content: 'this sample pdf printed pdfmake' }; var pdfdoc = printer.createpdfkitdocument(docdefinition); pdfdoc.pipe(fs.createwritestream('pdfs/lists.pdf')); pdfdoc.end(); }
i geting error fs.readfilesync not function. file font.js, pdfmake package. idea how solve challenge.
edit
i using themeteorchef base, , react-router. have created font folder inside public folder , placed fonts there.
Comments
Post a Comment