Download AEM page content including images(banners) as a pdf | Community
Skip to main content
jitendram639832
New Participant
Oct 21, 2020 7:41 PM UTC
Solved

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

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.
santhosh_kumark
santhosh_kumarkAccepted solution
Level 6
Oct 22, 2020 1:05 PM UTC

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

santhosh_kumark
santhosh_kumarkAccepted solution
Level 6
Oct 22, 2020 1:05 PM UTC

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

Translate
Umesh_Thakur
New Participant
Oct 22, 2020 4:49 AM UTC

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

Translate