pdfmake use in an application with webpack

对着背影说爱祢 提交于 2019-12-13 14:18:58

问题


I'm just going to build an application in Webpack and would like to integrate pdfmake unfortunately I encounter this problems. I have the file "pdfmake.js" are in my "web_modules" folder and put them with

Var pdfmake = require(" pdfmake ");

When I call the:

pdfMake.createPdf(docDefinition).open ();

doing, he tells me "CreatePDF" is not a function that has struck me, and I found that I call the "File Saver" and not "pdfmake" get back at these locations. Has this happened to anyone of you have an idea? Thanks for your help!


回答1:


i solved my problem with the following code line: require("script!pdfmake"); You have to use the scriptloader from webpack.



来源:https://stackoverflow.com/questions/27421528/pdfmake-use-in-an-application-with-webpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!