Expand my Community achievements bar.

SOLVED

What are the limitations using "OutputService" over "formService" in AEM to generate pdf ?

Avatar

Level 2

Hi team,

Can Some pls provide any resources to Understand the limitations of "OutputService"   over "formService".

Env details - AEM 6.5 (On-Premise) Forms-add-on package (adobe-aemfd-win-pkg-6.0.640.zip), OSGI forms & output service.

I AM facing some issues in java script part of XDP, especially in java script accessing data of table and manipulating the table structure of dynamic table (XML based data).

Pls provide any resources or leads to understand these limitations.

 

thanks

1 Accepted Solution

Avatar

Correct answer by
Level 4

The Output Service is used to generate PDF, HTML, or print-ready output from an XDP form template. It is built on top of the AEM Forms Document Services, which provides a set of APIs for creating, manipulating, and rendering PDF documents.

The Form Service, on the other hand, is used for form-related functionality such as creating, populating, and validating forms. It also provides APIs for working with data submitted by forms, including data stored in AEM JCR repository.

The limitations of the Output Service over the Form Service will depend on the specific use case and requirements of your application. However, here are some general limitations to keep in mind:

  • Output Service is mainly used for generating output (PDF, HTML, Print-ready) and it's limited to that. It doesn't provide any form-related functionality like form creation, population, validation.

  • The Output Service is primarily used for generating output from an XDP form template and does not provide the same level of granular control over the data and layout of the form as the Form Service.

  • The Form Service provides a more extensive set of APIs for working with form data, including data stored in the JCR repository. It allows you to manipulate data in a more granular way, including working with tables and dynamic table structures.

View solution in original post

7 Replies

Avatar

Community Advisor

Output Service - Typically this service is used to merge XML data with an xdp template or pdf to generate a flattened pdf.

 

Using the instance manager through javascript you can do easy manipulation of data in a dynamic table.

 

 

https://experienceleague.adobe.com/docs/experience-manager-learn/forms/document-services/output-and-....

Avatar

Level 2

@Vijay_Katoch thanks for your response.

The following table I have designed in Livecycle Designer 11 As a dynamic table.

 

Screenshot 2023-01-11 200724.pngcode snippet.png

Here I am concatenating cell2 & cell3 & cell4 data in cell1 and hiding the cell2 & cell3 & cell4,Rearrange the table widths.

The above function will be invoked on Page1.initilize evenet.

To display data in cell1 of (Address, BuildingNo, locationNo together)

On formready:

/*xfa.resolveNode("Row1[0].Cell1[0]").rawValue=xfa.resolveNode("Row1[0].BuildingNo[0]").rawValue+"-"+xfa.resolveNode("Row1[0].LocationNo[0]").rawValue+" "+xfa.resolveNode("Row1[0].Address[0]").rawValue;

xfa.resolveNode("Row1[1].Cell1[0]").rawValue=xfa.resolveNode("Row1[1].BuildingNo[0]").rawValue+"-"+xfa.resolveNode("Row1[1].LocationNo[0]").rawValue+" "+xfa.resolveNode("Row1[1].Address[0]").rawValue;

xfa.resolveNode("Row1[2].Cell1[0]").rawValue=xfa.resolveNode("Row1[2].BuildingNo[0]").rawValue+"-"+xfa.resolveNode("Row1[2].LocationNo[0]").rawValue+" "+xfa.resolveNode("Row1[2].Address[0]").rawValue;

xfa.resolveNode("Row1[3].Cell1[0]").rawValue=xfa.resolveNode("Row1[3].BuildingNo[0]").rawValue+"-"+xfa.resolveNode("Row1[3].LocationNo[0]").rawValue+" "+xfa.resolveNode("Row1[3].Address[0]").rawValue;*/

 

(OR)

 

this.rawValue=BuildingNo.rawValue+"-"+LocationNo.rawValue+" "+Address.rawValue;

 

  • here Output service failed to load table and table data.
  • But FormService is working fine.

can you please update me the limitations in my script. 

 

 

Thanks

Avatar

Community Advisor

Is your form working as expected while you preview it with sample data? 

Avatar

Level 2

@Vijay_Katoch yes.

 

bhanu2_0-1673591095882.png

This is the output i am able get when previewed and as well in generated pdf with "FormService".

 

But Output service the "complete Address" is empty and unable to hide one column too.

 

thanks.

Avatar

Correct answer by
Level 4

The Output Service is used to generate PDF, HTML, or print-ready output from an XDP form template. It is built on top of the AEM Forms Document Services, which provides a set of APIs for creating, manipulating, and rendering PDF documents.

The Form Service, on the other hand, is used for form-related functionality such as creating, populating, and validating forms. It also provides APIs for working with data submitted by forms, including data stored in AEM JCR repository.

The limitations of the Output Service over the Form Service will depend on the specific use case and requirements of your application. However, here are some general limitations to keep in mind:

  • Output Service is mainly used for generating output (PDF, HTML, Print-ready) and it's limited to that. It doesn't provide any form-related functionality like form creation, population, validation.

  • The Output Service is primarily used for generating output from an XDP form template and does not provide the same level of granular control over the data and layout of the form as the Form Service.

  • The Form Service provides a more extensive set of APIs for working with form data, including data stored in the JCR repository. It allows you to manipulate data in a more granular way, including working with tables and dynamic table structures.

Avatar

Level 2

@Monendra_Singh  thanks for your response.

if "formservice" will be used to generate pdf (using .xdp template & xml data).

Which requires adobe reader to open always (bcz of interactive pdf). 

 

  •  lets say if I use FormService to generate PDF having scripting then to make it non-interactive or flat I will need to use OutputService/ AssemblerService? 

thanks.