Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

jitendram639832
Level 1
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
santhosh_kumark
Correct answer by
Community Advisor
Community Advisor

Hi @jitendram639832 ,

 

  1. As @sachinarora 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 @Arun_Patidar suggested,

Regards,

Santosh

View solution in original post

2 Replies
Umesh_Thakur
Community Advisor
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

santhosh_kumark
Correct answer by
Community Advisor
Community Advisor

Hi @jitendram639832 ,

 

  1. As @sachinarora 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 @Arun_Patidar suggested,

Regards,

Santosh

View solution in original post