phihag/pdfform.js

Error filling out D&D 5e fillable character sheet

Opened this issue · 0 comments

Hi,

pdfform.js is a fantastic utility! I got it to work satisfactorily on my project to generate a filled-out character sheet for Dungeons & Dragons fifth edition: https://github.com/drogoganor/dndcharactermaker

However, I did get an error with the fillable form which I had to work around. Here's the PDF: https://media.wizards.com/2016/dnd/downloads/5E_CharacterSheet_Fillable.pdf

The error was 'doc.acroForm.map.Fields.slice is not a function' on line 291 of pdfform.js, in the function 'function visit_acroform_fields(doc, callback)'. My solution was to make this check always false, which makes the function use the fallback logic which worked. I just thought you might want to know.

Thanks again!