Print Dialog

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Print Dialog

John W. Eaton
Administrator
I checked in the following changeset to enable the "Save" and "Save As"
options in the "File" menu for the Qt Figure widget:

   http://hg.savannah.gnu.org/hgweb/octave/rev/7335cc071ab0

I'd also like to provide a "Print" option so that we can send figure
output directly to a printer.  Does anyone with Qt experience know how
best to do this?  We can already generate PostScript or PDF output, but
what is the proper way to use the QPrintDialog and QPrinter classes to
send PostScript to a printer?

jwe

Reply | Threaded
Open this post in threaded view
|

Re: Print Dialog

John Swensen-3

On Feb 9, 2015, at 4:18 PM, John W. Eaton <[hidden email]> wrote:

I checked in the following changeset to enable the "Save" and "Save As" options in the "File" menu for the Qt Figure widget:

 http://hg.savannah.gnu.org/hgweb/octave/rev/7335cc071ab0

I'd also like to provide a "Print" option so that we can send figure output directly to a printer.  Does anyone with Qt experience know how best to do this?  We can already generate PostScript or PDF output, but what is the proper way to use the QPrintDialog and QPrinter classes to send PostScript to a printer?

jwe


I think you will have to add a dependency for poppler to get PDF->QPrinter working. I don't think it has the capability to print straight from postscript or pdf (http://stackoverflow.com/questions/8296021/how-to-print-pdf-file-in-qt/8297239#8297239).  The basic process is:

1) Generate a QImage from the PDF using poppler (http://doc.qt.digia.com/qq/qq27-poppler.html) or from a pixel buffer (e.g. glReadPixels)


John Swensen
Reply | Threaded
Open this post in threaded view
|

Re: Print Dialog

Michael Godfrey
In reply to this post by John W. Eaton
 >>send PostScript to a printer?

PDF is the usual format for printers.

Michael



Reply | Threaded
Open this post in threaded view
|

Re: Print Dialog

bpabbott
Administrator
In reply to this post by John W. Eaton

> On Feb 9, 2015, at 4:18 PM, John W. Eaton <[hidden email]> wrote:
>
> I checked in the following changeset to enable the "Save" and "Save As" options in the "File" menu for the Qt Figure widget:
>
>  http://hg.savannah.gnu.org/hgweb/octave/rev/7335cc071ab0
>
> I'd also like to provide a "Print" option so that we can send figure output directly to a printer.  Does anyone with Qt experience know how best to do this?  We can already generate PostScript or PDF output, but what is the proper way to use the QPrintDialog and QPrinter classes to send PostScript to a printer?
>
> jwe

I have no idea how to use Qt to send PostScript to a printer, but Octave can do that by ...

        print -dpsc2

Ben


Reply | Threaded
Open this post in threaded view
|

Re: Print Dialog

John Swensen-3
In reply to this post by Michael Godfrey

On Feb 9, 2015, at 5:44 PM, Michael Godfrey <[hidden email]> wrote:

>>send PostScript to a printer?

PDF is the usual format for printers.

Michael


Apparently the QT to lpr is still postscript, but for whatever reason postscript support exposed to the API user was removed in QT5. See http://qt-project.org/forums/viewthread/24857

John S.
Reply | Threaded
Open this post in threaded view
|

Re: Print Dialog

bpabbott
Administrator

On Feb 9, 2015, at 6:26 PM, John Swensen <[hidden email]> wrote:


On Feb 9, 2015, at 5:44 PM, Michael Godfrey <[hidden email]> wrote:

>>send PostScript to a printer?

PDF is the usual format for printers.

Michael

Apparently the QT to lpr is still postscript, but for whatever reason postscript support exposed to the API user was removed in QT5. See http://qt-project.org/forums/viewthread/24857

John S.

This may be useful in planning a solution that won’t end up being broken by Qt’s development plans. 


Ben