: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const blob = new Blob([buffer], {
const parent = this[$getParent]();
return HTMLResult.success({
src: URL.createObjectURL(blob),
alt: parent ? ariaLabel(parent[$getParent]()) : null
class ImageEdit extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "imageEdit", true);
this.data = getStringOption(attributes.data, ["link", "embed"]);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
if (this.data === "embed") {
return HTMLResult.success({
class Integer extends ContentObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "integer");
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const number = parseInt(this[$content].trim(), 10);
this[$content] = isNaN(number) ? null : number;
[$toHTML](availableSpace) {
return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
class Issuers extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "issuers", true);
this.id = attributes.id || "";
this.type = getStringOption(attributes.type, ["optional", "required"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.certificate = new XFAObjectArray();
class Items extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "items", true);
this.id = attributes.id || "";
this.name = attributes.name || "";
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
this.ref = attributes.ref || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.boolean = new XFAObjectArray();
this.date = new XFAObjectArray();
this.dateTime = new XFAObjectArray();
this.decimal = new XFAObjectArray();
this.exData = new XFAObjectArray();
this.float = new XFAObjectArray();
this.image = new XFAObjectArray();
this.integer = new XFAObjectArray();
this.text = new XFAObjectArray();
this.time = new XFAObjectArray();
for (const child of this[$getChildren]()) {
output.push(child[$text]());
return HTMLResult.success(output);
class Keep extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "keep", true);
this.id = attributes.id || "";
const options = ["none", "contentArea", "pageArea"];
this.intact = getStringOption(attributes.intact, options);
this.next = getStringOption(attributes.next, options);
this.previous = getStringOption(attributes.previous, options);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class KeyUsage extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "keyUsage");
const options = ["", "yes", "no"];
this.crlSign = getStringOption(attributes.crlSign, options);
this.dataEncipherment = getStringOption(attributes.dataEncipherment, options);
this.decipherOnly = getStringOption(attributes.decipherOnly, options);
this.digitalSignature = getStringOption(attributes.digitalSignature, options);
this.encipherOnly = getStringOption(attributes.encipherOnly, options);
this.id = attributes.id || "";
this.keyAgreement = getStringOption(attributes.keyAgreement, options);
this.keyCertSign = getStringOption(attributes.keyCertSign, options);
this.keyEncipherment = getStringOption(attributes.keyEncipherment, options);
this.nonRepudiation = getStringOption(attributes.nonRepudiation, options);
this.type = getStringOption(attributes.type, ["optional", "required"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Line extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "line", true);
this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
this.id = attributes.id || "";
this.slope = getStringOption(attributes.slope, ["\\", "/"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const parent = this[$getParent]()[$getParent]();
const edge = this.edge || new Edge({});
const edgeStyle = edge[$toStyle]();
const style = Object.create(null);
const thickness = edge.presence === "visible" ? edge.thickness : 0;
style.strokeWidth = measureToString(thickness);
style.stroke = edgeStyle.color;
if (parent.w <= thickness) {
[x1, y1, x2, y2] = ["50%", 0, "50%", "100%"];
width = style.strokeWidth;
} else if (parent.h <= thickness) {
[x1, y1, x2, y2] = [0, "50%", "100%", "50%"];
height = style.strokeWidth;
} else if (this.slope === "\\") {
[x1, y1, x2, y2] = [0, 0, "100%", "100%"];
[x1, y1, x2, y2] = [0, "100%", "100%", 0];
return HTMLResult.success({
svg.attributes.style.position = "absolute";
return HTMLResult.success(svg);
class Linear extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "linear", true);
this.id = attributes.id || "";
this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase();
const endColor = this.color ? this.color[$toStyle]() : "#000000";
return `linear-gradient(${transf}, ${startColor}, ${endColor})`;
class LockDocument extends ContentObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "lockDocument");
this.id = attributes.id || "";
this.type = getStringOption(attributes.type, ["optional", "required"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this[$content] = getStringOption(this[$content], ["auto", "0", "1"]);
class Manifest extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "manifest", true);
this.action = getStringOption(attributes.action, ["include", "all", "exclude"]);
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.ref = new XFAObjectArray();
class Margin extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "margin", true);
this.bottomInset = getMeasurement(attributes.bottomInset, "0");
this.id = attributes.id || "";
this.leftInset = getMeasurement(attributes.leftInset, "0");
this.rightInset = getMeasurement(attributes.rightInset, "0");
this.topInset = getMeasurement(attributes.topInset, "0");
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset)
class Mdp extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "mdp");
this.id = attributes.id || "";
this.permissions = getInteger({
data: attributes.permissions,
validate: x => x === 1 || x === 3
this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Medium extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "medium");
this.id = attributes.id || "";
this.imagingBBox = getBBox(attributes.imagingBBox);
this.long = getMeasurement(attributes.long);
this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]);
this.short = getMeasurement(attributes.short);
this.stock = attributes.stock || "";
this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]);
this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Message extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "message", true);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.text = new XFAObjectArray();
class NumericEdit extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "numericEdit", true);
this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
const style = toStyle(this, "border", "font", "margin");
const field = this[$getParent]()[$getParent]();
dataId: field[$data]?.[$uid] || field[$uid],
"aria-label": ariaLabel(field),
html.attributes["aria-required"] = true;
html.attributes.required = true;
return HTMLResult.success({
class Occur extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "occur", true);
this.id = attributes.id || "";
this.initial = attributes.initial !== "" ? getInteger({
data: attributes.initial,
this.max = attributes.max !== "" ? getInteger({
this.min = attributes.min !== "" ? getInteger({
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const parent = this[$getParent]();
const originalMin = this.min;
this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1;
if (originalMin === "") {
this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1;
if (this.max !== -1 && this.max < this.min) {
if (this.initial === "") {
this.initial = parent instanceof Template ? 1 : this.min;
class Oid extends StringObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "oid");
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Oids extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "oids", true);
this.id = attributes.id || "";
this.type = getStringOption(attributes.type, ["optional", "required"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.oid = new XFAObjectArray();
class Overflow extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "overflow");
this.id = attributes.id || "";
this.leader = attributes.leader || "";
this.target = attributes.target || "";
this.trailer = attributes.trailer || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const parent = this[$getParent]();
const root = this[$getTemplateRoot]();
const target = root[$searchNode](this.target, parent);
const leader = root[$searchNode](this.leader, parent);
const trailer = root[$searchNode](this.trailer, parent);
target: target?.[0] || null,
leader: leader?.[0] || null,
trailer: trailer?.[0] || null,
class PageArea extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "pageArea", true);
this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]);
this.id = attributes.id || "";
this.initialNumber = getInteger({
data: attributes.initialNumber,
this.name = attributes.name || "";
this.numbered = getInteger({
data: attributes.numbered,
this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]);
this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]);
this.relevant = getRelevant(attributes.relevant);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.area = new XFAObjectArray();
this.contentArea = new XFAObjectArray();
this.draw = new XFAObjectArray();
this.exclGroup = new XFAObjectArray();
this.field = new XFAObjectArray();
this.subform = new XFAObjectArray();
return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max;