mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 08:29:07 +03:00
fix #58 PDF file extension
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user