mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
.pdf extension will be added to filename if filename has no extension
This commit is contained in:
parent
ed926de523
commit
43a62bdb7f
@ -278,8 +278,12 @@ void ReportEnginePrivate::printToFile(const QString &fileName)
|
|||||||
bool ReportEnginePrivate::printToPDF(const QString &fileName)
|
bool ReportEnginePrivate::printToPDF(const QString &fileName)
|
||||||
{
|
{
|
||||||
if (!fileName.isEmpty()){
|
if (!fileName.isEmpty()){
|
||||||
|
QFileInfo fi(fileName);
|
||||||
|
QString fn = fileName;
|
||||||
|
if (fi.suffix().isEmpty())
|
||||||
|
fn+=".pdf";
|
||||||
QPrinter printer;
|
QPrinter printer;
|
||||||
printer.setOutputFileName(fileName);
|
printer.setOutputFileName(fn);
|
||||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||||
return printReport(&printer);
|
return printReport(&printer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user