|
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
webKitSettings.TempPath = "D://Project/Temp"; |
Hello Prakash,
the temp folder has elevated permissions, so it cannot be a problem.
It is interesting, this problem only occurs occassionaly (not in case of all conversion) and not in all the devices.
Hello Prakash,
the temp folder has elevated permissions, so it cannot be a problem.
It is interesting, this problem only occurs occassionaly (not in case of all conversion) and not in all the devices.
HtmlToPdfConverter converter = new HtmlToPdfConverter();
WebKitConverterSettings settings = new WebKitConverterSettings();
settings.TempPath = $"{Directory.GetCurrentDirectory()}{@"\wwwroot\temp"}";
settings.WebKitPath = Path.Combine(_honstingEnvironment.ContentRootPath, "QtBinariesDotNetCore");
converter.ConverterSettings = settings;
//string htmlText = "<html><body><img src=\"Bloom_Logo_Icon.png\" alt=\"Bloom_logo\" width=\"200\" height=\"70\"><p> <h1>Hello World</h1></p>"+strHtml + "</body></html>";
//string baseUrl = $"{Directory.GetCurrentDirectory()}{@"\wwwroot\images"}";
//PdfDocument document = converter.Convert(htmlText, baseUrl);
PdfDocument document = converter.Convert(http://bloom/emp/Empcourse);
MemoryStream ms = new MemoryStream();
document.Save(ms);
document.Close(true);
ms.Position = 0;
fileStreamResult = new FileStreamResult(ms, "application/pdf");
fileStreamResult.FileDownloadName = "Sample.pdf";
return fileStreamResult;
***I am using QtBinariesDotNetCore folder under my project directory.
all files copying to server while deploying.
any advice please?