Printer.RawMode in OS X lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- gabriemarcelo · 2013-09-11 22:13 Hi guys, I'm trying to send raw bytes to a printer using Printer.RawMode := true; setting but I get the following error on OS X: "Canvas not allowed in Raw Mode" That's because raw mode is not implemented in freepascal when targeting OS X? thanks in advance! ---------------------------------------------------------------------- BigChimp · 2013-09-12 07:47 Just a guess: if you have raw printing I'd assume you'd be sending commands to the printer yourself in whatever format/language the printer understands (e.g. postscript, PCL,...). I would then think that Lazarus wouldn't know how to translate the bits/images on the canvas to the commands needed to print... because it doesn't know what language to use. So in short, I would think this is a limitation of raw mode in general. Corrections welcome - haven't ever printed from Lazarus yet ---------------------------------------------------------------------- gabriemarcelo · 2013-09-12 10:51 Yes, I send the bytes (commands) the printer will understand. This is the simple code that works just fine under Windows but that fails under OS X with such error: Code: [Select]procedure PrintRawBytes(const buffer:array of byte); var    Written: Integer; begin    Printer.RawMode := true;    Printer.BeginDoc;    Printer.Write(buffer, Length(buffer), Written);    Printer.EndDoc; end; ---------------------------------------------------------------------- BigChimp · 2013-09-12 11:39 Ok, I understand - so it looks like the OSX Lazarus code is doing things with a Canvas that it shouldn't. You could look at the source code and see if you can spot/fix the problem... in any case looks like you could file a bug report (first looking for existing bug reports, create the report with test application attached, and as much info as possible, and any possible indications of the fixes/patch etc).... ---------------------------------------------------------------------- gabriemarcelo · 2013-09-12 12:00 well it seems rawmode is not implemented at all when targeting OS X as the sample code shipped with lazarus and found here $(lazarusdir)\components\printers\samples\rawmode\rawmodetest.lpi throws the same exception Where can I send that bug or feature request? thanks, ---------------------------------------------------------------------- BigChimp · 2013-09-12 12:47 See the bugtracker link at the top left of this page. Also http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report ---------------------------------------------------------------------- bpranoto · 2019-10-26 12:18 This also happens in recent version on Qt5. I just submitted a bug report: https://bugs.freepascal.org/view.php?id=36216