phihag/pdfform.js

I already spent an hour trying to implement it

Opened this issue · 3 comments

Can't anyone make it just work? I'm trying various ways to implement it - npm, via script tag, programatically...Come on, it should be plug'n'play

Can you share an error message you get? Does the official demo work for you?

Can you share any of your attempts at a public URL?

<script src="downloaded/pdfform.minipdf.dist.js"></script>
<script>
export default {
  mounted () { 
    var pdf_buf = 'formularz_eu.pdf' // load PDF into an ArrayBuffer, for example via XHR (see demo)
    var fields = {
        'fieldname': ['value for fieldname[0]', 'value for fieldname[1]'],
    };
    var out_buf = pdfform().transform(pdf_buf, fields);
  }
}
</script>

[Vue warn]: Error in mounted hook: "ReferenceError: pdfform is not defined"

Yes, I'm using Vue.js, but when I import other scripts like this they work.

Yes, official demo works really nice for me (both versions).

I can't share because of privacy issues.

use nuxt is fine , and i did some work to create an ts version of this because of it's not work well with webpack;