mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Use appearance stream to render locked annotations (bug 1723568)
This commit is contained in:
parent
e11371c75f
commit
8db77cc361
4 changed files with 26 additions and 1 deletions
|
@ -471,6 +471,12 @@ class Annotation {
|
|||
this._streams.push(this.appearance);
|
||||
}
|
||||
|
||||
// The annotation cannot be changed (neither its position/visibility nor its
|
||||
// contents), hence we can just display its appearance and don't generate
|
||||
// a HTML element for it.
|
||||
const isLocked = !!(this.flags & AnnotationFlag.LOCKED);
|
||||
const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS);
|
||||
|
||||
// Expose public properties using a data object.
|
||||
this.data = {
|
||||
annotationFlags: this.flags,
|
||||
|
@ -487,6 +493,7 @@ class Annotation {
|
|||
subtype: params.subtype,
|
||||
hasOwnCanvas: false,
|
||||
noRotate: !!(this.flags & AnnotationFlag.NOROTATE),
|
||||
noHTML: isLocked && isContentLocked,
|
||||
};
|
||||
|
||||
if (params.collectFields) {
|
||||
|
@ -1694,7 +1701,11 @@ class WidgetAnnotation extends Annotation {
|
|||
) {
|
||||
// Do not render form elements on the canvas when interactive forms are
|
||||
// enabled. The display layer is responsible for rendering them instead.
|
||||
if (renderForms && !(this instanceof SignatureWidgetAnnotation)) {
|
||||
if (
|
||||
renderForms &&
|
||||
!(this instanceof SignatureWidgetAnnotation) &&
|
||||
!this.data.noHTML
|
||||
) {
|
||||
return {
|
||||
opList: new OperatorList(),
|
||||
separateForm: true,
|
||||
|
|
|
@ -2621,6 +2621,9 @@ class AnnotationLayer {
|
|||
let zIndex = 0;
|
||||
|
||||
for (const data of annotations) {
|
||||
if (data.noHTML) {
|
||||
continue;
|
||||
}
|
||||
if (data.annotationType !== AnnotationType.POPUP) {
|
||||
const { width, height } = getRectDims(data.rect);
|
||||
if (width <= 0 || height <= 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue