Use htmlToPDF instead of htmlFileToPDF.
First of all, thank you for your reply.
Well, far from me from being a nitpicker but isnt's htmlToPDF supposed to perform an HTML -> PDF conversion of an URL?
According to the docs, htmlToPDF "creates a PDF document from an HTML file located at a given URL"; the input parameter inputURL is the URL of the HTML page you want to convert.
OK, even files on a filesystem can be can be accessed as URLs but is there something wrong with the htmlFileToPDF API?
I'm new to LCES2 so I might be wrong but, from the docs, I thought htmlFileToPDF was well suited for what I was trying to achieve; or perhaps the doc for this API has to be amended?
1 person found this helpful
I though you wanted to create it from a URL sorry. I just glanced through the post.
The documentation is fine. htmlFileToPDF can convert html content.
The trick is you need to put it in a document variable (com.adobe.idp.Document) and set a property to a temporary name so it knows it's a single file and not a zip.
Document htmlDoc = new Document(htmlContent.getBytes());
No need to apologize and thanks for your help.
I'm pretty new with LCES2 APIs so I did not pay enough attention to the setAttibute() method; by following your example, everything now works as expected.