Run sample application

Hi, I try to use your samples on my laptop
How to run Aspose.PDF in Docker|Aspose.PDF for .NET

I have :
|Edition|Windows 10 Business|
|Version|22H2|
|Installed on|‎8/‎30/‎2022|
|OS build|19045.3693|
|Experience|Windows Feature Experience Pack 1000.19053.1000.0|
VS 2022 community edition
.NET 6, 7 SDK

On Windows base docker image it’s failed because fonts not found
On Linux base docker image its faild on

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for ‘Gdip’ threw an exception.
Source=System.Drawing.Common
StackTrace:
at System.Drawing.SafeNativeMethods.Gdip.GdipCreateRegion(IntPtr& region)
at System.Drawing.Region…ctor()
at #=zvgr47Zf8uscpz708Gxv0NYEQJE6B1QveAg==.#=zfq2s5eQ=(#=zBjGNkwtZmvRiBVY7JdGky4enOSXB7Hx4qA== #=z$7pkRZ8=)
at #=z0YBwZJ6XUlr2XR2wLvWccyPTQfhm8RjLP5cdAiY=.Clone()
at #=z594paDJatrHFvxfgN9LuyddWg6RIGxEUUqA4gRE=.#=z4rI9qDs=()
at #=z6fVMxG02wVWamdjQ31FAXP40JMYOAdQUvtFKXLA=.#=z4rI9qDs=()
at #=zDKIqL9wclfATDDT4Glps48IyNXaT.#=z$Mj9h1818xVB()
at #=z2ddhCv04TpmBKUjDnhp0WTbHh_qSv773uaRgMHbEgn$I.#=z$Mj9h1818xVB()
at #=z2ddhCv04TpmBKUjDnhp0WTbHh_qSv773uaRgMHbEgn$I.#=zPzXH$$aHZ8jt()
at #=z2ddhCv04TpmBKUjDnhp0WTbHh_qSv773uaRgMHbEgn$I.#=zcO0z6As=()
at #=zyEnMnypX06BBL63w_ujJZqa_uVb$Fv1JOkLyReYQUwkJ.#=z4t4qziY=(#=zfO9gMS5sAFPjs1itx8AzaBu3N2kC #=zABhdSFY=, #=zTfFVCF2X5NTH8zs5VZ5GOKQ6Gco6sCfN5g== #=zzLqkvhc=, #=z1j3F61zSVs61Ul7yWpYUOD1v5AOvJMnRc2_nMZ6eCe8p #=zjBgBNds=)
at Aspose.Pdf.Page.CalculateContentBBox()
at Aspose.Pdf.Page.#=zvrcg3qgdZuyT(Page #=zzLqkvhc=, List`1 #=z9exF5aM=, Double #=z6sqyV5s=, Double #=zE8NHF9s=)
at Aspose.Pdf.Page.#=zWTOj$Pg=(Page #=zzLqkvhc=)
at Aspose.Pdf.Document.ProcessParagraphs()
at Aspose.Pdf.Document.#=zLeJeh5AU$uzQ(Stream #=zmA65yBU=, SaveOptions #=z83vbOXk9r4N_)
at Aspose.Pdf.Document.Save(Stream output)
at Docker.Linux.Demo01.Controllers.HomeController.Generate() in C:\Users\YevhenTatarynov\source\repos\AsposeDockerSample\AsposeDockerSample\Controllers\HomeController.cs:line 97
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See Breaking change: System.Drawing.Common only supported on Windows - .NET | Microsoft Learn for more information.

Looks like it try use some windows specific features.

Could you, please advice.

BR,
Yevhen Tatarynov

@YevhenTatarynov
It looks like you are using the Aspose.Pdf library.
It uses GDI+, which is not supported in the new SDK on non-Windows systems. Use the Aspose.Pdf .Drawing library. To do this, you just need to change the links to the library used, the same API is used.

@YevhenTatarynov
And yes, you need to add fonts to the system.
forFontsInLinux.png (5.3 KB)