Expand my Community achievements bar.

SOLVED

Download AEM page content including images(banners) as a pdf

Avatar

Level 1

Hi,

I am looking for a solution where AEM page content including images(banners) can be converted into pdf and pdf can be downloaded for end user by clicking on "Download PDF" button.

AEM page content data is generated dynamically after fetching data from some API and images are configurable on the page.

 

Thanks,

Jitendra

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @jitendram639832 ,

 

  1. As @Sachin_Arora_ mentioned in forum https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/convert-aem-page-to-pdf/qa...
  • You can add a query parameter in URLs of a page like /home.html?print=page. In Javascript you can give a condition to run window.print() in case print == page.It will automatically pop up a window for user to save it as PDF or print page.

  • Add media rule in CSS for print to control content that needs to be added in PDF. Reference URL

   2.  As @arunpatidar suggested,

Regards,

Santosh

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @jitendram639832 ,

Please see the old community article on below URL for almost same requirement.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/generating-pdf-from-html-i...

Hope this will help.

Regards

Umesh Thakur

Avatar

Correct answer by
Community Advisor

Hi @jitendram639832 ,

 

  1. As @Sachin_Arora_ mentioned in forum https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/convert-aem-page-to-pdf/qa...
  • You can add a query parameter in URLs of a page like /home.html?print=page. In Javascript you can give a condition to run window.print() in case print == page.It will automatically pop up a window for user to save it as PDF or print page.

  • Add media rule in CSS for print to control content that needs to be added in PDF. Reference URL

   2.  As @arunpatidar suggested,

Regards,

Santosh