[Interest] Creating pdf with QTextDocument with chart
Jason H
jhihn at gmx.com
Mon Oct 26 15:24:48 CET 2015
The basic fall-back for this is to render the chart as an image.
I render PDFs with Qt, but I came up with my own framework. Basically, I using QPdfWriter it is possible to treat it as a widget, and have it lay itself out on the page too!
So what I so is I have several QWidget-derived classes that are positioned in the widget hierarchy, with spacers, properties, and constraints set just as a QWindow would, and have that go to the page. Each page is laid out this way, with QPdfWriter::newPage() called between them.
There is a bug in QPdfWriter though, where the font size needs to be manually scaled for logical DPI when using point sizes.
> Sent: Friday, October 23, 2015 at 12:21 PM
> From: Duane <duane.hebert at group-upc.com>
> To: interest at qt-project.org
> Subject: [Interest] Creating pdf with QTextDocument with chart
>
> I need to create a document as a pdf file for my application. I can use
> QTextDocument and html to do most of the document but I need to add a
> chart to it.
>
> I'm using Qt 4.8. Any suggestions?
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
More information about the Interest
mailing list