Skip to content

Commit

Permalink
Merge pull request #454 from Oslandia/atlas
Browse files Browse the repository at this point in the history
refs #7263
  • Loading branch information
mhugent committed Mar 7, 2013
2 parents 0a25aad + 7db1b60 commit 90b66dc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,16 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
}
if ( !atlasOnASingleFile )
{
// bugs #7263 and #6856
// QPrinter does not seem to be reset correctly and may cause generated PDFs (all except the first) corrupted
// when transparent objects are rendered. We thus use a new QPrinter object here
QPrinter multiFilePrinter;
outputFileName = QDir( outputDir ).filePath( atlasMap->currentFilename() ) + ".pdf";
mComposition->beginPrintAsPDF( printer, outputFileName );
mComposition->beginPrintAsPDF( multiFilePrinter, outputFileName );
// set the correct resolution
mComposition->beginPrint( printer );
painter.begin( &printer );
mComposition->doPrint( printer, painter );
mComposition->beginPrint( multiFilePrinter );
painter.begin( &multiFilePrinter );
mComposition->doPrint( multiFilePrinter, painter );
painter.end();
}
else
Expand Down

0 comments on commit 90b66dc

Please sign in to comment.