Normally, this would not be an issue. When developing, you can see a "Trial" watermark in your reports and thats it.
And if you render a report with at least 2 pages, Stimulsoft replaces the second page with a message "Your trial is over!".
If your server is running on Windows, this works.
On Linux, instead of seeing the "Your trial is over!", the export crashes with following message:
Code: Select all
TypeInitializationException: The type initializer for 'Gdip' threw an exception.
{"title":"response.error.internal-server-error","status":500,"detail":"response.error.internal-server-error-detail","timestamp":"2025-09-15T11:00:37.3912843Z","values":{},"message":"An error occured on the server and the request was ended prematurely. This could have cause side-effects, please report this to the support","traceId":"00-07b7f01a306ba4e2af0adc052d1f4a5b-9e974a182718e209-00","request":{"path":"...","method":"POST","contentType":"application/json","length":2,"timestamp":"2025-09-15T11:00:37.1323446Z"},"user":{...},"translations":{"en":{"title":"Request failed unexpectedly","detail":"Request failed due to a server error. Please do not send any further requests until we have fixed the error"},"de":{"title":"Die Anfrage ist unerwartet fehlgeschagen","detail":"Die Anfrage ist aufgrund eines Serverfehlers fehlgeschlagen. Bitte senden Sie keine weiteren Anfragen, bis wir den Fehler behoben haben"}}}
at System.Drawing.SafeNativeMethods.Gdip.GdipGetGenericFontFamilySansSerif(IntPtr& fontfamily)
at System.Drawing.FontFamily.GetGdipGenericSansSerif()
at System.Drawing.FontFamily.get_GenericSansSerif()
at System.Drawing.Font.CreateFont(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style)
at Stimulsoft.Report.Export.StiExportUtils.CheckPassive(StiPagesCollection pages)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.<>c__DisplayClass790_0.<ExportDocumentAsync>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Stimulsoft.Report.StiReport.ExportDocumentAsync(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)
if you use System.Drawing in your project or not,
if you install libgdiplus on your server or in your docker image,
what content is in your MRT files.
Every document with more than 1 page crashes. Every document with exactly 1 page works perfectly.
This was a NIGHTMARE to debug and cost us DAYS investigating and reproducing this issue.
Please, if you claim to be Unix compatible, do it right.
Solution:
So for anyone finding this post in the future, just add your license and the error disappears.