Recent

Author Topic: Printing image in CGI using CUPS  (Read 2467 times)

martinrame

  • Full Member
  • ***
  • Posts: 119
Printing image in CGI using CUPS
« on: May 21, 2018, 02:09:32 am »
Hi, I want to print an image in a CUPS printer from a Linux CGI application.

I'm reading a JPEG image using TFPMemoryImage and TFPReaderJPEG and trying to print using the Printer object.

So far I can print Printer.Canvas.TextOut without problems, but cannot do Printer.Canvas.Draw o Printer.Canvas.StretchDraw and related methods.

I think the problem is that I'm working on NoGUI.

Any hint?.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Printing image in CGI using CUPS
« Reply #1 on: May 21, 2018, 09:37:10 am »
Yes, the printers package has widgetset specific implementation (see osprinters.pas and widgetset specific folders in the same directory), where nogui doesn't have one. I think you should be fine targeting gtk2, but no guarantee on this. Just try it and report.

martinrame

  • Full Member
  • ***
  • Posts: 119
Re: Printing image in CGI using CUPS
« Reply #2 on: May 21, 2018, 02:24:52 pm »
Hi Leledumbo, I can't do that, because the target server doesn't have a gui (it's an Ubuntu server).

I've found the Canvas used by the printer is TCairoPSCanvas, but it looks like it  can't handle bitmaps...


 

TinyPortal © 2005-2018