Building libgdiplus library from source

2020-10-02

When using the FastReport.NET (Core), FastReport Open Source and FastReport Mono libraries on Linux operating system, as well as when saving documents as images or PDF files, there is a possibility to experience the incorrect display of Unicode texts in the report preview.

One of the most common problems is a hyphenation error and, as a result, incorrect spacing between words. For example, when using Thai language on Windows OS, we see the following text:

Example

When running the same report on Linux Ubuntu, the following line is formatted incorrectly:

Example

There may also be problems with the word wrap. Let’s look at another example with Thai on Windows operating system:

Example

The same text is displayed incorrectly in Linux Ubuntu operating system:

Example

Such text display errors can be observed in other languages.

It is also possible that the following error will occur:

1
System.OutOfMemoryException: Not enough memory to complete operation [GDI+ status: OutOfMemory]

Fortunately, there is a solution – lingdiplus library self-assembly from source with Pango.

Before starting, it is highly recommended to make a backup copy of the /usr/lib/libgdiplus*.* files, as they will be overwritten with the new ones in the process of building the library. In this case, you can return the system to its original state if the desired result has not been achieved.

In the first step, we need to install the required dependencies using the command:

$ sudo apt-get install libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev libpango1.0-dev

Then we need to make a copy of the needed libgdiplus library from the GitHub repository: 

$ git clone https://github.com/mono/libgdiplus.git

After that, go to the libgdiplus folder and execute the build commands:

$ ./autogen.sh --with-pango --prefix=/usr
$ make

If the build was successful and there are no errors, then you can install the built library:

$ sudo make install

The files will replace the old ones in the /usr/lib folder.

Now you can run the program with reports and make sure it works correctly.

For example, you can see how FastReport Mono works under Linux Ubuntu 18.04:

FastReport Mono

All of the above is also true for web applications using the .NET Core and Mono frameworks.

I wish you the best of luck and less problems with cross-platform programs!

October 04, 2023

How to generate a report from an ASP.NET Core application using FastReport.Core.Skia

We tell you how to generate a report on Windows and Linux using FastReport.Core.Skia and a private NuGet server.
March 22, 2023

Creating PDF report in JetBrains Rider (C#) on Ubuntu 22.04.1 LTS

In this article, we'll take a look at the world of the .NET platform on Ubuntu 22.04.1 LTS and create a PDF exportable report.
February 14, 2023

How to set up an Apache2 web server for FastReport .NET

We are launching the Apache2 web server on the Linux operating system for FastReport.NET and .NET 5 with a few simple commands.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.