You are viewing limited content. For full access, please sign in.

Question

Question

custom html updated via script is not rendered in PDF

asked on September 8, 2016 Show version history

we have a form with custom html field which is updated via jquery script we want the updated content to be rendered in the PDF but the updated values are not rendered in PDF. 

 

can anybody provide some insights on how LF renders the PDF? looks like we do not have much control over the PDF rendering.

0 0

Replies

replied on September 8, 2016

Hi Chockalingam, 

Custom html field is designed for displaying static html content, which means Forms is not able to store any changes in that field during runtime (so updated value would not show in your PDF becuase it's not stored).

Please let us know if you have a special use case for doing this.

Thank you.

Lifei 

0 0
replied on September 9, 2016

To give a little more detail, when you press the submit button, the form submits its data to the server (only includes fields that are linked to a variable from the Form Layout page, so basically only the Laserfiche drag-and-drop fields), which Forms then stores in the database. When the process hits a "save to repository" step, Forms reloads that submission by browsing to a particular URL, and uses a 3rd party tool called wkhtmltopdf to convert that rendered page into a PDF document. This means that any Javascript-based events that change the appearance of the form will only be rendered if they are designed to run when the form loads... not if they are in response to user-driven events.

I have seen some users create hidden Laserfiche fields to store status variables, and then create some javascript functions that look at the status on loading and recreate the proper changes to the form based on those values. In this case, you can get the changes rendered into the PDF, but only if the code runs without user interaction and when the form loads.

0 0
replied on September 9, 2016 Show version history

i have seen LF not rendering fields even if they are tied to a variable for example, a read only UI field but values updated via JQUERY, also the values are updated in JQuery during form load with no user intervention

0 0
replied on September 9, 2016

Fields marked as Read Only in the layout editor are actually given both the readonly and disabled HTML attributes. It is the disabled attribute that prevents the data from being sent on a form submission. If you search on here enough, you'll find many people asking that same question. The workaround there is usually to NOT mark the field as Read Only in the editor, but to set it as read only using javascript when the page loads.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.