Skip to main content
May 8, 2024 10:09 AM UTC
Solved

Need to generate a PDF file from a AEM wite page

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.
EstebanBustamante
EstebanBustamanteAccepted solution
Adobe Champion and Community Advisor
May 8, 2024 1:59 PM UTC

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

1 reply

EstebanBustamante
Adobe Champion and Community Advisor
EstebanBustamanteAdobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
May 8, 2024 1:59 PM UTC

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.

Translate
Esteban Bustamante