octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print Dialog


From: John Swensen
Subject: Re: Print Dialog
Date: Mon, 9 Feb 2015 16:33:17 -0500


On Feb 9, 2015, at 4:18 PM, John W. Eaton <address@hidden> 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)
2) Send the QImage as the file to print (http://stackoverflow.com/questions/8310681/how-to-print-image-file-from-a-printer-using-qt/8311217#8311217)


John Swensen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]