mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #12106 from calixteman/storage
Add an annotation storage in order to save annotation data in acroforms
This commit is contained in:
commit
bf539deada
13 changed files with 152 additions and 7 deletions
|
@ -38,6 +38,7 @@ class AnnotationLayerBuilder {
|
|||
pdfPage,
|
||||
linkService,
|
||||
downloadManager,
|
||||
annotationStorage,
|
||||
imageResourcesPath = "",
|
||||
renderInteractiveForms = false,
|
||||
l10n = NullL10n,
|
||||
|
@ -49,6 +50,7 @@ class AnnotationLayerBuilder {
|
|||
this.imageResourcesPath = imageResourcesPath;
|
||||
this.renderInteractiveForms = renderInteractiveForms;
|
||||
this.l10n = l10n;
|
||||
this.annotationStorage = annotationStorage;
|
||||
|
||||
this.div = null;
|
||||
this._cancelled = false;
|
||||
|
@ -73,6 +75,7 @@ class AnnotationLayerBuilder {
|
|||
renderInteractiveForms: this.renderInteractiveForms,
|
||||
linkService: this.linkService,
|
||||
downloadManager: this.downloadManager,
|
||||
annotationStorage: this.annotationStorage,
|
||||
};
|
||||
|
||||
if (this.div) {
|
||||
|
@ -124,6 +127,7 @@ class DefaultAnnotationLayerFactory {
|
|||
createAnnotationLayerBuilder(
|
||||
pageDiv,
|
||||
pdfPage,
|
||||
annotationStorage,
|
||||
imageResourcesPath = "",
|
||||
renderInteractiveForms = false,
|
||||
l10n = NullL10n
|
||||
|
@ -135,6 +139,7 @@ class DefaultAnnotationLayerFactory {
|
|||
renderInteractiveForms,
|
||||
linkService: new SimpleLinkService(),
|
||||
l10n,
|
||||
annotationStorage,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1164,6 +1164,7 @@ class BaseViewer {
|
|||
renderInteractiveForms,
|
||||
linkService: this.linkService,
|
||||
downloadManager: this.downloadManager,
|
||||
annotationStorage: this.pdfDocument.annotationStorage,
|
||||
l10n,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ function composePage(pdfDocument, pageNumber, size, printContainer) {
|
|||
transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],
|
||||
viewport: pdfPage.getViewport({ scale: 1, rotation: size.rotation }),
|
||||
intent: "print",
|
||||
annotationStorage: pdfDocument.annotationStorage.getAll(),
|
||||
};
|
||||
return pdfPage.render(renderContext).promise;
|
||||
})
|
||||
|
|
|
@ -49,6 +49,7 @@ function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size) {
|
|||
transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],
|
||||
viewport: pdfPage.getViewport({ scale: 1, rotation: size.rotation }),
|
||||
intent: "print",
|
||||
annotationStorage: pdfDocument.annotationStorage.getAll(),
|
||||
};
|
||||
return pdfPage.render(renderContext).promise;
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue