Expand my Community achievements bar.

AEM 6.5.21 Create PDFs from static HTML(with inline CSS) programatically as a DAM asset

Avatar

Level 4

In AEM 6.5.21 we require to create PDFs from static HTML(with inline CSS) programatically as a DAM asset.
We have an endpoint that gives text/html response HTML(with inline CSS).


Have tried PDFBox but it displays the html content as text in the PDF. 

3 Replies

Avatar

Community Advisor

Avatar

Level 6

hi @akashdeepAEM

Under the assumption of installing wkhtmltopdf on the machine running AEM, you can also test and evaluate this option:

https://experience-aem.blogspot.com/2019/06/aem-65-workflow-step-to-generate-pdf-of-sites-page-durin... 

Avatar

Employee

@akashdeepAEM I would recommend using the  https://developer.adobe.com/document-services/docs/apis/#tag/Html-to-PDF/operation/pdfoperations.ht...and then write the asset to the DAM using the Assets API / utilities.