本文介绍了makepdf javascript问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hallo我不是JS程序员,但有一个朋友要我写一个小表格,最后应该生成pdf文档.所以我认为那不可能那么难.最后,我找到了以下引擎.但是我无法使其正常运行.我引用了pdfmake.min.js ;vfs_fonts.js ;jquery.min.js.有人使用过该引擎吗?并能够产生一个pdf.并尝试了以下示例代码:

Hallo I'm not an js programmer but a frind asked me to write an litle form wich should produce an pdf document at the end. So I thought that could't be so dificult.Finally I found the following engine. But I'm unable to get it working. I incuded pdfmake.min.js ;vfs_fonts.js ;jquery.min.js.Had anyone already used this engine? And was able to produce an pdf.and tried this example code:

<script type=\"text/javascript?\" charset=\"utf-8\">

var docDefinition = { content: 'This is an sample PDF printed with pdfMake' };
pdfMake.createPdf(docDefinition).open(test.pdf);

</script>

推荐答案

问题是 test.pdf 不在引号中.试试这个,

The problem is, test.pdf is not in quotes. Try this,

<script>
    var docDefinition = { content: 'This is an sample PDF printed with   pdfMake' };
    pdfMake.createPdf(docDefinition).open('test.pdf');
</script>

这篇关于makepdf javascript问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 13:20