diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index baa4e05..7b03f13 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -278,8 +278,12 @@ void ReportEnginePrivate::printToFile(const QString &fileName) bool ReportEnginePrivate::printToPDF(const QString &fileName) { if (!fileName.isEmpty()){ + QFileInfo fi(fileName); + QString fn = fileName; + if (fi.suffix().isEmpty()) + fn+=".pdf"; QPrinter printer; - printer.setOutputFileName(fileName); + printer.setOutputFileName(fn); printer.setOutputFormat(QPrinter::PdfFormat); return printReport(&printer); }