We express our huge gratitude to Peter Robinson for the creation of manual about «Using Document .Net in Linux» (PDF).
Known Issues:
-------------------
DOCX to PDF - If you are using Net Core 6.X, then there may be a problem with the System.Drawing.Common library.
Because, according to Microsoft, System.Drawing.Common only supported on Windows and if you need to use it on the Linux Platform, there are some problems:
Starting in .NET 6, the platform analyzer emits compile-time warnings when referencing code is compiled for non-Windows operating systems. In addition, the following run-time exception is thrown unless you set a configuration option:
Because System.Drawing.Common was designed to be a thin wrapper over Windows technologies, its cross-platform implementation is subpar.
libgdiplus is the main provider of the cross-platform implementation of System.Drawing.Common on the native side. libgdiplus is effectively a reimplementation of the parts of Windows that System.Drawing.Common depends on. That implementation makes libgdiplus a non-trivial component. It's around 30,000 lines of C code that's largely untested, and it lacks a lot of functionality. libgdiplus also has numerous external dependencies for image processing and text rendering, such as cairo, pango, and other native libraries. Those dependencies make maintaining and shipping the component even more challenging. Since the inclusion of the Mono cross-platform implementation, we have redirected numerous issues to libgdiplus that never got fixed. In comparison, other external dependencies we have taken, such as icu or openssl, are high-quality libraries. It's not viable to get libgdiplus to the point where its feature set and quality is on par with the rest of the .NET stack.
From analysis of NuGet packages, we've observed that System.Drawing.Common is used cross-platform mostly for image manipulation, such as QR code generators and text rendering. We haven't noticed heavy graphics usage, as our cross-platform graphics support is incomplete. The usages we see of System.Drawing.Common in non-Windows environments are typically well supported with SkiaSharp.
System.Drawing.Common will continue to evolve only in the context of Windows Forms and GDI+.
How to fix it for Net Core 2.X-6.X:
You can enable support for non-Windows platforms in .NET 6 by setting the System.Drawing.EnableUnixSupport runtime configuration switch to true in the runtimeconfig.json file.
{
"configProperties": {
"System.Drawing.EnableUnixSupport": true
}
}
How to fix it for Net Core 7.X: We plan to migrate on SkiaSharp's engine
--------------------
PDF to DOCX - and libgdiplus library for Net Core.
There are a lot of Linux varieties: Suse, Fedora, Debian, Ubuntu, etc.
In addition, there are cloud platforms: AWS Lambda, Google Cloud, Azure, Apex, etc.
Because our dll works with Graphics and using GDI+ API, you need to check, that your
system has System.Drawing.Common is the graphics library which ships as part of .NET
Core. On macOS and Linux, it uses libgdiplus as its back-end.
There are existing ways to install libgdiplus on macOS and Linux. On macOS, you can use
the mono-libgdiplus Homebrew package; on Ubuntu Linux, you can install the libgdiplus-dev package
How to fix it for ALL Net Core:
On Debian-based Linux distributions you can use apt-get to install the dependencies:
sudo apt-get install libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev
If you need a new code example or have a question: email us at support@sautinsoft.com or ask at Online Chat (right-bottom corner of this page) or use the Form below: