1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #13592 from calixteman/xfa_print_only

XFA - Don't display print-only elements
This commit is contained in:
calixteman 2021-06-21 21:02:53 +02:00 committed by GitHub
commit e84b3bbf6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 2 deletions

View file

@ -71,6 +71,7 @@ import {
fixDimensions,
fixTextIndent,
getFonts,
isPrintOnly,
layoutClass,
layoutText,
measureToString,
@ -302,6 +303,10 @@ class Area extends XFAObject {
class: ["xfaArea"],
};
if (isPrintOnly(this)) {
attributes.class.push("xfaPrintOnly");
}
if (this.name) {
attributes.xfaName = this.name;
}
@ -1140,12 +1145,19 @@ class ContentArea extends XFAObject {
width: measureToString(this.w),
height: measureToString(this.h),
};
const classNames = ["xfaContentarea"];
if (isPrintOnly(this)) {
classNames.push("xfaPrintOnly");
}
return HTMLResult.success({
name: "div",
children: [],
attributes: {
style,
class: ["xfaContentarea"],
class: classNames,
id: this[$uid],
},
});
@ -1515,6 +1527,9 @@ class Draw extends XFAObject {
if (this.font) {
classNames.push("xfaFont");
}
if (isPrintOnly(this)) {
classNames.push("xfaPrintOnly");
}
const attributes = {
style,
@ -2083,6 +2098,10 @@ class ExclGroup extends XFAObject {
classNames.push(cl);
}
if (isPrintOnly(this)) {
classNames.push("xfaPrintOnly");
}
attributes.style = style;
attributes.class = classNames;
@ -2331,6 +2350,10 @@ class Field extends XFAObject {
classNames.push("xfaFont");
}
if (isPrintOnly(this)) {
classNames.push("xfaPrintOnly");
}
const attributes = {
style,
id: this[$uid],