Download AEM page content including images(banners) as a pdf | Community
Skip to main content
jitendram639832
October 21, 2020
Solved

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

  • October 21, 2020
  • 2 replies
  • 2092 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by santhosh_kumark

Hi @jitendram639832 ,

 

  1. As @sachin_arora_ mentioned in forum https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/convert-aem-page-to-pdf/qaq-p/270625
  • 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

2 replies

Umesh_Thakur
Community Advisor
Community Advisor
October 22, 2020

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-in-adobe-experience-manager/m-p/265189

Hope this will help.

Regards

Umesh Thakur

santhosh_kumark
santhosh_kumarkAccepted solution
Level 6
October 22, 2020

Hi @jitendram639832 ,

 

  1. As @sachin_arora_ mentioned in forum https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/convert-aem-page-to-pdf/qaq-p/270625
  • 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