There is a problem during converting PDF file with handwritten text to a set of PNG files on Linux system.
Everything works fine on Windows system, but on Linux system there are some PDF files that are being converted to a BLACK image.
Aspose.PDF 20.1.0
.NET Core 3.0
The following commands were used to deploy the code
docker pull mcr.microsoft.com/dotnet/core/sdk:3.0.100-bionic
docker run -itd -v d:/myapp:/myapp --name aspose-test mcr.microsoft.com/dotnet/core/sdk:3.0.100-bionic /bin/bash
docker start -i aspose-test
apt update
apt install -y fontconfig
apt install -y libgdiplus
apt install -y --no-install-recommends libc6-dev
cd myapp
dotnet publish -c Release
dotnet /myapp/bin/Release/netcoreapp3.0/publish/AsposeTest.dll
The following code was used for this converting (it’ written in C#):
private static void TestPdf_1(string file)
{
using var converter = new AsposePdfConverter();
converter.BindPdf($"TestData/{file}");
converter.DoConvert();
converter.StartPage = 1;
converter.EndPage = 4;
Directory.CreateDirectory("Result");
int resolution = 150;
double coef = resolution / 72.0;
Resolution asposeResolution = new Resolution(resolution);
converter.Resolution = asposeResolution;
var page = converter.Document.Pages[1];
int width = (int)(page.Rect.Width * coef);
int height = (int)(page.Rect.Height * coef);
string dstFileName = $"Result/{file}_{DateTime.UtcNow:yyyy-MM-dd_hh_mm_ss}.png";
converter.GetNextImage(dstFileName, System.Drawing.Imaging.ImageFormat.Png, width, height, 75);
}
image.png (47.9 KB)
image.png (361 Bytes)