jsPDF-AutoTable icon indicating copy to clipboard operation
jsPDF-AutoTable copied to clipboard

Allow cells to be TextFields

Open puyma opened this issue 3 years ago • 5 comments

Would be awesome in order to get input in a table.

puyma avatar May 22 '21 15:05 puyma

Sounds like a great improvement!

simonbengtsson avatar May 25 '21 15:05 simonbengtsson

@simonbengtsson @puyma to further clarify, do you mean having a td or th which has an input field nested within it to "act" as its value during pdf generation ?

<tr>
  <td>
    <input type="text" placeholder="enter name"/>
  </td>
</tr>

iamziike avatar Jun 02 '22 08:06 iamziike

@simonbengtsson @iamziike It would be as if, when adding a table to the jsPDF document, the body parameter accepted TextField objects. Then, once generated the pdf, the contents of the table would be editable as text fields are.

doc.autoTable({
    ...
    head: [
        ["first column", "second column"]
    ],
    body: [
        [**new TextField()**, **new TextField()**]
    ],
})

puyma avatar Jun 02 '22 15:06 puyma

What?!! editable PDF fields? am I missing something here? isn't PDF just for printing?

mmghv avatar Oct 01 '23 22:10 mmghv

I think I've seem those before. I did some digging and there's a spec called XFA forms that appears to do just that. It seems though it would still be a bold feat to achieve

  • https://en.wikipedia.org/wiki/XFA#Usage_with_Portable_Document_Format
  • https://updf.com/pdf-form/xfa/

lucaslm avatar Dec 05 '23 18:12 lucaslm