We are using Aspose.Total.NET.lic license in dotnet application. When trying to convert html file to pdf using Aspose.PDF package from linux server it is throwing below error:
Error message:
The type initializer for 'Gdip' threw an exception.
StackTrace:
System.Drawing.SafeNativeMethods.Gdip.GdipCreateMatrix2(Single m11, Single m12, Single m21, Single m22, Single dx, Single dy, IntPtr& matrix)\n at System.Drawing.Drawing2D.Matrix..ctor(Single m11, Single m12, Single m21, Single m22, Single dx, Single dy)\n at #=zvLLzAUYTltvrLQ_ovTKNc94=..ctor(Single #=z5$6GhCY=, Single #=zoMR81us=, Single #=zKKkxzCA=, Single #=zaZ9kxqo=, Single #=zy6K1mkQ=, Single #=zyBPnB$g=)\n at #=z92NsO8vQFnhTrMi6MMLNjYIdCLUp21zCUA==.#=zijzACKWy7UwsoNgTL8vTBx4=(SizeF #=z2f3ae8s=)\n at #=z92NsO8vQFnhTrMi6MMLNjYIdCLUp21zCUA==.#=zCqBXh6k=(SizeF #=z2f3ae8s=)\n at #=z_mhIgkFH9cYvZjU9s692gcZkKB5VUXnSbg==.Render(#=zTppk8ewd7c$fARK1Ss$UFWUPqNqN #=z4zoGrLI=, CancellationToken #=zeMkaCxs=)\n at #=zpwj5XGAaoIoEYnk3qgwTvMl5sQoX.#=z1l0wXaKzQL23(#=zpal0xlZm1TysXuavNhGT364= #=zS$4HIgLu4jT4xBCcSA==, #=zZgK7g4kExoiJVjvzkglru1lg3Xi6[] #=zE6AhlBGjZiS5, #=zTppk8ewd7c$fARK1Ss$UFWUPqNqN #=z4zoGrLI=, CancellationToken #=zYCgnwPs=)\n at #=z83lVzBXnypAA3f0hazlON55hTZEt.Render(#=zTppk8ewd7c$fARK1Ss$UFWUPqNqN #=z4zoGrLI=, CancellationToken #=zYCgnwPs=, #=zqk7PnJWchsgFEFB$8xhqLpY=[] #=zB_MSV6k=, #=z2OY2FUZ3ANy2$cuM9EvrJoA=[] #=zs6Jtchk=)\n at #=z83lVzBXnypAA3f0hazlON55hTZEt.Render(#=zTppk8ewd7c$fARK1Ss$UFWUPqNqN #=z4zoGrLI=, TimeSpan #=zw7VFzWI=, #=ztjsxeLJtYnHfUHEmVBrAnlY=[] #=zEXhLzS8=)\n at #=zPAH6K6IYjBtuIwxLsoxYgc$lUnG2.Render(#=zTppk8ewd7c$fARK1Ss$UFWUPqNqN #=z4zoGrLI=, #=zzGGBmwY= #=zONDdwgw=, TimeSpan #=zw7VFzWI=)\n at #=zPAH6K6IYjBtuIwxLsoxYgc$lUnG2.Render(#=zTppk8ewd7c$fARK1Ss$UFWUPqNqN #=z4zoGrLI=, #=zzGGBmwY= #=zONDdwgw=)\n at #=zwam3ITW9KZH23SxC_5jBNkkDmPcu.#=zY5iolZxucd8s(Stream #=zMNFFFq$YmvhH, Document #=z2OPF5ZVGYyLC, HtmlLoadOptions #=zZh_vbMhyDANm, String #=ziRJUqanIGp7I)\n at #=zwam3ITW9KZH23SxC_5jBNkkDmPcu.#=zuCNbsd4=(Stream #=zMNFFFq$YmvhH, Document #=z2OPF5ZVGYyLC, HtmlLoadOptions #=zZh_vbMhyDANm, String #=ziRJUqanIGp7I)\n at #=zwam3ITW9KZH23SxC_5jBNkkDmPcu.#=zuCNbsd4=(Stream #=zMNFFFq$YmvhH, Document #=z2OPF5ZVGYyLC, HtmlLoadOptions #=zZh_vbMhyDANm)\n at Aspose.Pdf.Document.#=zj6SKKT4=(Stream #=zaz2v9Wg=, LoadOptions #=zrfBUdC4=, Boolean #=znxZXujUcWi3p)\n at Aspose.Pdf.Document.#=zj6SKKT4=(Stream #=zaz2v9Wg=, LoadOptions #=zrfBUdC4=)\n at Aspose.Pdf.Document..ctor(Stream input, LoadOptions options)\n at KPMG.DocProcessor.HTML.HTMLProcessorAsposeImpl.ConvertToPDF(Stream docStream) in /App/DocProcessor/src/HTML/HTMLProcessorAsposeImpl.cs:line 11\n at KPMG.DocProcessor.HTML.HTMLController.ConvertToPDF(IFormFile file) in /App/DocProcessor/src/HTML/HTMLController.cs:line 28\n at lambda_method4(Closure, Object)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope
It is working fine on windows.