Error to export to pdf server-side

Hi

I have the api developed in net core, from version 20.1.0.55, on my local pc everything works fine but when I deploy in docker the export to pdf throws me the error.

The version of the native libSkiaSharp library (80.3) is incompatible with this version of SkiaSharp. Supported versions of the native libSkiaSharp library are in the range [88.0, 89.0).

This is the method, the error is in 
 var pdfDocument = render.ConvertToPDF(wordDocument);

public FileStreamResult Export(string format, ExportData data)
{
var contentType = "";
var wordDocument = WordDocument.Save(data.DocumentData, FormatType.Docx);

var outputStream = new MemoryStream();

if (format == "pdf")
{
contentType = "application/pdf";

var render = new DocIORenderer
{
Settings =
{
AutoTag = true,
EmbedCompleteFonts = true,
OptimizeIdenticalImages = true,
AutoDetectComplexScript = true,
ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.Headings |
Syncfusion.DocIO.ExportBookmarkType.Bookmarks
}
};
render.Settings.ChartRenderingOptions.ImageFormat = ExportImageFormat.Jpeg;

var pdfDocument = render.ConvertToPDF(wordDocument);
SetDocumentInformation(ref pdfDocument, data);
render.Dispose();
wordDocument.Dispose();

pdfDocument.Save(outputStream);
pdfDocument.Close();

outputStream.Position = 0;

return File(outputStream, contentType, data.FileName + "." + format);
}
else
{
var type = GetFormatType(format);
switch (type)
{
case FormatType.Rtf:
contentType = "application/rtf";
break;
case FormatType.WordML:
contentType = "application/xml";
break;
case FormatType.Doc:
contentType = "application/msword";
break;
case FormatType.Docx:
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
break;
}

wordDocument = WordDocument.Save(data.DocumentData, type);

return File(wordDocument, contentType, data.FileName + "." + format);
}

Regards

Yosviel


2 Replies

SM Suriya Murugan Syncfusion Team May 18, 2022 03:54 AM UTC

Hi Yosivel,


We will check and update details shortly.


Regards,

Suriya M.



SM Suriya Murugan Syncfusion Team May 18, 2022 10:11 AM UTC

Hi Yosviel,


We suspect that reported issue might be due to not using of SkiaSharp.NativeAssets.Linux and HarfBuzzSharp.NativeAssets.Linux in your application.

We suggest you to install the SkiaSharp.NativeAssets.Linux v2.88.0-preview.209 and HarfBuzzSharp.NativeAssets.Linux v2.8.2-preview.209 NuGet package along with Syncfusion.DocIORenderer.Net.Core NuGet while performing Word to PDF conversion in Docker environment and let us know whether it is working fine in your side.

Please refer the following UG documentation link.
https://help.syncfusion.com/file-formats/docio/word-to-pdf#word-to-pdf-conversion-in-linux-os



Regards,

Suriya M.



Loader.
Up arrow icon