We are running the below source code in alpine linux container.
Aspose.Words.Document doc = new Aspose.Words.Document("App/test.docx");
using MemoryStream pdfDocStream = new();
Aspose.Words.Saving.PdfSaveOptions options = new Aspose.Words.Saving.PdfSaveOptions();
doc.Save(pdfDocStream, options);
Aspose.Pdf.Document document = new Aspose.Pdf.Document(pdfDocStream);
document.Convert("log.xml",PdfFormat.PDF_A_1A,ConvertErrorAction.Delete,ConvertTransparencyAction.Default);
document.Save( "SathishTest.pdf");
And we get following error
Unhandled exception. System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception.
web-font | —> System.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.
web-font | at System.Drawing.LibraryResolver.EnsureRegistered()
web-font | at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
web-font | at System.Drawing.SafeNativeMethods.Gdip…cctor()
web-font | — End of inner exception stack trace —
web-font | at System.Drawing.SafeNativeMethods.Gdip.GdipCreateMatrix2(Single m11, Single m12, Single m21, Single m22, Single dx, Single dy, IntPtr& matrix)
web-font | at Aspose.Pdf.ImagePlacementAbsorber.#=zgJt75F8=(Page #=zl1Idajw=, OperatorCollection #=zFd9wHOI=, Resources #=zWyr5AEE=)
web-font | at Aspose.Pdf.ImagePlacementAbsorber.Visit(Page page)
web-font | at #=zKZIslgV_VTgI_laDaHeWpiZkfC7XbFZq740O6xK8krWe8dvil3HKne8=.#=z0rA10baddDFI(String #=zsmU4xHSeSsAX, String #=zdyoT5oBSVJEd)
web-font | at #=z$anv5esRDEIQyDXPJ_FZOnmbj4ed2viFa8orYkgD4B8rki8xa_LEGzs=.#=z1BLH_J4YGpC4()
web-font | at #=z$anv5esRDEIQyDXPJ_FZOnmbj4ed2viFa8orYkgD4B8rki8xa_LEGzs=.#=zYn6wCy1xwTvr()
web-font | at #=zKZIslgV_VTgI_laDaHeWpiZkfC7XbFZq740O6xK8krWe8dvil3HKne8=.#=zo8is4oM=()
web-font | at #=z$anv5esRDEIQyDXPJ_FZOnmbj4ed2viFa8orYkgD4B8rki8xa_LEGzs=.#=zgJt75F8=(XmlTextWriter #=z$Cn9iBQ=, PdfFormat #=z9oViWV4=, Document #=zqgQFGbg=, Boolean #=zfqQ5_VfFNYR1, ConvertErrorAction #=zNl0gHaM=)
web-font | at Aspose.Pdf.Document.Convert(String outputLogFileName, PdfFormat format, ConvertErrorAction action, ConvertTransparencyAction transparencyAction)
web-font | at Program.$(String[] args) in /app/App/Program.cs:line 37
web-font | at Program.(String[] args)
Our input file is test.docx (63.6 KB)