Q&A - Question

[C#] NullReferenceException in TGIS_RendererSkiaSharp.CanvasBrush when printing SVG symbols with vector PDF engine (NewPrintPdf)

Question
EltS asked on August 06, 2026, keyword: Developer Kernel

Environment: C# / ASP.NET Core, TatukGIS Developer Kernel (DK), versions 113.0.41183 and 116.0.42368.

When using the vector PDF print engine (enabled via TGIS_Utils.GisMetadata().set_Values("TGIS_ViewerWeb.NewPrintPdf", "true")), printing a layer whose symbol is drawn manually inside the OnPaintShape event throws a NullReferenceException.

Inside the PaintShape handler we have a TGIS_ParamsMarker paramsMarker object, configured and drawn like this:

The exception is thrown exactly on the paramsMarker.Symbol.Draw(ptC.X, ptC.Y) line, invoked via TGIS_LayerVector.DrawShapeSpecial:

Layers that assign the symbol declaratively instead (shape.Params.Marker.Symbol + SymbolRotate, letting the engine call Draw internally via the normal DrawShape path) print fine — the error only happens with this manual Prepare/Draw/Unprepare pattern inside DrawShapeSpecial. With the classic (non-vector) print engine the same manual code works without errors.

Is this a known limitation of the vector PDF engine's internal SkiaSharp bridge? Is there a supported way to draw an SVG symbol at an arbitrary position (not the shape's default marker point) that's compatible with NewPrintPdf?

Answers
Alicja Karczewska (TatukGIS) replied August 06, 2026
Hello,
It looks like you wanted to pass the content of the OnPaintShape handler and you missed it.
But the error message indicates that you are using the TGIS_Symbol.Draw() function to draw. For NewPrintPdf use TGIS_Symbol.DrawEx() instead.
If this doesn't help, please report the issue to support@tatukgis.com. The OnPaintShape handler's content will be then very helpful.
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.