[Html2PdfConverter] Error when using from REST API

Forge Component
Published on 2018-10-30 by Guilherme Pereira
55 votes
Published on 2018-10-30 by Guilherme Pereira


Found an issue with the html2pdf converter when using it from a REST API

When generating the PDF, the is a GetBinariesDirectory method in the extension like this:

public void MssGetBinariesDirectory(out string ssWorkingDir) {

            ssWorkingDir = HttpContext.Current.Server.MapPath("../HtmlToPdfConverter/");

} // MssGetBinariesDirectory

This is expecting the directory to be something like "\platformInstallDir\running\MyApp.0398209\"

How when called through a REST API it is something like "\platformInstallDir\running\MyApp.3435345\rest\RESTAPI1\RESTMethod1\"

So going 1 up level does not work.

What would be an elegant approach for this?

Hi Rui,

That problem indeed existed on older versions of the component but it was fixed on version 1.1.4. So by updating to a newer version that should be fixed.