Another checkbox issue
muesliflyer opened this issue · 4 comments
It occurs in this form: https://www.irs.gov/pub/irs-prior/f8621--2016.pdf
In Line 4 there is a set of 4 checkboxes. I can connect an xlsx column to the first box (topmostSubform[0].Page1[0].c1_3[0]). It accepts values 0 and 1. That's fine. But when I connect an xlsx column to any of the other three checkboxes in the row (e.g., topmostSubform[0].Page1[0].c1_3[1], I get the following error:
One or more PDF files with the selected name already exists and is use by another application. Please close the other application and restart the creation process.
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei BulkPDF.PDF.SaveFilledPDF(String filePath, Boolean finalize)
bei BulkPDF.PDFFiller.CreateFiles(PDF pdf, Boolean finalize, IDataSource dataSource, Dictionary`2 pdfFields, String outputDir, DelGetFilename GetFilename, DelSetPercent setPercent, DelIsAborted isAborted)
bei BulkPDF.MainForm.backGroundWorker_DoWork(Object sender, DoWorkEventArgs e)
I don't think it has anything to do with PDF files in use by another application. I tried different file names and the error is always the same.
I tried to use PDFescape (free version) and other tools to find out any details about the respective checkboxes in the form but I could not see how to get at that information. Maybe BulkPDF could be enhanced to display the possible values for a checkbox (if that is the issue here).
I don't want to conclude without saying what a great tool BulkPDF is! Thank you!
P.S. Here are the field definitions (as output by pdftk):
FieldType: Button
FieldName: topmostSubform[0].Page1[0].c1_3[0]
FieldFlags: 0
FieldValue: Off
FieldJustification: Left
FieldStateOption: 1
FieldStateOption: Off
FieldType: Button
FieldName: topmostSubform[0].Page1[0].c1_3[1]
FieldFlags: 0
FieldValue: 2
FieldJustification: Left
FieldStateOption: 2
FieldStateOption: Off
FieldType: Button
FieldName: topmostSubform[0].Page1[0].c1_3[2]
FieldFlags: 0
FieldValue: Off
FieldJustification: Left
FieldStateOption: 3
FieldStateOption: Off
FieldType: Button
FieldName: topmostSubform[0].Page1[0].c1_3[3]
FieldFlags: 0
FieldValue: Off
FieldJustification: Left
FieldStateOption: 4
FieldStateOption: Off
[The second field was checked manually]
Another question: is it possible to enter some static text into a field with the BulkPDF GUI?
The problem is that BulkPDF can not select the field c1_3 in the filling process. I really don't know why it can't that. Because this form is a XFA PDF Form which is usally selectable with the pdfStamper but it did not find the field altrough it is in the PDF under this name and selectable (but not checkable) with the AcroFields adapter.
I am not a PDF expert (and I will not offer so much of my time to become one) so I do not a have an idea why this elements can not selected on the usual way. Sorry for the sobering words.
XML-Version of the field:
<field name="c1_3" y="135.467mm" x="121.92mm" w="30.48mm" h="4.234mm" locale="en_US"> <ui> <checkButton size="2.8222mm" mark="check"> <border /> </checkButton> </ui> <font typeface="Myriad Pro" /> <margin leftInset="0mm" rightInset="0mm" /> <para vAlign="middle" /> <value> <text>0</text> </value> <caption placement="right" reserve="26.67mm"> <para vAlign="bottom" spaceAbove="0pt" spaceBelow="0pt" textIndent="0pt" marginLeft="0pt" marginRight="0pt" /> <font size="8pt" typeface="HelveticaNeueLT Std" baselineShift="0pt" /> <value> <text>$150,001-200,000</text> </value> </caption> <items> <text>4</text> <text>0</text> </items> <border> <edge presence="hidden" /> <corner presence="hidden" /> <corner /> <corner /> <corner /> </border> <assist> <speak disable="1">Line 4. (d) $150,001 through 200,000.</speak> </assist> <bind match="global" /> <traversal> <traverse ref="f1_22[0]" /> </traversal> </field>
No, it is not possible to set a static text by now, but you could add the functionality.
Hi Tadelsucht,
thank you for checking. I wasn't aware of details such as XFA forms. I am not familiar with C# - I am more the Python kind of guy. So, please forgive me if I don't try to fix the problem.
Since I generate the form data from a program anyway, I decided to generate xfdf files and fill the forms with pdftk. It seems to work fine. I was looking into fdfgen for generating the fdf form data files but it didn't support hierarchical fields (e.g., person1.address.city). So I ended up using xfdf form data instead of fdf and I generate the xfdf with a simple hand-coded function. (I can share it if anyone is interested.)
I am also experiencing this issue and looking into a way to work around it. @muesliflyer I would appreciate if you could share your xfdf generation code as a gist or something like that.