Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to generate "editable" PDF programmatically in AEM forms OSGI

Avatar

Avatar
Validate 1
Level 1
LittleBigFeet
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
LittleBigFeet
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
LittleBigFeet
Level 1

05-07-2017

Hi all,

I have a requirement to generate a editable PDF in AEM OSGI and send it back to the client program as part of the response.

I was able to send out a "flat PDF" back via Output Service - generatePDFOutput mechanism. However this creates a flat pdf for the client program, which is not what we want.

My client needs to be able to call an endpoint with some xml data and needs to receive an editable pdf as part of response, so that when they send it to the end user, it can be edited by the end user according to their requirement.

Can some one provide some pointers on how i can archive this..

thanks...

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 1
Level 2
user2062153
Level 2

Likes

2 likes

Total Posts

18 posts

Correct Reply

2 solutions
Top badges earned
Boost 1
Affirm 1
View profile

Avatar
Boost 1
Level 2
user2062153
Level 2

Likes

2 likes

Total Posts

18 posts

Correct Reply

2 solutions
Top badges earned
Boost 1
Affirm 1
View profile
user2062153
Level 2

13-07-2017

Hi,

Yes, you can use FormsService​ API for generating interactive PDF.

Sample code

byte[] xdpData = (data);

Document docData = new Document(xmlData);

PDFFormRenderOptions options = new PDFFormRenderOptions();

options.setContentRoot(xdpLocation); // location of XDP

Document docPDF = formsService.renderPDFForm(fileName,docData,options);

byte[] result = IOUtils.toByteArray(docPDF.getInputStream());

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 1
LittleBigFeet
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
LittleBigFeet
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
LittleBigFeet
Level 1

05-07-2017

Hi there, I went through Forms service, i think renderPDFForm is what i am looking for. I will give it a shot and see.

Any expert advise on this is welcome..

Thanks for your help..!!!

Avatar

Avatar
Validate 1
Level 1
LittleBigFeet
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
LittleBigFeet
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
LittleBigFeet
Level 1

05-07-2017

Hi ..Thank you for your note...i think i was not clear enough .......Let me try to explain..

I have a third party CRM system, this system has the user data ...It will call an AEM endpoint and pass the customer data along with the form name. In AEM forms (Yes i am using 6.3)  i need some sort of api to merge the XDP along with the data sent, and create an editable pdf ( only the data supplied as part of the original request ) needs to be editable.

This editable pdf then needs to be sent back to CRM , and CRM routes it to the Customer, who might choose to either edit it or simply keep it as is and take a printout for it.

thank you..

Avatar

Avatar
Boost 5
Employee
sharoon23
Employee

Likes

5 likes

Total Posts

43 posts

Correct Reply

10 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Employee
sharoon23
Employee

Likes

5 likes

Total Posts

43 posts

Correct Reply

10 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
sharoon23
Employee

05-07-2017

Hi,

Assuming that you are on AEM Forms 6.3 and by editable PDF you mean a PDF which can be field by client and data extracted and submitted to an end point upon submission (click of a button), you can use FormsService to generate an interactive PDF.

Hope it helps.

HTH,

Sufyan