I am using Lazarus 3.99 on Debian Stable (Bookworm). I pulled Lazarus from GitHub and compiled it. I pulled TGridPrinter from SourceForge (v0.50) and installed/built the package.
I added a gridprinter and gridprinterpreview to my app, connected everything and ran, but when I try to print or execute preview, the app crashes (actually it hangs for a long time as it prints out the stack trace).
After much fiddling around, I finally figured out it's because Debian by default does not install a printer (I thought it installed a PDF printer as I saw it available in some apps, but I think those are either created by the app or is part of Gnome). After I installed cups-pdf so that I actually had a printer, it all worked.
So, to my question. Is there a way for me to determine if no printer is either selected or is default, prior to when TGridPrinter would get to whatever code is crashing (when I traced it seemed to be somewhere in the area of: line 1084 of source/gridprn.pas) according to the stack trace.
I'm thinking maybe an event that gets called after the printer selection dialog but before prepare canvas and maybe a property I can check. Or possibly I missed a setting which would tell the gridprinter not to conintue without a valid printer?