We are using ironPDF to convert our document into PDF, it was working fine and was converting our documents (HTML) to PDF seamlessly in localhost, and after confirming everything we have bought a license of 1 year and uploaded the code to Production.
As soon as we have uploaded our code in Production, we are getting an error: access to the path 'IronPdf.ChromeRenderingEngine.dll' is denied.
Here is the code that we are using
string file = $"{Guid.NewGuid().ToString().Replace("-", "")}.pdf";
IronPdf.License.LicenseKey = ConfigurationManager.AppSettings["IronPdf.LicenseKey"];
IronPdf.Installation.TempFolderPath = ironPdf;
var pdfPrintOptions = new PdfPrintOptions()
{
InputEncoding = Encoding.UTF8,
PaperOrientation = PdfPrintOptions.PdfPaperOrientation.Portrait,
MarginTop = 10,
MarginBottom = 10,
MarginLeft = 10,
MarginRight = 10,
Footer = new SimpleHeaderFooter()
{
RightText = "Page {page} of {total-pages}",
DrawDividerLine = true,
FontSize = 10,
FontFamily = "Open Sans"
},
CssMediaType = PdfPrintOptions.PdfCssMediaType.Print
};
var Renderer = new HtmlToPdf(pdfPrintOptions);
var PDF = Renderer.RenderHtmlAsPdf(htmlContent.ToString());
PDF.SaveAs($"{sourceUrl}{file}");
PDF.Dispose();