1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Ensure that readonly TextWidget-annotations are rendered when forms are disabled (issue 17064)

To reduced the risk of regressing something else, given that the issue only applies to a (for the default viewer) non-default configuration, this patch is purposely limited to only TextWidget-annotations in the display layer.
This commit is contained in:
Jonas Jenwald 2023-10-03 20:06:19 +02:00
parent 426209c6e6
commit f113320bd5
4 changed files with 13 additions and 0 deletions

View file

@ -1159,6 +1159,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
constructor(parameters) {
const isRenderable =
parameters.renderForms ||
parameters.data.hasOwnCanvas ||
(!parameters.data.hasAppearance && !!parameters.data.fieldValue);
super(parameters, { isRenderable });
}
@ -1497,6 +1498,10 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
element.textContent = this.data.fieldValue;
element.style.verticalAlign = "middle";
element.style.display = "table-cell";
if (this.data.hasOwnCanvas) {
element.hidden = true;
}
}
this._setTextStyle(element);