mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 12:28:09 +03:00
fix #58 PDF file extension
This commit is contained in:
parent
f409f54e8f
commit
21b3f0e912
@ -174,8 +174,12 @@ void PreviewReportWidget::print()
|
||||
|
||||
void PreviewReportWidget::printToPDF()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(this,tr("PDF file name"),"","PDF(*.pdf)" );
|
||||
QString filter = "PDF (*.pdf)";
|
||||
QString fileName = QFileDialog::getSaveFileName(this,tr("PDF file name"),"","PDF (*.pdf)");
|
||||
if (!fileName.isEmpty()){
|
||||
QFileInfo fi(fileName);
|
||||
if (fi.suffix().isEmpty())
|
||||
fileName+=".pdf";
|
||||
QPrinter printer;
|
||||
printer.setOutputFileName(fileName);
|
||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||
|
Loading…
Reference in New Issue
Block a user