             , (err) ->
               error = new Error "PDF page #{ page.pageNumber } rendering error: #{ err.message or err }"
               _.extend error, _.omit err, 'message' if _.isObject err
+              terminate = true
               throw error
 
         #pdf.getMetadata(pageNumber).then (metadata) ->

            appendCounter = 0
            textLayer =
              beginLayout: ->
                #console.log "beginLayout"

              endLayout: ->
                #console.log "endLayout"

                if DEBUG

                  finalCallback()

              appendText: (geom) ->
                return if terminate

                width = geom.canvasWidth * geom.hScale
                height = geom.fontSize * Math.abs geom.vScale
                x = geom.x
