Filling PDF form using Select.Pdf - pdf

I'm trying to fill out a form using Select.Pdf .NET package. Although I've successfully filled a couple of forms, there is a one, which I can't fill.
Here is the link - https://www.state.sd.us/eforms/secure/eforms/E1830V2-WCFRI.pdf
When I try to set some textbox text and the save it it just remains blank. Maybe someone has experience in both PDF and using Select.Pdf, so you could help me.
Thanks!

The PDF in question uses a document level JavaScript which calls resetForm();.
That's where the fields are reset to their default values.

Related

PDFtk and number formatted PDF form field

I'm using pdftk to fill in the form with the generated fdf.
In the PDF form, the form field is configured as a number field with 2 decimal point, and the negative value will be showing with parentheses, for example, -4444 will become (4444.00)
Using any PDF viewers and changing the value on form did make the form display the value correctly with the behaviour explained above (negative value will become value with parentheses)
Tested also with the FDF (by importing to the form), the negative value will be displayed correctly as well.
But when using the pdftk fill-form action, the negative value remains as it is without changing the display, which is still showing -4444 and not (4444.00)
Is anyone experienced this before / has a solution for this?
Update #1
I've also tested Apache PDFBox, it has the same issue :(
And now I'm trying to achieve this by using the PDF's javascript, any clue that this way will works?
Update #2
came across this thread How to refresh Formatting on Non-Calculated field and refresh Calculated fields in Fillable PDF form and so gave it a try with iText as well. However still unable to make it works
Finally, i've found some ways to get the formatting works in the PDF form fields.
Approach #1
Requirements
pdftk
PDF form with javascript
In the PDF, create a "Document Javascript" (see how) and re-assign the form's value to make it dirty as mentioned by Denis in the thread of Update #2. The script could be as simple as below:
var text1 = this.getField('text1');
text1.value = text1.value;
Downside
Javascript will only be triggered when you open the PDF, and if you would like to set the PDF with some ownerPassword to prevent user edit the file, the javascript will just failed because of read-only form fields. Otherwise, imagine you have 100 form fields in the PDF, re-assign each of them is a nightmare.
Approach #2
iText
PDF form
I personally will prefer this approach. The powerful iText already has the API to set the form field and at the same time formatting the field display (see how). The generated PDF is ready to print as well with the correct format.
Downside
Either using the iText API to find out the existing format of the form field, or you will hard code the format in your codes. Require more efforts than using the pdftk.
I'm using a simpler version of ChinKang's #1.
In Tools -> Document Javascripts:
this.calculateNow();
One thing to check is in Tools -> Set field calculation order that any calculations are ordered appropriately.
I then use https://github.com/ccnmtl/fdfgen and pdftk to fill the forms in.
The only gotcha is that you cannot flatten the PDF

Is it possible to create fillable PDF from excel?

Currently, I have an excel file that upon launch it shows a userform where users can fill out a few text boxes/comboboxes and press create. Upon pressing create, it gathers stored data and creates a PDF that we send to vendors. It's essentially an invoice. The vendors that receive this PDF have to fill out a couple of lines and return it to us. Right now if they have no acrobat/reader experience, they're printing the PDF and then scanning and returning to us.
I want the vendors to be able to type in a few areas on the PDF and return it to us. My question is, can I create a fillable PDF from excel? Does anyone know how to do this using excel features or with VBA? Or any other method?
Thanks!
Brandon
Short Answer: Absolutely.
First you will start with a fillable pdf form. (you can create one using Adobe Acrobat or the older Adobe Designer)
It is my understanding, from your question that you would like to take some information, fill out a PDF, then send this to your client, to complete this.
Using VBA you can do all of this in one single button.
I created a step-by-step video on how to use the SendKeys method to achieve this.
Please see the detailed instructional YouTube video here: How to AUTOMATICALLY fill PDF forms using Microsoft Excel in 1 CLICK

Extracting combobox display data from fdf file using iText

I need to read the fdf file to get the list options (via getListOptionDisplay) for a combo box, but when I invoke the getAcroFields method on the fdfReader, the fields come back as empty. I'm using an older version (2.1.2), any suggestions or code samples?
Figured it out. I couldnt use the inherited methods, but I reviewed the fdfReader object in the debugger and was able to extract the information.

Creating read-only Microsoft Word file using VB.net

I am trying to create a Microsoft Word file in VB.net which is read only.
My aim is that user will input the data in a Windows form, after pressing export button it'll get exported to a Word document. But here's a twist: I want this Word file to be read only.
Is there any option to do this? I have tried exporting through Crystal Report, but its still editable.
Any help would be appreciated.
You can use the File.SetAttributes method for that, I think. Check the MSDN site.

Modify character spacing in a PDF form field

I'm trying to build a web app to programmatically fill out a PDF form. I am going to configure my form first in Adobe Acrobat, then write a Java app with iText to fill out all the form fields via user input from the web. The base form I need to fill out comes from the US government. They created form fields with extremely large kerning (character spacing) values I need to change. However, there appears to be no way to modify this value in the Acrobat UI.
Does anyone know how to manipulate character spacing on form fields in Acrobat 8.0 for Windows? I could try to use iText to programmatically manipulate the kerning of the original document, but this would be much more tedious.
I believe I figured this out: kerning is called "combing" in acrobat, and each of the form fields have been "combed". The strange thing is this option isn't checked when I view the properties of the form field, but "combing" is the behaviour I was attempting to replicate.