Sign in Join

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

Mailing lists / lazarus / 2010-02

Printing in Linux

7 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Unknown author

Hi.

I'am working on multiplatform Win/Lin app whose main job is graphics printing. In Windows all works ok, but in Linux output postscript is wrong. After little digging I found that TPoscriptCanvas is responsible for it.

I have a question about Lazarus future plans in rendering graphics output to postscript.

Shouldn't be better to use for example Cairo than make poscript output yourself?

Petr

Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Felipe Monteiro de Carvalho
to Unknown author
Shouldn't be better to use for example Cairo than make poscript output yourself?

The printing package is implemented by operating system rather then by widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a new code would need to be written for LCL-Qt.

Felipe Monteiro de Carvalho

Reply by email

zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 7 lines
On Mon, Feb 15, 2010 at 6:23 AM, wrote: > Shouldn't be better to use for example Cairo than make poscript output > yourself? The printing package is implemented by operating system rather then by widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a new code would need to be written for LCL-Qt.

Qt can output directly to printer,postscript file & pdf file.

Reply by email

Unknown author
to Felipe Monteiro de Carvalho: The printing package is implemented by operating system rather then by widgetset, so if…
Felipe Monteiro de Carvalho wrote 7 lines
On Mon, Feb 15, 2010 at 6:23 AM, wrote: > Shouldn't be better to use for example Cairo than make poscript output > yourself? The printing package is implemented by operating system rather then by widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a new code would need to be written for LCL-Qt.

I maybe don`t understand your answer. In Windows is rendering for printer implemented by operating system WinAPI. But in Unix we need to render into postscript. Now it is realised by TPoscriptCanvas which do not use any library, but output is erroneous.

As I know, Qt has its own rendering engine (screen and printer). For example Kylix uses it.
And I now do not know if in LCL exists TQtCanvas used by LCL-Qt.

Cairo library is multiplatform and renders into X11, Win32, PS, PDF, ... It do not depends on gtk.
Dependency is reversed -- new Gtk2 uses Cairo to render widgets. For example WebKit and Firefox3 uses this library on all platforms. http://en.wikipedia.org/wiki/Cairo_(graphics)

What about to make TCairoCanvas and use it by default in LCL-Gtk2. IMHO generated postscript output should be better then TPoscriptCanvas makes.

TCairoCanvas (certainly with corresponding library) can be useful in other platforms. Rendering into PDF, SVG or PNG may be convenience to anybody.

Petr

Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Felipe Monteiro de Carvalho
to Unknown author
Cairo library is multiplatform and renders into X11, Win32, PS, PDF, ... It do not depends on gtk.

Yes, but it adds an external dependency which would need to be deployed with software that uses it, and Lazarus cannot impose such restriction in everyone that uses it. That's why it would only be used in LCL-Gtk2, as it already depends on Cairo

What about to make TCairoCanvas and use it by default in LCL-Gtk2. IMHO generated postscript output should be better then TPoscriptCanvas makes.

We still need to hear other developers, but sure, I guess if you implement a TCairoCanvas and contribute it, and it works better then the current method, then it will be added and used for LCL-Gtk2. We can keep the current postscript canvas for other UNIXes, even if after that a Qt-specific method is added, because then it can be used for other UNIX widgetsets that may be added one day (fpgui, for example)

thanks,

Felipe Monteiro de Carvalho

Reply by email

Jesus Reyes
to Unknown author: I maybe don`t understand your answer. In Windows is rendering for printer implemented by…
> > Shouldn't be better to use for example Cairo than make poscript output > > yourself?

It has pros and cons, on the nice side a very big amount of programming would be reused which means a better quality on output but it does impose a library dependency on application. I don't see that as a impossible obstacle though, on windows application deployment may include needed libraries (problems that comes with this approach are beyond of this topic) and on Linux needed libraries are usually already installed.

Show quoted text 13 lines
> > The printing package is implemented by operating system rather then by > widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a > new code would need to be written for LCL-Qt. I maybe don`t understand your answer. In Windows is rendering for printer implemented by operating system WinAPI. But in Unix we need to render into postscript. Now it is realised by TPoscriptCanvas which do not use any library, but output is erroneous.

It may be independent of GTK2.

Show quoted text 6 lines
As I know, Qt has its own rendering engine (screen and printer). For example Kylix uses it. And I now do not know if in LCL exists TQtCanvas used by LCL-Qt.

Printer support is already implemented for Qt, and if we want to support GTK native printer dialogs we need to implement a cairo canvas anyway.

Show quoted text 15 lines
Cairo library is multiplatform and renders into X11, Win32, PS, PDF, ... It do not depends on gtk. Dependency is reversed -- new Gtk2 uses Cairo to render widgets. For example WebKit and Firefox3 uses this library on all platforms. http://en.wikipedia.org/wiki/Cairo_(graphics) What about to make TCairoCanvas and use it by default in LCL-Gtk2. IMHO generated postscript output should be better then TPoscriptCanvas makes.

I been playing with this for long time, but every time there is something more to do, of course a patch would be welcome.

Show quoted text 11 lines
TCairoCanvas (certainly with corresponding library) can be useful in other platforms. Rendering into PDF, SVG or PNG may be convenience to anybody. Petr -- Petr Kristan

Jesus Reyes A.

Encuentra las mejores recetas en Yahoo! Cocina.
http://mx.mujer.yahoo.com/cocina/

Reply by email