Populating Multi-line PDF Form Fields with Multiple Data Values  SOLVED

A picture is worth a thousand words. We have created some pdfs tutorials showing common tasks.

Moderators: Tracker Support, TrackerSupp-Daniel, Sean - Tracker, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
Alpi
User
Posts: 5
Joined: Sat Jun 15, 2024 10:43 pm

Populating Multi-line PDF Form Fields with Multiple Data Values

Post by Alpi »

Sometimes it may be necessary to feature data from multiple spreadsheet data fields within one PDF form field. This tutorial explains how to populate multi-line text fields in a PDF form with multiple data values from a sample Excel spreadsheet. Using composite fields is an effective way to combine values from multiple data fields to create a unique field value. We demonstrate this by creating a custom composite field mapping, and use it to fill a multi-line form field with data from a spreadsheet source.

Is it possible to populate like is described here? >> https://evermap.com/Tutorial_AMM_MultiLineFields.asp

I am trying but cannot find the working solution :(
Attachments
image.png
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18407
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Populating Multi-line PDF Form Fields with Multiple Data Values

Post by Tracker Supp-Stefan »

Hello again Alpi,

I see you posted in another topic as well as you opened this one.
I am afraid that our Forms tool is not really designed to handle it this way.

Is it not possible for you to work with the initial data and prepare all those fields that you need collated together put in under one name in the .csv file and then use the updated file to merge that data to the PDF document?

Kind regards,
Stefan
User avatar
rakunavi
User
Posts: 1083
Joined: Sat Sep 11, 2021 5:04 am

Re: Populating Multi-line PDF Form Fields with Multiple Data Values  SOLVED

Post by rakunavi »

Hello Alpi,

I am not at all familiar with form feature, but it might be possible to do something similar to what you want by specifying JavaScript as a Custom Action in the Value Calculation of the text field. In the sample file, the Visibility of the text field used to load each data value is set to hidden, and only the fields of the merged result are displayed. Another way to do this would be to set it on a separate layer and hide that layer.

  • figure.png

Code: Select all

var Output ;
Output = this.getField("Item1").value + "\n"
       + this.getField("Item2").value + "\n"
       + this.getField("Item3").value + "\n"
       + this.getField("Item4").value + "\n"
       + this.getField("Item5").value + "\n"
       + this.getField("Item6").value;
event.value = Output;
  • This is a GIF animation. Click to play.
    This is a GIF animation. Click to play.
Sorry if my comment is off the mark.

Best regards,
rakunavi
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18407
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Populating Multi-line PDF Form Fields with Multiple Data Values

Post by Tracker Supp-Stefan »

Hello rakunavi,

Thanks for your suggestion. That crossed my mind as well - however it would probably be easier to manipulate the incoming .csv rather than making the JS tricks inside the Editor. It might work, that is true, but it is also going to be the more prone to issues approach.

Kind regards,
Stefan
Alpi
User
Posts: 5
Joined: Sat Jun 15, 2024 10:43 pm

Re: Populating Multi-line PDF Form Fields with Multiple Data Values

Post by Alpi »

rakunavi wrote: Mon Jun 17, 2024 11:53 am Hello Alpi,

I am not at all familiar with form feature, but it might be possible to do something similar to what you want by specifying JavaScript as a Custom Action in the Value Calculation of the text field. In the sample file, the Visibility of the text field used to load each data value is set to hidden, and only the fields of the merged result are displayed. Another way to do this would be to set it on a separate layer and hide that layer.

  • figure.png

Code: Select all

var Output ;
Output = this.getField("Item1").value + "\n"
       + this.getField("Item2").value + "\n"
       + this.getField("Item3").value + "\n"
       + this.getField("Item4").value + "\n"
       + this.getField("Item5").value + "\n"
       + this.getField("Item6").value;
event.value = Output;
  • Animation.gif
  • SampleFiles.zip
Sorry if my comment is off the mark.

Best regards,
rakunavi
Hello rakunavi
Thank you for your idea. I will try to experiment a little with and check I can use it for my purposes :)
Thanks for creative approach to my issue, I like it :)
Best regards,
Alpi
Alpi
User
Posts: 5
Joined: Sat Jun 15, 2024 10:43 pm

Re: Populating Multi-line PDF Form Fields with Multiple Data Values

Post by Alpi »

Tracker Supp-Stefan wrote: Mon Jun 17, 2024 9:34 am Hello again Alpi,

I see you posted in another topic as well as you opened this one.
I am afraid that our Forms tool is not really designed to handle it this way.

Is it not possible for you to work with the initial data and prepare all those fields that you need collated together put in under one name in the .csv file and then use the updated file to merge that data to the PDF document?

Kind regards,
Stefan
Hello Stefan,

I am not sure if I know how to prepare the source .csv files to reach the effect I expect.
I try to automate of preparing summarizing report from data taken from imported from internet site form as .csv file.
But the report should be a list row by row in one pdf file as a final report to send. I am searching the idea how to do it to minimize required file manipulation. For now, I have to do it manually :/ I will appreciate for every idea to solve it.

Best regards,
Alpi
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18407
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Populating Multi-line PDF Form Fields with Multiple Data Values

Post by Tracker Supp-Stefan »

Hello Alpi,

Rakunavi's suggestion with a hidden form field might indeed be the easiest approach to achieve your result.

How many such items are there, are they a fixed number every time and how many rows of such items would there be in a normal file (e.g. would you get a csv with thousands of rows, or it is the one row files that you get)? Can you provide us with an, obfuscated if necessary, real life sample of the input file and the form you are trying to add your data in?

Kind regards,
Stefan
Post Reply