mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Reduce PDF.js maxCanvasPixels in Safari (#23781)
GitOrigin-RevId: 3b75d85bb4af33e4d4d40ee6f1dc9cf375f1435f
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
LinkTarget,
|
||||
} from 'pdfjs-dist/web/pdf_viewer.mjs'
|
||||
import 'pdfjs-dist/web/pdf_viewer.css'
|
||||
import browser from '@/features/source-editor/extensions/browser'
|
||||
|
||||
const DEFAULT_RANGE_CHUNK_SIZE = 128 * 1024 // 128K chunks
|
||||
|
||||
@@ -36,7 +37,7 @@ export default class PDFJSWrapper {
|
||||
eventBus: this.eventBus,
|
||||
imageResourcesPath,
|
||||
linkService: this.linkService,
|
||||
maxCanvasPixels: 8192 * 8192, // default is 4096 * 4096, increased for better resolution at high zoom levels
|
||||
maxCanvasPixels: browser.safari ? 4096 * 4096 : 8192 * 8192, // default is 4096 * 4096, increased for better resolution at high zoom levels (but not in Safari, which struggles with large canvases)
|
||||
annotationMode: PDFJS.AnnotationMode.ENABLE, // enable annotations but not forms
|
||||
annotationEditorMode: PDFJS.AnnotationEditorType.DISABLE, // disable annotation editing
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user