Skip to content

Cannot select multiple options on listbox #50

@naciriii

Description

@naciriii

Describe the bug

  • It's not possible to select multiple options from listbox

To Reproduce

  • Select a pdf that has a form with listbox field
  • Fill the form with node-pdftk
  • Attempt to select one option (works fine)
pdftk
        .input('./my.pdf')
        .fillForm({
'listbox': 'option1'
})

Matching FDF for field fill

<<
/V (option1)
/T (listbox)
>> 
  • Attempt 1 to select two options (not working)
pdftk
        .input('./my.pdf')
        .fillForm({
'listbox': 'option1,option2'
})

Matching FDF

<<
/V (\(item1,item2\))
/T (listbox)
>> 
  • Attempt 2 to select two options (not working)
pdftk
        .input('./my.pdf')
        .fillForm({
'listbox': ['option1','option2']
})

Matching FDF

<<
/V (item1,item2)
/T (listbox)
>>

Expected behavior

  • both options should be selected in the pdf

Desktop :

  • OS: Linux Debian
  • Version 11
  • node-pdftk version: 0.14.0

Additional context

  • Seamlessly, it's not possible to select multiple options of listbox with FDF, even after testing with pdftk from the cli it was not possible to select multiple options.
  • Apparently with XFDF it's possible to select multiple options for a listbox with the following xml
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
<field name="listbox">
<value>option1</value>
<value>option2</value>
</field>
</fields>
</xfdf>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions