: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
this.dataColumnCount = getInteger({
data: attributes.dataColumnCount,
this.dataLength = getInteger({
data: attributes.dataLength,
this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]);
this.dataRowCount = getInteger({
data: attributes.dataRowCount,
this.endChar = attributes.endChar || "";
this.errorCorrectionLevel = getInteger({
data: attributes.errorCorrectionLevel,
validate: x => x >= 0 && x <= 8
this.id = attributes.id || "";
this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm");
this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm");
this.printCheckDigit = getInteger({
data: attributes.printCheckDigit,
this.rowColumnRatio = getRatio(attributes.rowColumnRatio);
this.startChar = attributes.startChar || "";
this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]);
this.truncate = getInteger({
data: attributes.truncate,
this.type = getStringOption(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]);
this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio);
class Bind extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "bind", true);
this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]);
this.ref = attributes.ref || "";
class BindItems extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "bindItems");
this.connection = attributes.connection || "";
this.labelRef = attributes.labelRef || "";
this.ref = attributes.ref || "";
this.valueRef = attributes.valueRef || "";
class Bookend extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "bookend");
this.id = attributes.id || "";
this.leader = attributes.leader || "";
this.trailer = attributes.trailer || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class BooleanElement extends Option01 {
constructor(attributes) {
super(TEMPLATE_NS_ID, "boolean");
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
return valueToHtml(this[$content] === 1 ? "1" : "0");
class Border extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "border", true);
this.break = getStringOption(attributes.break, ["close", "open"]);
this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
this.id = attributes.id || "";
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
this.relevant = getRelevant(attributes.relevant);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.corner = new XFAObjectArray(4);
this.edge = new XFAObjectArray(4);
const edges = this.edge.children.slice();
const defaultEdge = edges.at(-1) || new Edge({});
for (let i = edges.length; i < 4; i++) {
const widths = edges.map(edge => edge.thickness);
const insets = [0, 0, 0, 0];
insets[0] = this.margin.topInset;
insets[1] = this.margin.rightInset;
insets[2] = this.margin.bottomInset;
insets[3] = this.margin.leftInset;
const edgeStyles = edges.map(node => {
const style = node[$toStyle]();
style.color ||= "#000000";
const style = Object.create(null);
Object.assign(style, this.margin[$toStyle]());
if (this.fill?.presence === "visible") {
Object.assign(style, this.fill[$toStyle]());
if (this.corner.children.some(node => node.radius !== 0)) {
const cornerStyles = this.corner.children.map(node => node[$toStyle]());
if (cornerStyles.length === 2 || cornerStyles.length === 3) {
const last = cornerStyles.at(-1);
for (let i = cornerStyles.length; i < 4; i++) {
style.borderRadius = cornerStyles.map(s => s.radius).join(" ");
style.borderStyle = "none";
style.borderStyle = edgeStyles.map(s => s.style).join(" ");
style.borderWidth = edgeStyles.map(s => s.width).join(" ");
style.borderColor = edgeStyles.map(s => s.color).join(" ");
class Break extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "break", true);
this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
this.afterTarget = attributes.afterTarget || "";
this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
this.beforeTarget = attributes.beforeTarget || "";
this.bookendLeader = attributes.bookendLeader || "";
this.bookendTrailer = attributes.bookendTrailer || "";
this.id = attributes.id || "";
this.overflowLeader = attributes.overflowLeader || "";
this.overflowTarget = attributes.overflowTarget || "";
this.overflowTrailer = attributes.overflowTrailer || "";
this.startNew = getInteger({
data: attributes.startNew,
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class BreakAfter extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "breakAfter", true);
this.id = attributes.id || "";
this.leader = attributes.leader || "";
this.startNew = getInteger({
data: attributes.startNew,
this.target = attributes.target || "";
this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]);
this.trailer = attributes.trailer || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class BreakBefore extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "breakBefore", true);
this.id = attributes.id || "";
this.leader = attributes.leader || "";
this.startNew = getInteger({
data: attributes.startNew,
this.target = attributes.target || "";
this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]);
this.trailer = attributes.trailer || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
return HTMLResult.FAILURE;
class Button extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "button", true);
this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
const parent = this[$getParent]();
const grandpa = parent[$getParent]();
for (const event of grandpa.event.children) {
if (event.activity !== "click" || !event.script) {
const jsURL = recoverJsURL(event.script[$content]);
const href = fixURL(jsURL.url);
htmlButton.children.push({
newWindow: jsURL.newWindow,
return HTMLResult.success(htmlButton);
class Calculate extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "calculate", true);
this.id = attributes.id || "";
this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Caption extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "caption", true);
this.id = attributes.id || "";
this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]);
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
this.reserve = Math.ceil(getMeasurement(attributes.reserve));
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$getExtra](availableSpace) {
switch (this.placement) {
width = this.reserve <= 0 ? width : this.reserve;
height = this.reserve <= 0 ? height : this.reserve;
this[$extra] = layoutNode(this, {
[$toHTML](availableSpace) {
const value = this.value[$toHTML](availableSpace).html;
const savedReserve = this.reserve;
} = this[$getExtra](availableSpace);
switch (this.placement) {
if (typeof value === "string") {
const style = toStyle(this, "font", "margin", "visibility");
switch (this.placement) {
style.width = measureToString(this.reserve);
style.height = measureToString(this.reserve);
setPara(this, null, value);
this.reserve = savedReserve;
return HTMLResult.success({
class Certificate extends StringObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "certificate");
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Certificates extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "certificates", true);
this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]);
this.id = attributes.id || "";
this.url = attributes.url || "";
this.urlPolicy = attributes.urlPolicy || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class CheckButton extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "checkButton", true);
this.id = attributes.id || "";
this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]);
this.shape = getStringOption(attributes.shape, ["square", "round"]);
this.size = getMeasurement(attributes.size, "10pt");
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
const style = toStyle("margin");
const size = measureToString(this.size);
style.width = style.height = size;
const field = this[$getParent]()[$getParent]();
const items = field.items.children.length && field.items.children[0][$toHTML]().html || [];
on: (items[0] !== undefined ? items[0] : "on").toString(),
off: (items[1] !== undefined ? items[1] : "off").toString()
const value = field.value?.[$text]() || "off";
const checked = value === exportedValue.on || undefined;
const container = field[$getSubformParent]();
const fieldId = field[$uid];
if (container instanceof ExclGroup) {
groupId = container[$uid];
dataId = container[$data]?.[$uid] || container[$uid];
className = "xfaCheckbox";
dataId = field[$data]?.[$uid] || field[$uid];
xfaOff: exportedValue.off,
"aria-label": ariaLabel(field),
input.attributes.name = groupId;
input.attributes["aria-required"] = true;
input.attributes.required = true;
return HTMLResult.success({
class ChoiceList extends XFAObject {
constructor(attributes) {