mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 08:34:38 +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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user