Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF rendering in Linux #144

Open
lkosson opened this issue Jun 19, 2023 · 0 comments
Open

PDF rendering in Linux #144

lkosson opened this issue Jun 19, 2023 · 0 comments

Comments

@lkosson
Copy link
Owner

lkosson commented Jun 19, 2023

TLDR: No native support for exporting RDLC to PDF under Linux. Use Wine for a workaround.

Reporting services uses Uniscribe to measure fonts when laying out PDF. Uniscribe libraries are loaded via P/Invoke and are provided only for Windows platform. This causes any attempts to directly use this package to render PDFs when deployed to linux server to end with error mentioning missing usp10.dll shared library.

Preliminary experiments show that effort required to port PDF exporter to use some other method/library for laying out text is comparable to completely rewriting the exporter using other available cross-platform PDF library, such as QuestPDF (iText is out of scope due to its license). Either task is well beyond what I can provide, as this whole project is still non-profit one-man job.

Moreover, with .NET 6 Microsoft is sunsetting GDI support for non-windows platforms, further increasing complexity and scope of porting required to get PDFs working in Linux.

On the bright side, Wine project provides linux implementations of many Win32-specific libraries. As of Wine version 5.0, Uniscribe implementation is mature enough to support all the functions required by Reporting Services. This means you can use it as a workaround for rendering your reports to PDFs. The workaround is a bit clunky and goes like this:

  • Install Wine 5.0 or newer. For Debian Bullseye or Bookworm, apt install wine will do.
  • Download Windows version of .NET runtime binaries from https://dotnet.microsoft.com/en-us/download/dotnet - e.g. https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-3.1.30-windows-x86-binaries.
  • Extract/install those binaries to some local folder, e.g. ~/dotnet-3.1-windows.
  • Start your application using 64-bit version of Wine and Windows version of .NET, e.g. wine64 ~/dotnet-3.1-windows/dotnet.exe YourApplication.dll.

If your application crashes with unsupported flags 00000020 somewhere inside bcrypt, make sure you have proper version of Wine installed. Wine 4.1 provided in Debian Buster and earlier won't work.

@lkosson lkosson pinned this issue Jun 19, 2023
Repository owner locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant