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 update  
    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 
    
    MacOS
    1. Install homebrew.
    2. Install additional operating system libraries.
    brew install mono-libgdiplus  
    brew install pango
    
    Windows

    Use vcpkg to install DLLs. Run the Admin Command Prompt and execute the following commands:

    git clone https://github.com/microsoft/vcpkg.git
    cd vcpkg
    .\bootstrap-vcpkg.bat
    vcpkg.exe integrate install
    vcpkg.exe install pango --triplet x86-windows
    vcpkg.exe install pango --triplet x64-windows
    

    The DLLs are located in the vcpkg repository's installed subfolder.

  3. Register the cross-platform drawing engine at application startup.

    The code below registers the drawing engine if the application is executed on a non-Windows platform. The engine does not need to be registered on Windows because reports are rendered without the issues described above.

    
    public void ConfigureServices(IServiceCollection services) {
        // ...
        if(!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
            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.