Skip to main content
Level 3
Mar 20, 2025 2:33 PM UTC
Solved

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

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. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
PavanGaddamAccepted solution
Adobe Employee
Mar 21, 2025 6:14 PM UTC

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

4 replies

arunpatidar
Community Advisor
Community Advisor
Mar 20, 2025 4:16 PM UTC
giuseppebaglio
Level 10
Mar 21, 2025 4:55 PM UTC

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-during-activation.html 

Translate
PavanGaddamAdobe EmployeeAccepted solution
Adobe Employee
Mar 21, 2025 6:14 PM UTC

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

Translate
kautuk_sahni
Level 9
Apr 1, 2025 12:38 PM UTC

@akashdeepaem Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!

Translate
Kautuk Sahni