Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges


htmlFileToPdf method failing to generate PDF


Level 4

HI folks

we are trying to create a Servlet using Component and ask is to generate PDF from HTML File using following code but it is throwing an exception


com.adobe.pdfg.exception.ConversionException: ALC-PDG-080-019-Input file does not contain the index html file.

The HTML file I am using is basic one and converting to aemfd doc before passing to conversion method.

Pl help share inputs where things are wrong

AEM 6.5.8 OSGI AEM Forms on Linux


@component(service = Servlet.class, property = { Constants.SERVICE_DESCRIPTION + "=Testing Report Generation","sling.servlet.paths=" + "/bin/test-automation-report",})

public class HTMLtoPDFServlet extends SlingSafeMethodsServlet {
	GeneratePDFService pdfGenService ;
protected void doGet(final SlingHttpServletRequest request, final SlingHttpServletResponse response)
			throws ServletException, IOException {
String inputFileName = "C://Users//manu.gupta//Downloads//testing//Test-Automation.html";
InputStream is = new FileInputStream(inputFileName);
Document returnDoc = new com.adobe.aemfd.docmanager.Document(is);
String securitySettings = "No Security";
String fileTypeSettings = "Standard";
com.adobe.pdfg.result.HtmlToPdfResult result;
		try {
			result = pdfGenService.htmlFileToPdf(returnDoc, securitySettings, fileTypeSettings, null, null);
			//Get the newly created document
			com.adobe.aemfd.docmanager.Document createdDocument = result.getCreatedDocument();
		catch (ConversionException | InvalidParameterException | FileFormatNotSupportedException e) {





1 Accepted Solution


Correct answer by
Level 4
3 Replies


Level 4

HI Anish

I dont need a iTextRenderer or any other API solution. My ask is for AEM forms Services method on why it is not working.


Correct answer by
Level 4

closing this thread as I have moved the question to AEM forms community