[Interest] Creating pdf with QTextDocument with chart

Duane duane.hebert at group-upc.com
Mon Oct 26 15:34:54 CET 2015


On 26/10/2015 10:24 AM, Jason H wrote:
> 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
>>


Thanks.  But unfortunately we're at Qt 4.8 and QPDFWriter is available 
on in Qt5 as far as I can tell.  I don't see a way to generate a report 
in pdf with Qt4 other than QTextDocument/QPrinter and in that case I 
don't see a way to get the chart into it.




More information about the Interest mailing list