Can we use PDF Generator with in aem sites?

shridhar_sahu

17-10-2019

I have a use-case in which i need to generate PDF from HTML page using URL.

I have sample Landing page which accepts a url-encoded parameter id

At the time of page load an ajax call gets triggered and some html gets rendered dynamically through jquery based on that url parameter.

I have to use using webpage link((www.example.com/mypage.html?id=1)) for generating pdf from HTML.

Also,  Can we achieve the use-case using pdf generator without using AEM Forms?

Adobe Experience Manager Help | Converting files using PDF Generator

Accepted Solutions (1)

Accepted Solutions (1)

Jörg_Hoh

Employee

18-10-2019

The server never sees the complete page, as it is combined in the browser out of two or more assets; thus rendering on the server would require that the server starts a browser, and executes all the javascript to trigger the ajax call and embedd the returned value somehow into the DOM, so it can be finally rendered into the PDF.

I guess that this is somehow possible (you have to have an embedded browser like phantomjs or such), although I am not sure if the PDF generator can handle that case directly.

Answers (4)

Answers (4)

shridhar_sahu

17-10-2019

I have a landing page built on AEM 6.4 Sites which accepts url parameter id

(www.example.com/mypage.html?id=1)

At the time of page load a ajax call get triggered and appends some html with in landing page through javascript.

Can we generate pdf of the landing page(www.example.com/mypage.html?id=1) using pdf generator?

Jörg_Hoh

Employee

17-10-2019

I don't understand what you need to render as PDF. Is it something the server produces or is the page to be rendered completed in the browser?