: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const $getAttributeIt = Symbol();
const $getAttributes = Symbol();
const $getAvailableSpace = Symbol();
const $getChildrenByClass = Symbol();
const $getChildrenByName = Symbol();
const $getChildrenByNameIt = Symbol();
const $getDataValue = Symbol();
const $getExtra = Symbol();
const $getRealChildrenByNameIt = Symbol();
const $getChildren = Symbol();
const $getContainedChildren = Symbol();
const $getNextPage = Symbol();
const $getSubformParent = Symbol();
const $getParent = Symbol();
const $getTemplateRoot = Symbol();
const $globalData = Symbol();
const $hasSettableValue = Symbol();
const $indexOf = Symbol();
const $insertAt = Symbol();
const $isCDATAXml = Symbol();
const $isBindable = Symbol();
const $isDataValue = Symbol();
const $isDescendent = Symbol();
const $isNsAgnostic = Symbol();
const $isSplittable = Symbol();
const $isThereMoreWidth = Symbol();
const $isTransparent = Symbol();
const $isUsable = Symbol();
const $lastAttribute = Symbol();
const $namespaceId = Symbol("namespaceId");
const $nodeName = Symbol("nodeName");
const $nsAttributes = Symbol();
const $onChild = Symbol();
const $onChildCheck = Symbol();
const $onText = Symbol();
const $pushGlyphs = Symbol();
const $popPara = Symbol();
const $pushPara = Symbol();
const $removeChild = Symbol();
const $root = Symbol("root");
const $resolvePrototypes = Symbol();
const $searchNode = Symbol();
const $setSetAttributes = Symbol();
const $setValue = Symbol();
const $tabIndex = Symbol();
const $toPages = Symbol();
const $toHTML = Symbol();
const $toString = Symbol();
const $toStyle = Symbol();
const $uid = Symbol("uid");
;// CONCATENATED MODULE: ./src/core/xfa/namespaces.js
const $buildXFAObject = Symbol();
check: ns => ns.startsWith("http://www.xfa.org/schema/xci/")
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/")
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/")
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/")
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/")
check: ns => ns === "http://ns.adobe.com/xdp/pdf/"
check: ns => ns === "http://www.w3.org/2000/09/xmldsig#"
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/")
check: ns => ns === "http://www.w3.org/1999/XSL/Transform"
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/")
check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/")
check: ns => ns === "http://ns.adobe.com/xdp/"
check: ns => ns === "http://ns.adobe.com/xfdf/"
check: ns => ns === "http://www.w3.org/1999/xhtml"
check: ns => ns === "http://ns.adobe.com/xmpmeta/"
;// CONCATENATED MODULE: ./src/core/xfa/utils.js
mm: x => x / (10 * 2.54) * 72,
const measurementPattern = /([+-]?\d+\.?\d*)(.*)/;
function stripQuotes(str) {
if (str.startsWith("'") || str.startsWith('"')) {
const n = parseInt(data, 10);
if (!isNaN(n) && validate(n)) {
const n = parseFloat(data);
if (!isNaN(n) && validate(n)) {
function getStringOption(data, options) {
defaultValue: options[0],
validate: k => options.includes(k)
function getMeasurement(str, def = "0") {
return getMeasurement(def);
const match = str.trim().match(measurementPattern);
return getMeasurement(def);
const [, valueStr, unit] = match;
const value = parseFloat(valueStr);
return getMeasurement(def);
const conv = dimConverters[unit];
function getRatio(data) {
const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x));
if (ratio.length === 1) {
if (ratio.length === 0) {
const [num, den] = ratio;
function getRelevant(data) {
return data.trim().split(/\s+/).map(e => ({
function getColor(data, def = [0, 0, 0]) {
const color = data.trim().split(/\s*,\s*/).map(c => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255)).map(c => isNaN(c) ? 0 : c);
const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1"));
if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) {
const [x, y, width, height] = bbox;
return shadow(this, "FAILURE", new HTMLResult(false, null, null, null));
return shadow(this, "EMPTY", new HTMLResult(true, null, null, null));
constructor(success, html, bbox, breakNode) {
this.breakNode = breakNode;
return new HTMLResult(false, null, null, node);
static success(html, bbox = null) {
return new HTMLResult(true, html, bbox, null);
;// CONCATENATED MODULE: ./src/core/xfa/fonts.js
add(pdfFonts, reallyMissingFonts = null) {
for (const pdfFont of pdfFonts) {
this.addPdfFont(pdfFont);
for (const pdfFont of this.fonts.values()) {
pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic;
if (!reallyMissingFonts || reallyMissingFonts.size === 0) {
const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA");
for (const missing of reallyMissingFonts) {
this.fonts.set(missing, myriad);
const cssFontInfo = pdfFont.cssFontInfo;
const name = cssFontInfo.fontFamily;
let font = this.fonts.get(name);
font = Object.create(null);
this.fonts.set(name, font);
const fontWeight = parseFloat(cssFontInfo.fontWeight);
if (parseFloat(cssFontInfo.italicAngle) !== 0) {
property = fontWeight >= 700 ? "bolditalic" : "italic";
} else if (fontWeight >= 700) {
if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) {
if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) {
font[property] = pdfFont;
find(fontName, mustWarn = true) {
let font = this.fonts.get(fontName) || this.cache.get(fontName);
const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
let name = fontName.replaceAll(pattern, "");
font = this.fonts.get(name);
this.cache.set(fontName, font);
name = name.toLowerCase();
for (const [family, pdfFont] of this.fonts.entries()) {
if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
if (maybe.length === 0) {
for (const [, pdfFont] of this.fonts.entries()) {
if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
if (maybe.length === 0) {
name = name.replaceAll(/psmt|mt/gi, "");
for (const [family, pdfFont] of this.fonts.entries()) {
if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
if (maybe.length === 0) {
for (const pdfFont of this.fonts.values()) {
if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
if (maybe.length !== 1 && mustWarn) {
warn(`XFA - Too many choices to guess the correct font: ${fontName}`);
this.cache.set(fontName, maybe[0]);
if (mustWarn && !this.warned.has(fontName)) {
this.warned.add(fontName);
warn(`XFA - Cannot find the font: ${fontName}`);
function selectFont(xfaFont, typeface) {
if (xfaFont.posture === "italic") {
if (xfaFont.weight === "bold") {
return typeface.bolditalic;
} else if (xfaFont.weight === "bold") {
function fonts_getMetrics(xfaFont, real = false) {
const name = stripQuotes(xfaFont.typeface);
const typeface = xfaFont[$globalData].fontFinder.find(name);
pdfFont = selectFont(xfaFont, typeface);
const size = xfaFont.size || 10;
const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2;
const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;
lineHeight: lineHeight * size,
lineNoGap: Math.max(1, lineHeight - lineGap) * size
;// CONCATENATED MODULE: ./src/core/xfa/text.js
const WIDTH_FACTOR = 1.02;
constructor(xfaFont, margin, lineHeight, fontFinder) {
this.lineHeight = lineHeight;
this.paraMargin = margin || {
[this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);