This is a demo .NET 6 Web API using ceTe.DynamicPDF.Rasterizer.NET to draw images based on a PDF document.
It was created in order to easily reproduce an issue using Rasterizer. The issue consists of an incompatibility of the library running on ARM64 architecture.
The Dockerfile included in this solution can use one of following docker images as base:
mcr.microsoft.com/dotnet/aspnet:6.0.11-jammy-amd64
mcr.microsoft.com/dotnet/aspnet:6.0.11-jammy-arm64v8
The application behaviour should be the same on both, but when using the ARM64 version, the library is throwing the following error:
Unable to load shared library 'DPDFRenderNative_x64' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libDPDFRenderNative_x64: cannot open shared object file: No such file or directory
The API exposes only 1 endpoint:
- GET /pdf/{page} where page is the page number (zero-based) of the PDF document being used for tests
- clone repository
- open solution src/DynamicPDFSample.sln
- choose profile "Docker"
- Run the API
- call the endpoint /pdf/0
This is the expected response from the HTTP call:
However, if we switch the base image in the Dockerfile to run on ARM64, we get the error mentioned above.