Expand my Community achievements bar.

SOLVED

Can we use PDF Generator with in aem sites?

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

5 Replies

Avatar

Level 3

You need to purchase Document Services.

Avatar

Employee Advisor

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?

Avatar

Level 3

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?

Avatar

Correct answer by
Employee Advisor

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.