[Html2PdfConverter] Error when using from REST API

[Html2PdfConverter] Error when using from REST API

  
Forge Component
(42)
Published on 23 Jun by Guilherme Pereira
42 votes
Published on 23 Jun by Guilherme Pereira

Hi,

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.


Cheers,

Guilherme