|
using Syncfusion.DocIORenderer;
using Syncfusion.Pdf;
[HttpPost]
[Route("DocToPDF")]
public string DocToPDF()
{
IFormFile file = HttpContext.Request.Form.Files[0];
Stream stream = new MemoryStream();
file.CopyTo(stream);
stream.Position = 0;
Syncfusion.DocIO.DLS.WordDocument wordDocument = new Syncfusion.DocIO.DLS.WordDocument(stream, Syncfusion.DocIO.FormatType.Docx);
//Instantiation of DocIORenderer for Word to PDF conversion
DocIORenderer render = new DocIORenderer();
//Converts Word document into PDF document
PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
//Saves the PDF file
FileStream fileStream = new FileStream(hostingEnvironment.WebRootPath + "\\Files\\" + "sample.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite);
pdfDocument.Save(fileStream);
//Closes the instance of PDF document object
render.Dispose();
wordDocument.Dispose();
pdfDocument.Dispose();
fileStream.Close();
return "Success";
} |
System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory at SkiaSharp.SkiaApi.sk_colortype_get_default_8888() at SkiaSharp.SKImageInfo..cctor()