[fpc-pascal] Printing TFPImage to TCairoPSCanvas

Leonardo M. Ramé martinrame at yahoo.com
Mon May 21 14:35:29 CEST 2018


On Mon, 21 May 2018, Leonardo M. Ramé via fpc-pascal wrote:

> Hi, I need to print an TFPMemoryimage into Printer.Canvas (which uses
> TCairoPSCanvas to printing to CUPS) from a Linux CGI (no widgetset), but
> it seems that it's an impossible task, because Printer.Canvas requieres a
> TBitmap which in turn requires a widgetset.  Can anyone help me with
> this?.
>
> BTW, can fpReport print to a Printer? all the examples "exports" to PDF and other formats, but none of them is sending directly the report to a printer.


If you use the LCL, it uses the printer canvas.

A FPImage PostScript canvas exists, but it's largely untested. In theory,
this could be used to create a postscript file and that could be sent
directly to cups.

Michael.

Hi Michael, do you mean TPostscriptCanvas from PSCanvas.pp?, that doesn't seem to have a way to render a bitmap.

I think I must send my bitmap to imagemagick's convert to create the Postscript file, then use lpr to send it to the printer.

Leonardo.



More information about the fpc-pascal mailing list