Hi,
Is it possible to use the PostScriptCanvas unit in a non-gui program?
Thanks,
Dave.

Mailing lists / fpc-pascal / 2012-01
14 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
Is it possible to use the PostScriptCanvas unit in a non-gui program?
Thanks,
Dave.
David Copeland wroteHi, Is it possible to use the PostScriptCanvas unit in a non-gui program?
If you are talking about the pscanvas unit of FPC: Yes, that is what it is for.
Michael.
Micheal,
Thank you. I was referring to LCL Postscriptcanvas unit which I use in GUI programs. When I tried to use it in a non-GUI program, it could not be found. Are these two really the same thing, or at least similar to use? If not the same, can you point me to any documentation or example code? I did find the source so I will try to puzzle it out from that.
Dave.
They try to achieve the same thing. The API is necessarily similar, since it is based on TFPCanvas.
I suppose that meanwhile the Lazarus version is more complete as there are more people to support it, but it has more requirements as well.
I will see if it can be separated out of lazarus, so it has no GUI dependencies.
Michael.
Michael,
Thanks very much, that would would be great. I appreciate it.
Dave.
Is it possible to use the PostScriptCanvas unit in a non-gui program? Dave.
David Copeland wroteIs it possible to use the PostScriptCanvas unit in a non-gui program?
For drawing or for printing?
This would be for printing.
If you are trying to print, why do you want to use PostScriptCanvas directly? Are you targeting only UNIXes? How will you connect the generated postscript to the printer? You have your own code for that?
I would recommend that you use the LCL in your project and print via the Printer object, as normally done. LCL applications do not need to be visual, just make an application without any forms.
Hi Felipe,
I had not thought that approach (a non-visual lcl program) to be possible, but I will try it. Would I use the Nogui widgetset? Would such a program run on a host where X was not installed? I am targeting only Linux. I save the output to a file (SaveToFile). The user prints the file if needed.
Thanks,
Dave.
David Copeland wroteI had not thought that approach (a non-visual lcl program) to be possible, but I will try it. Would I use the Nogui widgetset?
No, it doesn't implement printing.
Would such a program run on a host where X was not installed?
No
I am targeting only Linux. I save the output to a file (SaveToFile). The user prints the file if needed.
Well, if you are not printing in your software then you are not doing printing, only drawing. So the answer to my original questions should have been "Drawing". So with your requirements using the LCL is probably not necessary. If you are targeting only linux then you can probably use a command line execution to print the file.
Felipe Monteiro de Carvalho hat am 17.
Januar 2012 um 13:59 geschrieben:
The printer4lazarus package uses cups by default. I have not tested if it works with the nogui widgetset.
The user prints the
Yes.
OTOH cups gives some information about the queue and the printer.
Mattias
On Tue, Jan 17, 2012 at 1:40 PM, David Copeland No, it doesn't implement printing. No…
Okay, I now understand the distinction between printing and drawing. Using the LCL was only necessary to use it's Postscriptcanvas as that is what I'm familiar with. But as this program needs to be able to run without X, I will either puzzle out the FCL's fpcanvas, or just write the postscript myself.
Thanks,
Dave.
I think I was wrong about the nogui LCL widgetset. It should probably be able to run the unit Postscriptcanvas and require no X11.
Another option would be adding postscript output to fpvectorial. It has postscript input at the moment but not output: http://wiki.lazarus.freepascal.org/fpvectorial
Felipe Monteiro de Carvalho hat am 17. Januar 2012 um 13:59 geschrieben: The…
Purely as a side note:
This is not relevant if the user is behind a browser on another machine. For instance, none of our webservers has cups installed.
Michael.