Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-05

Printing TFPImage to TCairoPSCanvas

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

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. Regards,Leonardo.

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé
Leonardo M. Ramé wrote 7 lines
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.

Reply by email

Leonardo M. Ramé
to Michael Van Canneyt
Leonardo M. Ramé wrote 7 lines
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.

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé
Leonardo M. Ramé wrote 21 lines
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.

Yes, that is what I meant. It desperately awaits completion of course :(

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.

That will be the easiest for the time being...

Michael.

Reply by email

Graeme Geldenhuys
to Leonardo M. Ramé: Hi, I need to print an TFPMemoryimage into Printer.Canvas (which uses TCairoPSCanvas to…
Leonardo M. Ramé wrote
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.

Printing was not in the original design spec of fpReport - but that doesn't mean it can't do it. I prefer to think of it as a positive point
- saving the trees, environment and all that. ;-)

In the mean time you can send the exported PDF or images to the printer via lpr or such - as you already mentioned.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email