mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
[editor] Disable the editor-buttons in XFA documents
Given the differences between XFA documents and "normal" PDF documents, we don't support editing of the former ones. Hence, when a XFA-document is opened, we temporarily disable the editor-buttons.
This commit is contained in:
parent
9b22483e00
commit
d34e7fff01
6 changed files with 37 additions and 15 deletions
|
@ -359,6 +359,13 @@ class BaseViewer {
|
|||
return this.#annotationMode === AnnotationMode.ENABLE_FORMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
get enableAnnotationEditor() {
|
||||
return !!this.#annotationEditorUIManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
|
@ -719,9 +726,8 @@ class BaseViewer {
|
|||
const annotationLayerFactory =
|
||||
this.#annotationMode !== AnnotationMode.DISABLE ? this : null;
|
||||
const xfaLayerFactory = isPureXfa ? this : null;
|
||||
const annotationEditorLayerFactory = this.#annotationEditorUIManager
|
||||
? this
|
||||
: null;
|
||||
const annotationEditorLayerFactory =
|
||||
this.#annotationEditorUIManager && !isPureXfa ? this : null;
|
||||
|
||||
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
||||
const pageView = new PDFPageView({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue