mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-09-23 08:39:07 +03:00
.pdf extension will be added to filename if filename has no extension
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user