Smart/Fillable PDF adding more attributes - pdf

I am creating a Smart/Fillable PDF using Acrobat Pro DC.
I created a word file with 250+ fields(in a tabular manner), exported to PDF and then in "Prepare form" options I added checkboxes, dropdowns and a couple of buttons and the form is ready. Now I want to add 50+ more fields into that PDF but if i follow the same procedure export to PDF and then "Prepare form" then i shall loose all the old validations and scripts I have written initially.
To overcome this scenario I tried a couple of things that didn't work for me:
Go to "Edit PDF" option and try editing PDF but that did not work as that option helps editing text and images but I have fields in a tabular format so in case if I want to add a table with N x N fields not possible
Tried to copy all elements including textbox,checkbox,dropdowns buttons etc but cannot copy all at once, tried then in a small group like 15-15 and that worked but still I had to reposition so not a feasible way
Tried to export the elements including textbox,checkbox,dropdowns buttons etc but Acrobat Pro DC doesn't help
Many other manipulative things but didn't help.
Please help me to overcome this problem.
Thanks in advance.

If you change the background of the form, you would first open the old version, and then replace the pages with the ones from the new version. This does not affect any form fields, so, only some repositioning may be necessary.
Then you go to the form edit mode (or use the Select Object Tool (single key accelerator R)) and you can select the fields you want to copy and either drag-copy if you are on the same page, copy/paste them, or duplicate them on other pages (via Context menu of the selected field in edit mode).
Another potentially important hint: deactivate Save as… optimizes for fast web view when working with forms.

Related

How can I see the vb code of an UI made Publisher template

I'm using a publisher document as a template to create fitting instructions for our products. Everytime we launch a new product an individual instruction is produced which involves a lot of copy and pasting and then translating the master document into 4 different languages.
Although being individual to the product, there are only 5 sets of instructions with their own wordings (which doesn't change) and pics, the layout of the document is the same across all 5.
I was thinking to create a user form to enter the product name, choose the required set, insert photos and save the new doc as .pub and .pdf (only in English, I want to get this running first)
I tried around with Access and mail merge but it doesn't work the way I need it to. So I reverted to using VB in publisher where I've been basically able to return the text boxes, however, I can't see a way to display the code of the entire document with all text boxes and their formatting. Is this possible or would I have to code the entire document from scratch?
Thanks for reading and your input.

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

Most efficient solution for printing large amount of data

For example, there are 10-12 forms and in everyone of them there are between 5-20 panels with datagridview and some text. Content of every panel should be printable if there is any data in their DGV.
What would be easiest solution for printing data, should I make report for every one of those panels or there is some better/easier solution?
You should always create reports for anything you want to print. There are other options but they often take longer (PrintDocument) or they're harder to maintain (PrintDocument) or they're not very professional (screen/form print) or they only work until you get more data than what is visible on the users screen (grids with screen/form print).
Of coarse there are other options like sending the info to MS Word and telling it to print but that requires the end user has MS Word installed. Some try to create PDF documents and either fail or wish they hadn't.
Don't re-invent the wheel. Reports were created for this purpose.

How to create switchable multi-language pdf form?

I want to create a pdf form for two language (Chinese/English) UI, and there's a button(s) or somethings on the form for language switch, is there anyway can make it? and how to do?
thanks!
Thanks for all reply!
Actually I got a sample like this,
PDF Sample
there're two checkbox on the top-left of the form, one is for English UI, the other is Chinese, I just want to know how to make PDF like that sample? (and I don't see any layers on the sample...)
thx
mkl's comment (which he should turn into a full answer, really) already hinted at the option to use different page templates residing in the same file.
Another option you could explore is this:
put the two language versions into 2 different layers (or 'optional content groups' in PDF parlance)
make the visibility of the two layers toggeable
let the user activate that layer which he/she needs.
Layer activation can be handled through normal Acrobat Reader user interface elements.
The layer switching can be made accessible via a "button" on the PDF page too -- but that requires additional JavaScript to be embedded in the PDF (something many people are not particularly keen about).
As Kurt proposed, I make my comment on Frank's answer an answer in its own right:
Actually there is a pdf feature seldomly used nowerdays, page
templates. Thus, those two forms can reside in the same file in
different page templates, and based on some initially present buttons
("English version", ...) the desired form is spawned.
Unfortunately I don't know how to create page templates using some easy-to-use tool, I only came a cross them in the context of integrated PDF signatures (depending on the signature type, page template instantiation is a document change not breaking the signature) and tested them with low-level tools.
Essentially page templates are PDF objects just like page dictionaries of the normal pages, they are not XFA stuff. They merely are not referenced in the pages tree but instead in the name tree.
There is a JavaScript command which creates a visible page based on such a template --- I don't know which anymore; I may be able to find out when I'm back in office next week. This command would have to be bound to the inital language selection button in the file.
The problem will be in switching the static text - PDF does not allow this.
If I were you, I would split the document into two identical forms in the respective languages. You can use bookmarks and links on the first page to navigate to the right part of the document.
Note that it is possible to assign the same field names to the Enlgish/Chinese versions of your fields. This will make it easier to process the submitted form data because the process path would be independent of the chosen language. It will also simplify any JavaScript (validation, summing, etc.) you plan to add.

Check Box for 2 different .pdf files

I am trying to have two different .pdf forms, and when I check a box in one it will show in the other, then when all the boxes are checked it will check another box in the second .pdf.
How would I do this?
I believe you will have to write some javascript code inside your pdf files. This will do the job for the first case, but I am not sure if Acrobat Reader will allow you to do modifications on an external file from javascript... If it does allow you, I would consider it a security hole.