Просмотр исходного кода

stream in the whole pdf file after loading the required page

Brian Gough 12 лет назад
Родитель
Сommit
1e2e1ecb9c
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee

+ 4 - 2
services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee

@@ -9,8 +9,10 @@ define [
 			JOB_QUEUE_INTERVAL: 25
 			JOB_QUEUE_INTERVAL: 25
 
 
 			constructor: (@url, @options) ->
 			constructor: (@url, @options) ->
-				PDFJS.disableAutoFetch = true
-				PDFJS.disableFontFace = true
+				PDFJS.disableFontFace = true  # avoids repaints, uses worker more
+				# PDFJS.disableAutoFetch = true # enable this to prevent loading whole file
+				# PDFJS.disableStream
+				# PDFJS.disableRange
 				@scale = @options.scale || 1
 				@scale = @options.scale || 1
 				@document = $q.when(PDFJS.getDocument @url, null, null, @options.progressCallback)
 				@document = $q.when(PDFJS.getDocument @url, null, null, @options.progressCallback)
 				@navigateFn = @options.navigateFn
 				@navigateFn = @options.navigateFn