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
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @jitendram639832 ,
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,
You may create a generic servlet with selector says "pdf", and can create download link like mysite/my/page.pdf.html.
Whenever this servlet will be called himl page will be converted into pdf using java API and pdf can be serve as pdf in browser or as a attachment.
Regards,
Santosh
Hi @jitendram639832 ,
Please see the old community article on below URL for almost same requirement.
Hope this will help.
Regards
Umesh Thakur
Hi @jitendram639832 ,
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,
You may create a generic servlet with selector says "pdf", and can create download link like mysite/my/page.pdf.html.
Whenever this servlet will be called himl page will be converted into pdf using java API and pdf can be serve as pdf in browser or as a attachment.
Regards,
Santosh
Views
Likes
Replies
Views
Likes
Replies