Skip to content
Permalink
Browse files

Print only requested pages

  • Loading branch information
mhugent committed Jul 18, 2012
1 parent 171ae62 commit fb10f1b459894f787dbe4e47debf6b6d8071adec
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/core/composer/qgscomposition.cpp
@@ -1260,11 +1260,15 @@ void QgsComposition::print( QPrinter &printer )

QPainter p( &printer );

//QgsComposition starts page numbering at 0
int fromPage = ( printer.fromPage() < 1 ) ? 0 : printer.fromPage() - 1 ;
int toPage = ( printer.toPage() < 1 ) ? numPages() - 1 : printer.toPage() - 1;

if ( mPrintAsRaster )
{
for ( int i = 0; i < numPages(); ++i )
for ( int i = fromPage; i <= toPage; ++i )
{
if ( i > 0 )
if ( i > fromPage )
{
printer.newPage();
}
@@ -1280,9 +1284,9 @@ void QgsComposition::print( QPrinter &printer )

if ( !mPrintAsRaster )
{
for ( int i = 0; i < numPages(); ++i )
for ( int i = fromPage; i <= toPage; ++i )
{
if ( i > 0 )
if ( i > fromPage )
{
printer.newPage();
}

0 comments on commit fb10f1b

Please sign in to comment.
You can’t perform that action at this time.