All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Use the DevExpress Cross-Platform Drawing Engine

  • 2 minutes to read

This topic describes how to replace the libdgiplus-based drawing engine with the DevExpress cross-platform drawing engine in your ASP.NET Core application. A drawing engine is invoked when users preview, print, or export reports. Based on tests conducted on Linux and MacOS, the cross-platform engine renders reports more accurately. The following improvements are seen, for instance, when users export reports to image and PDF on Linux:

  • Fully displayed text

    libgdiplus Cross-platform drawing engine
  • International character set support

    libgdiplus Cross-platform drawing engine
  • Correctly applied text emphasis

    libgdiplus Cross-platform drawing engine
  • Proper text alignment

    libgdiplus Cross-platform drawing engine

Follow the steps below to enable the cross-platform drawing engine for your reports:

  1. Add the DevExpress.CrossPlatform.Printing.DrawingEngine NuGet package to your ASP.NET Core application.

    dotnet add package DevExpress.CrossPlatform.Printing.DrawingEngine
    
  2. Configure the environment.

    Debian Linux

    Install the following operating system libraries:

    sudo apt-get update  
    sudo apt-get install -y software-properties-common  
    sudo add-apt-repository 'deb http://deb.debian.org/debian sid main'  
    sudo apt-get install libgdiplus
    sudo apt-get install libicu-dev libharfbuzz0b libfontconfig1 libfreetype6
    sudo apt-get install libpango-1.0-0
    sudo apt-get install libpangocairo-1.0
    sudo apt-get update
    
    MacOS
    1. Install homebrew.
    2. Install additional operating system libraries.
    brew install mono-libgdiplus  
    brew install pango
    
    Windows

    Install the following DLLs to your project:

    • libpango-1.0-0.dll
    • libpangocairo-1.0-0.dll
    • libpangoft2-1.0-0.dll
    • libpangowin32-1.0-0.dll
    • libgobject-2.0-0.dll
    • libcairo-2.dll
    • libglib-2.0-0.dll
    • iconv.dll
    • libbz2-1.dll
    • libexpat-1.dll
    • libffi-6.dll
    • libfontconfig-1.dll
    • libfreetype-6.dll
    • libgcc_s_seh-1.dll
    • libharfbuzz-0.dll
    • libintl-8.dll
    • libpixman-1-0.dll
    • libpng16-16.dll
    • libwinpthread-1.dll
    • zlib1.dll
  3. Register the cross-platform drawing engine at application startup.

    
    public void ConfigureServices(IServiceCollection services) {
        // ...
        DevExpress.Printing.CrossPlatform.CustomEngineHelper.RegisterCustomDrawingEngine(
            typeof(
                DevExpress.CrossPlatform.Printing.DrawingEngine.PangoCrossPlatformEngine
            ));
    }
    

The application is ready. It uses the cross-platform drawing engine to print and export reports, and to display them in the Document Viewer.

TIP

A sample project with the DevExpress cross-platform drawing engine enabled: https://github.com/DevExpress-Examples/Reporting-Use-the-DevExpress-CrossPlatform-Drawing-Engine.