pdfform.js icon indicating copy to clipboard operation
pdfform.js copied to clipboard

stream must have data

Open shuaixieca opened this issue 4 years ago • 1 comments

Hi, I got an error when implement in my local laptop, anyone could help me?

pdfform.pdf_js.js:formatted:2911 Uncaught Error: stream must have data at error (pdfform.pdf_js.js:formatted:2911) at assert (pdfform.pdf_js.js:formatted:2922) at PDFDocument.init (pdfform.pdf_js.js:formatted:4979) at new PDFDocument (pdfform.pdf_js.js:formatted:4973) at Object.pdf_js.parse (pdfform.pdf_js.js:formatted:37295) at Object.transform (pdfform.pdf_js.js:formatted:37671) at pdfform-test.php:9

source code:

<?php ?>

<script src="js/pdfform.pdf_js.js"></script>
<script>
    var pdf_buf = "template2.pdf" // load PDF into an ArrayBuffer, for example via XHR (see demo)
    var fields = {
        'name': 'test',
        'checkbox': "True"
    };
    var out_buf = pdfform().transform(pdf_buf, fields);
    // Do something with the resulting PDF file in out_buf
</script>

shuaixieca avatar Jul 15 '20 00:07 shuaixieca

Same issue for me with some PDF's, any solutions?

theryan722 avatar Jul 20 '20 14:07 theryan722