PDF file export
-
Hi,
Something like this:
QPdfWriter pdfWriter(filePath); QPainter painter(&pdfWriter); textDocument->drawContents(&painter);
should do the trick.
Hope it helps
-
You should then maybe adapt the handling of the table to fit on pages to print.
-
Maybe try Lime Report ? Dev's support always online.
Lime Report is multi-platform and fully supported report engine library, report generator, report designer, report writer, reporting tool and reporting solution written in C++ based on Qt cross-platform application and UI framework. Lime Report is the best choice if you are looking for a Qt report engine, Qt report tool, Qt report library, Qt reporting tool, C++ reporting library for Qt or a Qt reporting library or simply a printing tool that generates PDF document from Qt using an XML template.
-
It is good decision, but I try to export long table and it is not fit in one page :(((( And many rows are cut...
@sashapont The best way is to use report generators.
Consider CuteReport. It has pagination, item splitting, text flow, automatic table of contents and a lot of other handy features.
It is provided under both GPL/LGPL and proprietary Enterprise version.
Take a look:
CuteReport
SourceForge