Need to generate a PDF file from a AEM wite page | Community
Skip to main content
May 8, 2024
Solved

Need to generate a PDF file from a AEM wite page

  • May 8, 2024
  • 1 reply
  • 687 views

Hi Team,

 

I do have a requirement in my current project which is based upon AEM 6.5.

I have a page which generates some useful-info( uses clientlibs for style and layout ) after collecting inputs from end user.

I want to add a button on that useful-info page for downloading that page content as a pdf file.

Can I use any OOTB plugin or open-source 3rd party plugin etc which I can use inside my pdfgeneration servlet to generate the PDF version of that page.

 

Note-: The components used here are still following classic ui approach.

 

Thanks and regards

Tapas

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 EstebanBustamante

Hi, 

The easiest way would be to "print" your page as PDF, you could use JS and do something like window.print(). Otherwise, you can simply call a servlet and do the transformation in your servlet (backend).

Please check the solution in this thread: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/convert-aem-page-to-pdf/m-p/270625 which will work for your use case as well. If you decide to use a backEnd approach, you can use any java dependency to convert to PDF, so the options are bigger. For example: https://www.baeldung.com/java-html-to-pdf 



Hope this helps.

1 reply

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
May 8, 2024

Hi, 

The easiest way would be to "print" your page as PDF, you could use JS and do something like window.print(). Otherwise, you can simply call a servlet and do the transformation in your servlet (backend).

Please check the solution in this thread: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/convert-aem-page-to-pdf/m-p/270625 which will work for your use case as well. If you decide to use a backEnd approach, you can use any java dependency to convert to PDF, so the options are bigger. For example: https://www.baeldung.com/java-html-to-pdf 



Hope this helps.

Esteban Bustamante