 
       @renderPdf()
 
-  renderPdf: ->
+  renderPdf: (scrollAfterRender = true) ->
     @centersBetweenPages = []
     @pageHeights = []
 

  resetZoom: ->
    @adjustSize(@defaultScale / @currentScale)

  adjustSize: (factor) ->
    @currentScale = @currentScale * factor
    @renderPdf()
    @scrollTop(@scrollTop() * factor)
    @scrollLeft(@scrollLeft() * factor)

  getCurrentPageNumber: () ->
    return @currentPageNumber

          context = canvas.getContext('2d')
          canvas.height = viewport.height
          canvas.width = viewport.width
          @pageHeights.push(Math.floor(viewport.height))

          pdfPage.render({canvasContext: context, viewport: viewport})

          if pdfPage.pageNumber == @pdfDocument.numPages and scrollAfterRender
            @scrollTop(@scrollTopBeforeUpdate)
            @scrollLeft(@scrollLeftBeforeUpdate)
            @setCurrentPageNumber()
            @updating = false

  zoomOut: ->
    @adjustSize(100 / (100 + @scaleFactor))

  zoomIn: ->
    @adjustSize((100 + @scaleFactor) / 100)
