Sign in Join

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

Mailing lists / fpc-pascal / 2012-01

Postscriptcanvas

14 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Unknown author
to Michael Van Canneyt

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.

Show quoted text 17 lines
On Fri, 13 Jan 2012, David Copeland wrote: > Hi, > > 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. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Michael Van Canneyt
to Unknown author
Show quoted text 7 lines
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.

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.

Reply by email

Unknown author
to Michael Van Canneyt
Show quoted text 26 lines
On Sat, 14 Jan 2012, wrote: > 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. 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.

Reply by email

David Copeland
to Felipe Monteiro de Carvalho

This would be for printing.

Earlier message 18 lines
-----Original Message----- From: Felipe Monteiro de Carvalho Reply-to: FPC-Pascal users discussions To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] Postscriptcanvas Date: Sun, 15 Jan 2012 13:11:13 -0200 On Fri, Jan 13, 2012 at 3:31 PM, David Copeland wrote: > Is it possible to use the PostScriptCanvas unit in a non-gui program? For drawing or for printing? -- David Copeland JSI Data Systems Limited 613-727-9353.

Reply by email

Felipe Monteiro de Carvalho
to David Copeland

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.

Felipe Monteiro de Carvalho

Reply by email

David Copeland
to Felipe Monteiro de Carvalho

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.

Earlier message 20 lines
-----Original Message----- From: Felipe Monteiro de Carvalho Reply-to: FPC-Pascal users discussions To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] Postscriptcanvas Date: Mon, 16 Jan 2012 14:14:44 +0100 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. -- David Copeland JSI Data Systems Limited 613-727-9353.

Reply by email

Felipe Monteiro de Carvalho
to David Copeland
David Copeland wrote
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?

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

Reply by email

Mattias Gaertner
to Felipe Monteiro de Carvalho

Felipe Monteiro de Carvalho hat am 17.
Januar 2012 um 13:59 geschrieben:

Show quoted text 6 lines
On Tue, Jan 17, 2012 at 1:40 PM, David Copeland wrote: > 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? No, it doesn't implement printing.

The printer4lazarus package uses cups by default. I have not tested if it works with the nogui widgetset.

Show quoted text 6 lines
> 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

Show quoted text 7 lines
> 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.

Yes.

OTOH cups gives some information about the queue and the printer.

Mattias

Reply by email

David Copeland
to Felipe Monteiro de Carvalho: 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.

Earlier message 32 lines
-----Original Message----- From: Felipe Monteiro de Carvalho Reply-to: FPC-Pascal users discussions To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] Postscriptcanvas Date: Tue, 17 Jan 2012 13:59:19 +0100 On Tue, Jan 17, 2012 at 1:40 PM, David Copeland wrote: > 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? 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. -- David Copeland JSI Data Systems Limited 613-727-9353.

Reply by email

Unknown author
to Mattias Gaertner: Felipe Monteiro de Carvalho hat am 17. Januar 2012 um 13:59 geschrieben: The…
Mattias Gaertner wrote 33 lines
Felipe Monteiro de Carvalho hat am 17. Januar 2012 um 13:59 geschrieben: > On Tue, Jan 17, 2012 at 1:40 PM, David Copeland > wrote: >> 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? > > No, it doesn't implement printing. The printer4lazarus package uses cups by default. I have not tested if it works with the nogui widgetset. >> 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. Yes. OTOH cups gives some information about the queue and the printer.

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.

Reply by email