iText - PDF file displaying message at the top about fillable form - pdf

Here is what I did:
1. I have a template WORD file that can be used to fill an application for some stuff. Assigned pre-defined tags to fillable fields.
2. Converted that word file to PDF file using CenoPdf
3. Used iText to fill the fields in generated PDF file.
4. Now when user downloads that filled file, they see a nice purple at the bar saying "Please fill out the following form. You can not save data typed into this form. Please print your completed form if you would like to copy for your records".
how can i get rid of this purple bar and the message? I am assuming i need to set some bits through iText to turn this off??
Thanks

You can't edit the purple bar at the top. This is a flaw with Acrobat. Whenever your PDF contains form fields, the message is automatically displayed by force and you cannot edit it. Adobe feels that it's users are more important than it's developers, and forces the bar and message whenever form fields are present.

Related

How do I dynamically give a value to an existing barcode created in acrobat

How do I dynamically give a value to an existing barcode created in acrobat.
I created the bar code in a pdf form by following this guide.
When I type something into the form fields , the bar code does get updated with the values. However the catch is , the pdf is dynamically generated through ruby code, and the form is prefilled. However the barcode doesn't include the data dynamicallly filled into the pdf form. If I make any change in the pdf form data , the bar code is reloaded and now includes the entire form data , but this doesn't happen when the generated pdf is opened for the first time.
To summarize.
1) Added barcode to a pdf form and added javascript to calcuate bar code value.
2) Bar code gets updated with newly calcuated value as form data is changed.
3) Dynamically filled the pdf form created in step 1. All form fields are filled , but bar code doesn't include the data.
4) If I make a change to data in pdf created in 3 , the bar code gets redrawn with all the data filled on the server and also includes the data change I just made.
The problem is in step 3 , when the pdf form is filled with data on the server , I am expecting the bar code to include the data.
P.S , I have used pdf-forms to fill out pdf on server. I have also tried itext java api to fill out the form.
In addition, with both pdf-forms and itext , I have tried to provide an initial value for the bar code. However if I do this , the barcode doesn't even show in the generated pdf and instead the provided values show.
P.S 2nd. I have also been able to generate a bar code image using itext. However I need this bar code to be updated as the user changes form data in the generated pdf. Obviously the image doesn't update. and hence I tried the above approch of using a script in the pdf to calcuate barcode value on the fly.
One thing to understand first. In PDF, the value of a field and its appearance on the page are two different things. When created in Acrobat, the value of a Barcode Field is actually calculated based on your selections in the UI when you created it. Acrobat injects some JavaScript into the field so that when new data is entered by the user, the value of the field is recalculated and Acrobat can generate a new appearance for the barcode field (an image). If you only update value of the field on the server but don't set the "needs Appearances" property to true on the document, Acrobat won't know to regenerate the barcode appearance. You could, however, generate the barcode appearance and set that via iText but you'd need to know the JavaScript calculation in order to do so. Once the value and the appearance are set up and the needs appearances property is set, the form should work normally.
Since you have tried multiple libraries, I'm going to suggest one more. The Datalogics PDF Java Toolkit can actually do all of this for you without needing to know what field data the barcode represents. You just populate the non-barcode fields with data, tell the Toolkit to calculate the form and generate appearances and it just works. The barcode gets rendered exactly the same as it would have been if filled out in Acrobat.

Adobe PDF Forms - Text Field displays value only when clicked on it

I have a PDF with forms defined in it.
One field in the form is a multi line text field.
The value in the text field is populated by a java program using Apache PDFBox.
The issue is when the value is of around 5 to 6 lines, the text box displays the text automatically. But if it is more than 6 lines, the text box does not display the value. I had to specifically click on the text field to display the text. If I click outside the text box again, the text disappears.
The text field is read only with Multi Line and Scrolling options enabled.
Any ideas what is causing this weird issue?
I have Adobe Acrobat Pro 11, Adobe Acrobat XI and Adobe Reader to view the files. All have the same issue.
It sounds like a typical "appearance" problem. There's no form field appearance in the field widget dictionary so when you click in the field, the raw string data is shown but when you click out there is no appearance to display so you get a blank. You can test this out by toggling the multi-line setting in the field properties in Acrobat so it generates an appearance. If that fixes it, then you the problem is the one I describe.
You can use PDFBox to set the "needs appearances" flag in the file that will tell Adobe viewers to regenerate field appearances when the file is opened but that doesn't work for all PDF viewers. To make the field value visible in all PDF viewers, it's best to generate appearances when you populate the field values.
The Datalogics PDF Java Toolkit can automatically generate appearances based on field values. Full disclosure, I represent Datalogics.

PDF with fillable form fields + "Save As" = PDF with fixed text - how?

I'm creating a PDF using iTextSharp and it contains some fillable form fields. What I need, is to somehow set it up so that when those form fields are filled in and the resulting PDF is saved (in one of the commercially-available PDF readers like Adobe's Reader), I need those form fields to be fixed text (no longer editable).
Is there any way to do this?
As a comment suggests, this sounds like "flattening the document".
The issue with that process is that it is not available in (Adobe) Reader; it would require Acrobat, or server-side help.
On the other hand, some mobile PDF viewers do actually offer flattening when saving.
The workaround for Reader is to set the fields to read-only when saving the document. You would do this in the willSave Document Action by looping through the fields and setting them to readonly.
Simply Print your document as PDF. This will flatten the file.
For this
1. Install Adobe PDF Printer or CutePDF or some similar tool.
2. From your document. Select File -> Print.
3. Select Printer as the tool you installed in Step 1.
4. Your document will be a flattened, non-editable PDF now.

How to autogenerate field in Adobe Acrobate Pro and also form get auto flow on adding auto generate field to the form

I have made PDF form containing Radiobutton, Text Field, Button,CheckBox and Barcode in Adobe Acrobat Pro. and all is working well.
But according to new requirement I have to "Autogenerate" some of the fields like Radiobutton, Text Field and CheckBox on clicking to the "Add Field" Button, and on clicking the button the control should get auto generate to that PDF form.
Additional the text which is already added to the PDF form get flow down whenever the fields get auto generate on the top of the form.
According to my findings I found that it is possible through Adobe liveCycle but I want it to happen in Adobe Acrobat Pro
Also I have tried adding the blank new PDF page so that according to requirement I autogenerate my field on that blank PDF but not able to add new PDF page through Javascript?
Thanks you in advance.
It is possible; you would need to use form fields for everything which can move when you add new fields (been there, done that).
Then you will need a pagination logic which places or moves the fields to their correct position.

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.