Expand my Community achievements bar.

SOLVED

Merging Text into a PDF

Avatar

Level 2

I'm relatively new to the LiveCycle world and I don't know how to do something that I imagine is relatively simple. I have a LiveCycle process that will generate a PDF document. I'd like to merge part of the data model into the text of the document, but can't see how you would do that. A simple example of what I mean would be to have a persons details in the data model (title, forename, surname, address etc), and then have the text of the letter start with something like "Dear ${title} ${surname}," where, obviously, the appropriate values are substituted in.

How do you do that?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The model that you are refering to would be an XML data file. You can map nodes in the xml file against fields in the form (this is called binding) so that when the data is imported the product knows how to tie which field to which node in the XML. Note that the filed name and the node name do NOT have to match. In your case where you are trying to simply substitute values into a text block you can use a Floating Field. To get the floating field you place the cursor in the text block where you want the substitution to occur and under the Insert menu you can pick Floating Field. It will insert a representation that a field is preset with {TextField}. If you look at the hierarchy view you can click on the TextField object and then the object palette will become active for you to set this fields properties. The Binding tab is where you woudl set the binding to the data file (this assumes that you have imported a sample data file or data schema through the data Connections tab 1st). Once the data is merged onto the form the field becomes text (liek the rest of the block and the text block is reflowed to remove any white space.

Hope this helps

Paul

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

The model that you are refering to would be an XML data file. You can map nodes in the xml file against fields in the form (this is called binding) so that when the data is imported the product knows how to tie which field to which node in the XML. Note that the filed name and the node name do NOT have to match. In your case where you are trying to simply substitute values into a text block you can use a Floating Field. To get the floating field you place the cursor in the text block where you want the substitution to occur and under the Insert menu you can pick Floating Field. It will insert a representation that a field is preset with {TextField}. If you look at the hierarchy view you can click on the TextField object and then the object palette will become active for you to set this fields properties. The Binding tab is where you woudl set the binding to the data file (this assumes that you have imported a sample data file or data schema through the data Connections tab 1st). Once the data is merged onto the form the field becomes text (liek the rest of the block and the text block is reflowed to remove any white space.

Hope this helps

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----