You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use the following piece of code the application crashes on the line converter.Convert(document); when second request comes in to convert.
private static readonly IToolset toolset;
private static readonly IConverter converter;
static PdfBuilder()
{
toolset = new PdfToolset(new WinAnyCPUEmbeddedDeployment(new TempFolderDeployment()));
converter = new ThreadSafeConverter(toolset);
}
public byte[] BuildPdf(string html)
{
var document = new HtmlToPdfDocument
{
Objects = { new ObjectSettings { HtmlText = html }, }
};
try
{
var result = converter.Convert(document);
toolset.Unload();
return result;
}
catch (Exception e)
{
throw;
}
}
When we use this piece of code bellow, the application works fine, though periodically it starts hanging, which lead me to the above piece of code and trying to uload.
private static readonly IConverter converter = new ThreadSafeConverter(new PdfToolset(new WinAnyCPUEmbeddedDeployment(new TempFolderDeployment())));
public byte[] BuildPdf(string html)
{
var document = new HtmlToPdfDocument
{
Objects = { new ObjectSettings { HtmlText = html}, }
};
try
{
return converter.Convert(document);
}
catch (Exception e)
{
throw;
}
}
I have read similar issues here, however I have not found a solution which would work, any help on this one?
The text was updated successfully, but these errors were encountered:
Hi,
When we use the following piece of code the application crashes on the line converter.Convert(document); when second request comes in to convert.
When we use this piece of code bellow, the application works fine, though periodically it starts hanging, which lead me to the above piece of code and trying to uload.
I have read similar issues here, however I have not found a solution which would work, any help on this one?
The text was updated successfully, but these errors were encountered: