@campxdev/pdfme 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cjs/chunks/{helper-C2o2tpNj.js → helper-BfoMn47R.js} +16955 -4
  2. package/dist/cjs/chunks/{index-dHRmLCnu.js → index-C8qZMUOU.js} +2 -2
  3. package/dist/cjs/chunks/{index-qB7eb2BC.js → index-COKtXyPp.js} +6 -2
  4. package/dist/cjs/chunks/{index-CXm3doOM.js → index-CVqJfcgy.js} +101 -36
  5. package/dist/cjs/chunks/{pluginRegistry-Ba3ANzzx.js → pluginRegistry-C8bMreez.js} +1 -1
  6. package/dist/cjs/common.js +7 -3
  7. package/dist/cjs/converter.js +1 -1
  8. package/dist/cjs/generator.js +3 -3
  9. package/dist/cjs/index.js +9 -5
  10. package/dist/cjs/print-designer-editor.js +122 -140
  11. package/dist/cjs/schemas.js +3 -3
  12. package/dist/cjs/ui.js +83020 -72511
  13. package/dist/esm/chunks/{helper-D7XF1bxK.js → helper-D5PPN6Bv.js} +16952 -5
  14. package/dist/esm/chunks/{index-pDt5vVVj.js → index-C4F7EwBG.js} +2 -2
  15. package/dist/esm/chunks/{index-qTsnfbi7.js → index-C7jr4GIK.js} +102 -37
  16. package/dist/esm/chunks/{index-D1FuD_XZ.js → index-CDhErAtE.js} +3 -3
  17. package/dist/esm/chunks/{pluginRegistry-DEA2P0ud.js → pluginRegistry-B-XSNgmK.js} +1 -1
  18. package/dist/esm/common.js +3 -3
  19. package/dist/esm/converter.js +1 -1
  20. package/dist/esm/generator.js +3 -3
  21. package/dist/esm/index.js +5 -5
  22. package/dist/esm/print-designer-editor.js +121 -142
  23. package/dist/esm/schemas.js +5 -5
  24. package/dist/esm/ui.js +83020 -72511
  25. package/dist/types/_vendors/common/constants.d.ts +1 -2
  26. package/dist/types/_vendors/common/googleFontUrls.d.ts +9 -0
  27. package/dist/types/_vendors/common/googleFonts.d.ts +7 -0
  28. package/dist/types/_vendors/common/helper.d.ts +1 -0
  29. package/dist/types/_vendors/common/index.d.ts +3 -2
  30. package/dist/types/_vendors/print-designer-editor/index.d.ts +1 -1
  31. package/dist/types/_vendors/schemas/text/fontCache.d.ts +10 -0
  32. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { x as px2mm, Z as ZOOM, c as b64toUint8Array, u as mm2pt, q as getFallbackFontName, D as DEFAULT_FONT_NAME } from './helper-D7XF1bxK.js';
1
+ import { E as px2mm, Z as ZOOM, c as b64toUint8Array, y as mm2pt, r as getFallbackFontName, D as DEFAULT_FONT_NAME } from './helper-D5PPN6Bv.js';
2
2
  import SignaturePad from 'signature_pad';
3
3
  import { Image, PenTool, Minus, Square, Circle, Table as Table$1, QrCode, Barcode } from 'lucide';
4
- import { D as DEFAULT_OPACITY, c as createSvgStr, i as isEditable, a as addAlphaToHex, r as readFile, d as convertForPdfLayoutProps, H as HEX_COLOR_PATTERN, h as hex2PrintingColor, e as rotatePoint, f as getDefaultCellStyles, u as uiRender$2, p as pdfRender$2, j as substituteVariables, k as createErrorElm, l as createInsertVariableWidget } from './index-qTsnfbi7.js';
4
+ import { D as DEFAULT_OPACITY, c as createSvgStr, i as isEditable, a as addAlphaToHex, r as readFile, d as convertForPdfLayoutProps, H as HEX_COLOR_PATTERN, h as hex2PrintingColor, e as rotatePoint, f as getDefaultCellStyles, u as uiRender$2, p as pdfRender$2, j as substituteVariables, k as createErrorElm, l as createInsertVariableWidget } from './index-C7jr4GIK.js';
5
5
  import { Buffer } from 'buffer';
6
6
  import { t as toRadians } from './colors-jzbEzNi4.js';
7
7
  import { v1 } from 'uuid';
@@ -1,9 +1,9 @@
1
- import { q as getFallbackFontName, p as getDefaultFont, D as DEFAULT_FONT_NAME, c as b64toUint8Array, w as pt2px, v as pt2mm, u as mm2pt, s as isBlankPdf, l as cloneDeep, t as isHexValid } from './helper-D7XF1bxK.js';
1
+ import { r as getFallbackFontName, q as getDefaultFont, D as DEFAULT_FONT_NAME, c as b64toUint8Array, A as pt2px, z as pt2mm, y as mm2pt, v as isBlankPdf, l as cloneDeep, x as isHexValid, w as isGoogleFont } from './helper-D5PPN6Bv.js';
2
2
  import * as fontkit from 'fontkit';
3
3
  import { Buffer } from 'buffer';
4
4
  import { d as degrees, c as cmyk, r as rgb, a as degreesToRadians } from './colors-jzbEzNi4.js';
5
5
  import { r as replacePlaceholders } from './expression-B-F1KCfk.js';
6
- import { Bold, Italic, Strikethrough, Underline, AlignLeft, AlignCenter, AlignRight, AlignJustify, ArrowUpToLine, ArrowDownToLine, Type } from 'lucide';
6
+ import { Strikethrough, Underline, AlignLeft, AlignCenter, AlignRight, AlignJustify, ArrowUpToLine, ArrowDownToLine, Bold, Italic, Type } from 'lucide';
7
7
 
8
8
  const DEFAULT_FONT_SIZE = 13;
9
9
  const ALIGN_LEFT = 'left';
@@ -99,6 +99,36 @@ const LINE_END_FORBIDDEN_CHARS = [
99
99
  '«',
100
100
  ];
101
101
 
102
+ /**
103
+ * Global font binary cache for URL-based fonts.
104
+ * Fonts are fetched on demand and cached so subsequent uses are instant.
105
+ */
106
+ const _binaryCache = new Map();
107
+ const _inflight = new Map();
108
+ /**
109
+ * Fetch font binary data for a URL, using the global cache.
110
+ * Returns cached ArrayBuffer if available, otherwise fetches and caches.
111
+ * Deduplicates concurrent requests for the same URL.
112
+ */
113
+ const fetchFontBinary = async (url) => {
114
+ const cached = _binaryCache.get(url);
115
+ if (cached)
116
+ return cached;
117
+ // Deduplicate: if a fetch for this URL is already in flight, reuse it
118
+ const inflight = _inflight.get(url);
119
+ if (inflight)
120
+ return inflight;
121
+ const promise = fetch(url)
122
+ .then((res) => res.arrayBuffer())
123
+ .then((buf) => {
124
+ _binaryCache.set(url, buf);
125
+ _inflight.delete(url);
126
+ return buf;
127
+ });
128
+ _inflight.set(url, promise);
129
+ return promise;
130
+ };
131
+
102
132
  const getBrowserVerticalFontAdjustments = (fontKitFont, fontSize, lineHeight, verticalAlignment) => {
103
133
  const { ascent, descent, unitsPerEm } = fontKitFont;
104
134
  // Fonts have a designed line height that the browser renders when using `line-height: normal`
@@ -167,7 +197,7 @@ const getFontKitFont = async (fontName, font, _cache) => {
167
197
  if (typeof fontData === 'string') {
168
198
  const isUrl = fontData.startsWith('http') || fontData.startsWith('/') || fontData.startsWith('./');
169
199
  fontData = isUrl
170
- ? await fetch(fontData).then((res) => res.arrayBuffer())
200
+ ? await fetchFontBinary(fontData)
171
201
  : b64toUint8Array(fontData);
172
202
  }
173
203
  // Convert fontData to Buffer if it's not already a Buffer
@@ -1593,26 +1623,34 @@ const createSvgStr = (icon, attrs) => {
1593
1623
  return `<svg ${svgAttrString}>${elementsString}</svg>`;
1594
1624
  };
1595
1625
 
1596
- const embedAndGetFontObj = async (arg) => {
1597
- const { pdfDoc, font, _cache } = arg;
1598
- if (_cache.has(pdfDoc)) {
1599
- return _cache.get(pdfDoc);
1600
- }
1601
- const fontValues = await Promise.all(Object.values(font).map(async (v) => {
1602
- let fontData = v.data;
1603
- if (typeof fontData === 'string') {
1604
- const isUrl = fontData.startsWith('http') || fontData.startsWith('/') || fontData.startsWith('./');
1605
- fontData = isUrl
1606
- ? await fetch(fontData).then((res) => res.arrayBuffer())
1607
- : b64toUint8Array(fontData);
1608
- }
1609
- return pdfDoc.embedFont(fontData, {
1610
- subset: typeof v.subset === 'undefined' ? true : v.subset,
1611
- });
1612
- }));
1613
- const fontObj = Object.keys(font).reduce((acc, cur, i) => Object.assign(acc, { [cur]: fontValues[i] }), {});
1614
- _cache.set(pdfDoc, fontObj);
1615
- return fontObj;
1626
+ const embedPdfFont = async (pdfDoc, fontName, font, _cache) => {
1627
+ const cacheKey = `embedPdfFont-${fontName}`;
1628
+ if (_cache.has(cacheKey))
1629
+ return _cache.get(cacheKey);
1630
+ const fontEntry = font[fontName];
1631
+ if (!fontEntry)
1632
+ throw new Error(`Font "${fontName}" not found`);
1633
+ let fontData = fontEntry.data;
1634
+ if (typeof fontData === 'string') {
1635
+ const isUrl = fontData.startsWith('http') || fontData.startsWith('/') || fontData.startsWith('./');
1636
+ fontData = isUrl ? await fetchFontBinary(fontData) : b64toUint8Array(fontData);
1637
+ }
1638
+ const useSubset = typeof fontEntry.subset === 'undefined' ? true : fontEntry.subset;
1639
+ let pdfFont;
1640
+ try {
1641
+ pdfFont = await pdfDoc.embedFont(fontData, { subset: useSubset });
1642
+ }
1643
+ catch (err) {
1644
+ // CFF/OpenType fonts fail subsetting (glyph._decode is not a function) — retry without subset
1645
+ if (useSubset) {
1646
+ pdfFont = await pdfDoc.embedFont(fontData, { subset: false });
1647
+ }
1648
+ else {
1649
+ throw err;
1650
+ }
1651
+ }
1652
+ _cache.set(cacheKey, pdfFont);
1653
+ return pdfFont;
1616
1654
  };
1617
1655
  const getFontProp = ({ value, fontKitFont, schema, colorType, }) => {
1618
1656
  const fontSize = schema.dynamicFontSize
@@ -1634,18 +1672,12 @@ const pdfRender$1 = async (arg) => {
1634
1672
  return;
1635
1673
  const { font = getDefaultFont(), colorType } = options;
1636
1674
  const resolvedFontName = resolveFontName(schema.fontName, schema.bold, schema.italic, font);
1637
- const [pdfFontObj, fontKitFont] = await Promise.all([
1638
- embedAndGetFontObj({
1639
- pdfDoc,
1640
- font,
1641
- _cache: _cache,
1642
- }),
1675
+ const [pdfFontValue, fontKitFont] = await Promise.all([
1676
+ embedPdfFont(pdfDoc, resolvedFontName, font, _cache),
1643
1677
  getFontKitFont(resolvedFontName, font, _cache),
1644
1678
  ]);
1645
1679
  const fontProp = getFontProp({ value, fontKitFont, schema, colorType });
1646
1680
  const { fontSize, color, alignment, verticalAlignment, lineHeight, characterSpacing } = fontProp;
1647
- const fontName = resolvedFontName;
1648
- const pdfFontValue = pdfFontObj && pdfFontObj[fontName];
1649
1681
  const pageHeight = page.getHeight();
1650
1682
  const { width, height, rotate, position: { x, y }, opacity, } = convertForPdfLayoutProps({ schema, pageHeight, applyRotateTranslate: false });
1651
1683
  const pivotPoint = { x: x + width / 2, y: pageHeight - mm2pt(schema.position.y) - height / 2 };
@@ -1824,8 +1856,8 @@ const pdfRender = async (arg) => {
1824
1856
  await pdfRender$1(renderArgs);
1825
1857
  };
1826
1858
 
1827
- const TextBoldIcon = createSvgStr(Bold);
1828
- const TextItalicIcon = createSvgStr(Italic);
1859
+ createSvgStr(Bold);
1860
+ createSvgStr(Italic);
1829
1861
  const TextStrikethroughIcon = createSvgStr(Strikethrough);
1830
1862
  const TextUnderlineIcon = createSvgStr(Underline);
1831
1863
  const TextAlignLeftIcon = createSvgStr(AlignLeft);
@@ -1849,8 +1881,7 @@ var Formatter;
1849
1881
  })(Formatter || (Formatter = {}));
1850
1882
  function getExtraFormatterSchema(i18n) {
1851
1883
  const buttons = [
1852
- { key: Formatter.BOLD, icon: TextBoldIcon, type: 'boolean' },
1853
- { key: Formatter.ITALIC, icon: TextItalicIcon, type: 'boolean' },
1884
+ // TODO: re-enable bold/italic controls when ready
1854
1885
  { key: Formatter.STRIKETHROUGH, icon: TextStrikethroughIcon, type: 'boolean' },
1855
1886
  { key: Formatter.UNDERLINE, icon: TextUnderlineIcon, type: 'boolean' },
1856
1887
  { key: Formatter.ALIGNMENT, icon: TextAlignLeftIcon, type: 'select', value: DEFAULT_ALIGNMENT },
@@ -1921,8 +1952,16 @@ const propPanel$1 = {
1921
1952
  widget: 'select',
1922
1953
  default: fallbackFontName,
1923
1954
  placeholder: fallbackFontName,
1924
- props: { options: fontNames.map((name) => ({ label: name, value: name })) },
1925
- span: 12,
1955
+ props: {
1956
+ options: fontNames.map((name) => ({ label: name, value: name })),
1957
+ showSearch: true,
1958
+ virtual: true,
1959
+ filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
1960
+ popupMatchSelectWidth: false,
1961
+ listHeight: 300,
1962
+ style: { width: '100%' },
1963
+ },
1964
+ span: 24,
1926
1965
  },
1927
1966
  fontSize: {
1928
1967
  title: i18n('schemas.text.size'),
@@ -2285,6 +2324,16 @@ const updateVariablesFromText = (text, variables) => {
2285
2324
  return changed;
2286
2325
  };
2287
2326
 
2327
+ const _loadedGoogleFonts = new Set();
2328
+ const ensureGoogleFontLoaded = (fontName, fontData) => {
2329
+ if (!fontName || _loadedGoogleFonts.has(fontName) || !isGoogleFont(fontName))
2330
+ return;
2331
+ if (!document?.fonts)
2332
+ return;
2333
+ _loadedGoogleFonts.add(fontName);
2334
+ const fontFace = new FontFace(fontName, typeof fontData === 'string' ? `url(${fontData})` : fontData, { display: 'swap' });
2335
+ fontFace.load().then(() => document.fonts.add(fontFace)).catch(() => { });
2336
+ };
2288
2337
  const replaceUnsupportedChars = (text, fontKitFont) => {
2289
2338
  const charSupportCache = {};
2290
2339
  const isCharSupported = (char) => {
@@ -2326,8 +2375,24 @@ const uiRender$1 = async (arg) => {
2326
2375
  };
2327
2376
  const font = options?.font || getDefaultFont();
2328
2377
  const resolvedFontName = resolveFontName(schema.fontName, schema.bold, schema.italic, font);
2378
+ // Lazily load Google Font for CSS rendering if needed
2379
+ if (resolvedFontName && font[resolvedFontName]) {
2380
+ ensureGoogleFontLoaded(resolvedFontName, font[resolvedFontName].data);
2381
+ }
2382
+ // Show a subtle loading state while the font binary is being fetched
2383
+ const isLoading = isGoogleFont(resolvedFontName);
2384
+ if (isLoading) {
2385
+ arg.rootElement.style.opacity = '0.4';
2386
+ arg.rootElement.style.transition = 'opacity 0.15s ease-out';
2387
+ }
2329
2388
  const fontKitFont = await getFontKitFont(resolvedFontName, font, _cache);
2330
2389
  const textBlock = buildStyledTextContainer(arg, fontKitFont, usePlaceholder ? placeholder : value);
2390
+ // Fade in once the font is ready
2391
+ if (isLoading) {
2392
+ // Force a reflow so the transition triggers from the dimmed state
2393
+ void arg.rootElement.offsetHeight;
2394
+ arg.rootElement.style.opacity = '1';
2395
+ }
2331
2396
  const processedText = replaceUnsupportedChars(value, fontKitFont);
2332
2397
  if (!isEditable(mode, schema)) {
2333
2398
  // Read-only mode
@@ -1,6 +1,6 @@
1
- import { n as getB64BasePdf } from './helper-D7XF1bxK.js';
2
- export { B as BLANK_A4_PDF, a as BLANK_PDF, C as CUSTOM_A4_PDF, D as DEFAULT_FONT_NAME, M as MM_TO_PT_RATIO, P as PT_TO_MM_RATIO, b as PT_TO_PX_RATIO, Z as ZOOM, c as b64toUint8Array, d as checkDesignerProps, e as checkFont, f as checkGenerateProps, g as checkInputs, h as checkPreviewProps, i as checkTemplate, j as checkUIOptions, k as checkUIProps, l as cloneDeep, m as getAllFonts, o as getBuiltinFontsData, p as getDefaultFont, q as getFallbackFontName, r as getInputFromTemplate, s as isBlankPdf, t as isHexValid, u as mm2pt, v as pt2mm, w as pt2px, x as px2mm } from './helper-D7XF1bxK.js';
3
- export { g as getDynamicTemplate, p as pluginRegistry } from './pluginRegistry-DEA2P0ud.js';
1
+ import { o as getB64BasePdf } from './helper-D5PPN6Bv.js';
2
+ export { B as BLANK_A4_PDF, a as BLANK_PDF, C as CUSTOM_A4_PDF, D as DEFAULT_FONT_NAME, M as MM_TO_PT_RATIO, P as PT_TO_MM_RATIO, b as PT_TO_PX_RATIO, Z as ZOOM, c as b64toUint8Array, d as checkDesignerProps, e as checkFont, f as checkGenerateProps, g as checkInputs, h as checkPreviewProps, i as checkTemplate, j as checkUIOptions, k as checkUIProps, l as cloneDeep, m as getAllFonts, n as getAllFontsWithGoogle, p as getBuiltinFontsData, q as getDefaultFont, r as getFallbackFontName, s as getGoogleFontsData, t as getInputFromTemplate, u as googleFonts, v as isBlankPdf, w as isGoogleFont, x as isHexValid, y as mm2pt, z as pt2mm, A as pt2px, E as px2mm } from './helper-D5PPN6Bv.js';
3
+ export { g as getDynamicTemplate, p as pluginRegistry } from './pluginRegistry-B-XSNgmK.js';
4
4
  export { r as replacePlaceholders } from './expression-B-F1KCfk.js';
5
5
  import 'zod';
6
6
  import 'buffer';
@@ -1,4 +1,4 @@
1
- import { s as isBlankPdf, l as cloneDeep } from './helper-D7XF1bxK.js';
1
+ import { v as isBlankPdf, l as cloneDeep } from './helper-D5PPN6Bv.js';
2
2
 
3
3
  /** Floating point tolerance for comparisons */
4
4
  const EPSILON = 0.01;
@@ -1,6 +1,6 @@
1
- export { B as BLANK_A4_PDF, a as BLANK_PDF, C as CUSTOM_A4_PDF, D as DEFAULT_FONT_NAME, M as MM_TO_PT_RATIO, P as PT_TO_MM_RATIO, b as PT_TO_PX_RATIO, Z as ZOOM, c as b64toUint8Array, d as checkDesignerProps, e as checkFont, f as checkGenerateProps, g as checkInputs, h as checkPreviewProps, i as checkTemplate, j as checkUIOptions, k as checkUIProps, l as cloneDeep, m as getAllFonts, n as getB64BasePdf, o as getBuiltinFontsData, p as getDefaultFont, q as getFallbackFontName, r as getInputFromTemplate, s as isBlankPdf, t as isHexValid, u as mm2pt, v as pt2mm, w as pt2px, x as px2mm } from './chunks/helper-D7XF1bxK.js';
2
- export { PDFME_VERSION } from './chunks/index-D1FuD_XZ.js';
3
- export { g as getDynamicTemplate, p as pluginRegistry } from './chunks/pluginRegistry-DEA2P0ud.js';
1
+ export { B as BLANK_A4_PDF, a as BLANK_PDF, C as CUSTOM_A4_PDF, D as DEFAULT_FONT_NAME, M as MM_TO_PT_RATIO, P as PT_TO_MM_RATIO, b as PT_TO_PX_RATIO, Z as ZOOM, c as b64toUint8Array, d as checkDesignerProps, e as checkFont, f as checkGenerateProps, g as checkInputs, h as checkPreviewProps, i as checkTemplate, j as checkUIOptions, k as checkUIProps, l as cloneDeep, m as getAllFonts, n as getAllFontsWithGoogle, o as getB64BasePdf, p as getBuiltinFontsData, q as getDefaultFont, r as getFallbackFontName, s as getGoogleFontsData, t as getInputFromTemplate, u as googleFonts, v as isBlankPdf, w as isGoogleFont, x as isHexValid, y as mm2pt, z as pt2mm, A as pt2px, E as px2mm } from './chunks/helper-D5PPN6Bv.js';
2
+ export { PDFME_VERSION } from './chunks/index-CDhErAtE.js';
3
+ export { g as getDynamicTemplate, p as pluginRegistry } from './chunks/pluginRegistry-B-XSNgmK.js';
4
4
  export { r as replacePlaceholders } from './chunks/expression-B-F1KCfk.js';
5
5
  import 'zod';
6
6
  import 'buffer';
@@ -1,6 +1,6 @@
1
1
  import * as pdfjsLib from 'pdfjs-dist';
2
2
  import PDFJSWorker from 'pdfjs-dist/build/pdf.worker.entry.js';
3
- import { v as pt2mm, u as mm2pt } from './chunks/helper-D7XF1bxK.js';
3
+ import { z as pt2mm, y as mm2pt } from './chunks/helper-D5PPN6Bv.js';
4
4
  import { Z as PDFDocument } from './chunks/PDFButton-CvvB9ITJ.js';
5
5
  import 'zod';
6
6
  import 'buffer';
@@ -1,10 +1,10 @@
1
1
  import { A as AFRelationship, a as AcroButtonFlags, b as AcroChoiceFlags, c as AcroFieldFlags, d as AcroTextFlags, e as AnnotationFlags, f as AppearanceCharacteristics, B as BlendMode, C as Cache, g as CombedTextLayoutError, h as CustomFontEmbedder, i as CustomFontSubsetEmbedder, D as Duplex, E as EncryptedPDFError, j as ExceededMaxLengthError, F as FieldAlreadyExistsError, k as FieldExistsAsNonTerminalError, l as FileEmbedder, m as FontkitNotRegisteredError, n as ForeignPageError, I as ImageAlignment, o as InvalidFieldNamePartError, p as InvalidMaxLengthError, J as JpegEmbedder, M as MissingOnValueCheckError, N as NoSuchFieldError, q as NonFullScreenPageMode, P as PDFAcroButton, r as PDFAcroCheckBox, s as PDFAcroChoice, t as PDFAcroComboBox, u as PDFAcroField, v as PDFAcroForm, w as PDFAcroListBox, x as PDFAcroNonTerminal, y as PDFAcroPushButton, z as PDFAcroRadioButton, G as PDFAcroSignature, H as PDFAcroTerminal, K as PDFAcroText, L as PDFAnnotation, O as PDFArray, Q as PDFBool, R as PDFButton, S as PDFCatalog, T as PDFCheckBox, U as PDFContentStream, V as PDFContext, W as PDFCrossRefSection, X as PDFCrossRefStream, Y as PDFDict, Z as PDFDocument, _ as PDFDropdown, $ as PDFEmbeddedPage, a0 as PDFField, a1 as PDFFlateStream, a2 as PDFFont, a3 as PDFForm, a4 as PDFHeader, a5 as PDFHexString, a6 as PDFImage, a7 as PDFInvalidObject, a8 as PDFJavaScript, a9 as PDFNull, aa as PDFObjectCopier, ab as PDFObjectParser, ac as PDFObjectStream, ad as PDFObjectStreamParser, ae as PDFOptionList, af as PDFPage, ag as PDFPageEmbedder, ah as PDFPageLeaf, ai as PDFPageTree, aj as PDFParser, ak as PDFRadioGroup, al as PDFRawStream, am as PDFRef, an as PDFSignature, ao as PDFStream, ap as PDFStreamWriter, aq as PDFString, ar as PDFTextField, as as PDFTrailer, at as PDFTrailerDict, au as PDFWidgetAnnotation, av as PDFWriter, aw as PDFXRefStreamParser, ax as PageSizes, ay as ParseSpeeds, az as PngEmbedder, aA as PrintScaling, aB as ReadingDirection, aC as RemovePageFromEmptyDocumentError, aD as RichTextFieldReadError, aE as StandardFontEmbedder, aF as StandardFonts, aG as TextAlignment, aH as UnexpectedFieldTypeError, aI as ViewerPreferences, aJ as createPDFAcroField, aK as createPDFAcroFields, aL as decodePDFRawStream, aM as defaultButtonAppearanceProvider, aN as defaultCheckBoxAppearanceProvider, aO as defaultDropdownAppearanceProvider, aP as defaultOptionListAppearanceProvider, aQ as defaultRadioGroupAppearanceProvider, aR as defaultTextFieldAppearanceProvider, aS as drawButton, aT as drawCheckBox, aU as drawCheckMark, aV as drawEllipse, aW as drawEllipsePath, aX as drawImage, aY as drawLine, aZ as drawLinesOfText, a_ as drawOptionList, a$ as drawPage, b0 as drawRadioButton, b1 as drawRectangle, b2 as drawSvgPath, b3 as drawText, b4 as drawTextField, b5 as drawTextLines, b6 as hasSurrogates, b7 as hasUtf16BOM, b8 as highSurrogate, b9 as isWithinBMP, ba as layoutCombedText, bb as layoutMultilineText, bc as layoutSinglelineText, bd as lowSurrogate, be as normalizeAppearance, bf as pdfDocEncodingDecode, bg as rotateInPlace, bh as utf16Decode, bi as utf16Encode, bj as utf8Encode, bk as waitForTick } from './chunks/PDFButton-CvvB9ITJ.js';
2
2
  import { C as CharCodes, be as ColorTypes, X as CorruptPageTreeError, aH as FillRule, S as IndexOutOfBoundsError, T as InvalidAcroFieldValueError, I as InvalidPDFDateStringError, W as InvalidTargetIndexError, ba as LineCapStyle, b9 as LineJoinStyle, M as MethodNotImplementedError, bf as MissingCatalogError, O as MissingDAEntryError, a6 as MissingKeywordError, a5 as MissingPDFHeaderError, F as MissingPageContentsEmbeddingError, R as MissingTfOperatorError, V as MultiSelectValueError, _ as NextByteAssertionError, Y as NumberParsingError, h as PDFArrayIsNotRectangleError, a7 as PDFInvalidObjectParsingError, k as PDFName, i as PDFNumber, P as PDFObject, $ as PDFObjectParsingError, n as PDFOperator, o as PDFOperatorNames, bg as PDFParsingError, a2 as PDFStreamParsingError, b7 as PageEmbeddingMismatchedContextError, j as PrivateConstructorError, a3 as ReparseError, bh as RotationTypes, a4 as StalledParserError, bi as StandardFontValues, bj as TextRenderingMode, a0 as UnbalancedParenthesisError, U as UnexpectedObjectTypeError, G as UnrecognizedStreamTypeError, E as UnsupportedEncodingError, bk as addRandomSuffix, aP as adjustDimsForRotation, ab as appendBezierCurve, aa as appendQuadraticCurve, l as arrayAsString, an as asNumber, bl as asPDFName, bm as asPDFNumber, K as assertEachIs, N as assertInteger, aS as assertIs, J as assertIsOneOf, b3 as assertIsOneOfOrUndefined, aZ as assertIsSubset, aV as assertMultiple, aT as assertOrUndefined, aY as assertPositive, L as assertRange, a_ as assertRangeOrUndefined, bn as backtick, aF as beginMarkedContent, aw as beginText, bd as breakTextIntoLines, B as byAscendingId, v as bytesFor, b5 as canBeConvertedToUint8Array, aL as charAtIndex, g as charFromCode, bo as charFromHexCode, aN as charSplit, aK as cleanText, aD as clip, bp as clipEvenOdd, a8 as closePath, c as cmyk, bb as colorString, aW as colorToComponents, aQ as componentsToColor, ah as concatTransformationMatrix, f as copyStringIntoBuffer, bq as createTypeErrorMsg, br as createValueErrorMsg, bs as decodeFromBase64, bt as decodeFromBase64DataUri, d as degrees, a as degreesToRadians, al as drawObject, b8 as encodeToBase64, aG as endMarkedContent, aE as endPath, aC as endText, bu as error, bv as escapeRegExp, bw as escapedNewlineChars, av as fill, au as fillAndStroke, aI as fillEvenOdd, Q as findLastMatch, bx as getType, aR as grayscale, b0 as isArrayEqual, by as isNewlineChar, b4 as isStandardFont, bz as isType, q as last, aM as lineSplit, a9 as lineTo, H as mergeIntoTypedArray, aJ as mergeLines, D as mergeUint8Arrays, bA as moveText, ac as moveTo, bB as newlineChars, aB as nextLine, bC as numberToString, p as padStart, x as parseDate, b6 as pluckIndices, am as popGraphicsState, af as pushGraphicsState, bD as radians, bE as radiansToDegrees, b2 as range, bF as rectangle, bc as rectanglesAreEqual, aO as reduceRotation, bG as restoreDashPattern, u as reverseArray, r as rgb, bH as rotateAndSkewTextDegreesAndTranslate, az as rotateAndSkewTextRadiansAndTranslate, ae as rotateDegrees, ai as rotateRadians, aX as rotateRectangle, aj as scale, bI as setCharacterSpacing, bJ as setCharacterSqueeze, at as setDashPattern, bK as setFillingCmykColor, ar as setFillingColor, bL as setFillingGrayscaleColor, bM as setFillingRgbColor, ax as setFontAndSize, ag as setGraphicsState, as as setLineCap, ay as setLineHeight, bN as setLineJoin, ap as setLineWidth, bO as setStrokingCmykColor, ao as setStrokingColor, bP as setStrokingGrayscaleColor, bQ as setStrokingRgbColor, bR as setTextMatrix, bS as setTextRenderingMode, bT as setTextRise, bU as setWordSpacing, aA as showText, bV as singleQuote, s as sizeInBytes, bW as skewDegrees, ak as skewRadians, A as sortedUniq, bX as square, a$ as stringAsByteArray, aq as stroke, w as sum, e as toCharCode, z as toCodePoint, aU as toDegrees, b as toHexString, y as toHexStringOfMinLength, t as toRadians, b1 as toUint8Array, ad as translate, m as typedArrayFor, bY as values } from './chunks/colors-jzbEzNi4.js';
3
- import { s as isBlankPdf, n as getB64BasePdf, u as mm2pt, f as checkGenerateProps, l as cloneDeep, v as pt2mm } from './chunks/helper-D7XF1bxK.js';
4
- import { p as pluginRegistry, g as getDynamicTemplate } from './chunks/pluginRegistry-DEA2P0ud.js';
3
+ import { v as isBlankPdf, o as getB64BasePdf, y as mm2pt, f as checkGenerateProps, l as cloneDeep, z as pt2mm } from './chunks/helper-D5PPN6Bv.js';
4
+ import { p as pluginRegistry, g as getDynamicTemplate } from './chunks/pluginRegistry-B-XSNgmK.js';
5
5
  import { r as replacePlaceholders } from './chunks/expression-B-F1KCfk.js';
6
6
  import * as fontkit from 'fontkit';
7
- import { b as builtInPlugins, g as getDynamicHeightsForTable } from './chunks/index-qTsnfbi7.js';
7
+ import { b as builtInPlugins, g as getDynamicHeightsForTable } from './chunks/index-C7jr4GIK.js';
8
8
  import 'pako';
9
9
  import '@pdf-lib/standard-fonts';
10
10
  import '@pdf-lib/upng';
package/dist/esm/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  export { Designer, Form, Viewer } from './ui.js';
2
- export { b as builtInPlugins, g as getDynamicHeightsForTable, s as multiVariableText } from './chunks/index-qTsnfbi7.js';
2
+ export { b as builtInPlugins, g as getDynamicHeightsForTable, s as multiVariableText } from './chunks/index-C7jr4GIK.js';
3
3
  export { img2pdf, pdf2img, pdf2size } from './converter.js';
4
4
  export { insert, merge, move, organize, remove, rotate, split } from './manipulator.js';
5
5
  export { Canvas, PropPanel as DesignerPropPanel, PdfmeProvider, SchemaList, convertPdfToBase64, plugins, useDesigner, useDesignerContext } from './print-designer-editor.js';
6
6
  export { barcodes, checkbox, date, dateTime, radioGroup, select, svg, table, text, time } from './schemas.js';
7
- export { d as dynamicBarcode, a as dynamicQrCode, b as dynamicTable, e as ellipse, i as image, l as line, r as rectangle, s as signature, v as variableBarcodes } from './chunks/index-pDt5vVVj.js';
7
+ export { d as dynamicBarcode, a as dynamicQrCode, b as dynamicTable, e as ellipse, i as image, l as line, r as rectangle, s as signature, v as variableBarcodes } from './chunks/index-C4F7EwBG.js';
8
8
  export { generate } from './generator.js';
9
- export { B as BLANK_A4_PDF, a as BLANK_PDF, C as CUSTOM_A4_PDF, D as DEFAULT_FONT_NAME, M as MM_TO_PT_RATIO, P as PT_TO_MM_RATIO, b as PT_TO_PX_RATIO, Z as ZOOM, c as b64toUint8Array, d as checkDesignerProps, e as checkFont, f as checkGenerateProps, g as checkInputs, h as checkPreviewProps, i as checkTemplate, j as checkUIOptions, k as checkUIProps, l as cloneDeep, m as getAllFonts, n as getB64BasePdf, o as getBuiltinFontsData, p as getDefaultFont, q as getFallbackFontName, r as getInputFromTemplate, s as isBlankPdf, t as isHexValid, u as mm2pt, v as pt2mm, w as pt2px, x as px2mm } from './chunks/helper-D7XF1bxK.js';
10
- export { PDFME_VERSION } from './chunks/index-D1FuD_XZ.js';
11
- export { g as getDynamicTemplate, p as pluginRegistry } from './chunks/pluginRegistry-DEA2P0ud.js';
9
+ export { B as BLANK_A4_PDF, a as BLANK_PDF, C as CUSTOM_A4_PDF, D as DEFAULT_FONT_NAME, M as MM_TO_PT_RATIO, P as PT_TO_MM_RATIO, b as PT_TO_PX_RATIO, Z as ZOOM, c as b64toUint8Array, d as checkDesignerProps, e as checkFont, f as checkGenerateProps, g as checkInputs, h as checkPreviewProps, i as checkTemplate, j as checkUIOptions, k as checkUIProps, l as cloneDeep, m as getAllFonts, n as getAllFontsWithGoogle, o as getB64BasePdf, p as getBuiltinFontsData, q as getDefaultFont, r as getFallbackFontName, s as getGoogleFontsData, t as getInputFromTemplate, u as googleFonts, v as isBlankPdf, w as isGoogleFont, x as isHexValid, y as mm2pt, z as pt2mm, A as pt2px, E as px2mm } from './chunks/helper-D5PPN6Bv.js';
10
+ export { PDFME_VERSION } from './chunks/index-CDhErAtE.js';
11
+ export { g as getDynamicTemplate, p as pluginRegistry } from './chunks/pluginRegistry-B-XSNgmK.js';
12
12
  export { r as replacePlaceholders } from './chunks/expression-B-F1KCfk.js';
13
13
  import 'fontkit';
14
14
  import 'buffer';