@qrcommunication/gigapdf-lib 0.71.1 → 0.72.0

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.
package/dist/index.d.cts CHANGED
@@ -845,7 +845,7 @@ interface GigaSection {
845
845
  /**
846
846
  * A document outline (bookmark) entry — a label, a zero-based destination page,
847
847
  * and nested children (mirror of `model::OutlineNode`). Populated by
848
- * {@link GigaPdf.officeToModel}/reconstruction from the source's own bookmarks
848
+ * {@link GigaPdfEngine.officeToModel}/reconstruction from the source's own bookmarks
849
849
  * (PDF `/Outlines`) or, lacking those, from detected headings.
850
850
  */
851
851
  interface GigaOutlineNode {
@@ -1328,6 +1328,27 @@ interface FieldInfo {
1328
1328
  required: boolean;
1329
1329
  multiline: boolean;
1330
1330
  fillable: boolean;
1331
+ /**
1332
+ * Whether this is a **comb** text field (`/Ff` bit 25): the value is laid out
1333
+ * one character per equally-spaced cell across {@link maxLen} cells (SSN, dates
1334
+ * and reference numbers on official forms). A host reproducing the field's
1335
+ * original spacing must honour this — the cells can't be inferred from the
1336
+ * value alone.
1337
+ */
1338
+ comb: boolean;
1339
+ /** Text alignment from `/Q` (AcroForm default applied): 0 = left, 1 = centre, 2 = right. */
1340
+ quadding: number;
1341
+ /**
1342
+ * Font resource name from the field's `/DA` default appearance (e.g. `"Helv"`,
1343
+ * `"ZaDb"`), resolved against the AcroForm; absent when no `Tf` is present.
1344
+ */
1345
+ daFont?: string;
1346
+ /** Font size in points from the `/DA` (`0` = auto-size), AcroForm default applied. */
1347
+ daSize: number;
1348
+ /**
1349
+ * `/MaxLen` for text fields; for a comb field this is the number of
1350
+ * equally-spaced cells the value is drawn into.
1351
+ */
1331
1352
  maxLen?: number;
1332
1353
  /** 1-based page the widget sits on (from its `/P`); absent if it has no widget. */
1333
1354
  page?: number;
@@ -1623,7 +1644,7 @@ declare class GigaPdfDoc {
1623
1644
  * stream, painted last); otherwise it is sent behind everything (moved to the
1624
1645
  * start, painted first). The moved range is re-wrapped in `q … Q` so it neither
1625
1646
  * inherits nor leaks graphics state. Works for text, image and shape elements.
1626
- * The element's index changes after the move — re-read {@link pageElements}.
1647
+ * The element's index changes after the move — re-read {@link GigaPdfDoc.elements}.
1627
1648
  * Returns `false` if the page/index doesn't exist.
1628
1649
  */
1629
1650
  reorderElement(page: number, index: number, toFront: boolean): boolean;
@@ -1786,20 +1807,24 @@ declare class GigaPdfDoc {
1786
1807
  /**
1787
1808
  * Rasterize a page to a PNG **without the page content stream's text** — glyphs
1788
1809
  * are suppressed while gradients, shadings, images, vectors and patterns are
1789
- * preserved. Annotation/widget appearances are still painted in full. Use this
1790
- * to paint a text-free raster background the editor can overlay real, editable
1791
- * text on top of.
1810
+ * preserved. Form-field **widget** appearances are omitted (the editor re-shows
1811
+ * their values as an editable overlay, so baking them in would double every
1812
+ * field); other annotation appearances (stamps, highlights, ink) are still
1813
+ * painted. Use this to paint a text-free raster background the editor can
1814
+ * overlay real, editable text on top of.
1792
1815
  */
1793
1816
  renderPageNoText(page: number, scale?: number): Uint8Array;
1794
1817
  /**
1795
1818
  * Rasterize a page to a PNG while **omitting** the given top-level element
1796
- * `indices` (from {@link pageElements}). Each excluded element paints nothing
1819
+ * `indices` (from {@link GigaPdfDoc.elements}). Each excluded element paints nothing
1797
1820
  * — fills, strokes, shadings, images and text alike — while everything else
1798
1821
  * (including the non-text content of non-excluded elements) renders normally.
1799
1822
  * Use it to paint a background without specific elements and overlay live,
1800
1823
  * editable versions on top. Generalises {@link renderPageNoText} (which
1801
- * suppresses *all* text). An empty `indices` renders the full page; unknown
1802
- * indices are ignored.
1824
+ * suppresses *all* text). Like {@link renderPageNoText}, form-field **widget**
1825
+ * appearances are omitted (the editor re-shows them as an editable overlay);
1826
+ * other annotation appearances are painted. An empty `indices` renders the full
1827
+ * page; unknown indices are ignored.
1803
1828
  */
1804
1829
  renderPageExcluding(page: number, indices: number[], scale?: number): Uint8Array;
1805
1830
  /**
@@ -1905,7 +1930,7 @@ declare class GigaPdfDoc {
1905
1930
  */
1906
1931
  flags?: Partial<PdfPermissions>;
1907
1932
  /**
1908
- * Raw signed 32-bit `/P` bitmask. Use {@link flags} for a readable API.
1933
+ * Raw signed 32-bit `/P` bitmask. Use `flags` (above) for a readable API.
1909
1934
  * Defaults to all permissions granted when neither is given.
1910
1935
  */
1911
1936
  permissions?: number;
@@ -2110,4 +2135,4 @@ declare class GigaPdfDoc {
2110
2135
  }): boolean;
2111
2136
  }
2112
2137
 
2113
- export { type AnnotationInfo, type Attachment, type Box, type DecodedImage, type DocumentLanguage, type Element, type EmbeddedFont, type FieldInfo, type FieldKind, type FieldStyle, type FontInfo, type GigaBlock, type GigaBlockAddr, type GigaBlockKind, type GigaBorderStyle, type GigaCellValue, type GigaCharStyle, type GigaDocument, type GigaGeneric, type GigaHeading, type GigaImageRef, type GigaInline, type GigaInlineRun, type GigaLinkTarget, type GigaList, type GigaListItem, type GigaListMarker, type GigaMergeRange, type GigaOutlineNode, type GigaPage, type GigaPageGeometry, type GigaParaPatch, type GigaParagraph, type GigaParagraphStyle, type GigaPathSeg, GigaPdfDoc, GigaPdfEngine, type GigaPlaceholder, type GigaPlaceholderRole, type GigaRect, type GigaRotation, type GigaSection, type GigaShape, type GigaSheet, type GigaSheetBlock, type GigaSheetCell, type GigaSheetRow, type GigaSlide, type GigaSlideBlock, type GigaStylePatch, type GigaTable, type GigaTableCell, type GigaTableRow, type GigaTextBox, type HeaderFooterAlign, type HeaderFooterSpec, type HtmlFont, type HtmlFontRequest, type HtmlMargins, type HtmlRenderOptions, type HtmlResource, type HtmlResourceNeed, type ImageElementInfo, type LayerInfo, type LinkInfo, type ModelOp, type NamedDest, type OutlineEntry, type PageInfo, type PageMargins, type PathSegment, type PdfPermissions, type RadioOption, type SearchHit, type SignLtvOptions, type SignP12Options, type SignTsaOptions, type TextElementInfo, type TextLine, type TextRunInfo, type VectorPathInfo, type XlsxSheet, defaultCrlGet, defaultOcspPost, defaultTsaPost };
2138
+ export { type AnnotationInfo, type Attachment, type Box, type DecodedImage, type DocumentLanguage, type Element, type EmbeddedFont, type Exports, type FieldInfo, type FieldKind, type FieldStyle, type FontInfo, type GigaBlock, type GigaBlockAddr, type GigaBlockKind, type GigaBorderStyle, type GigaCellValue, type GigaCharStyle, type GigaDocument, type GigaGeneric, type GigaHeading, type GigaImageRef, type GigaInline, type GigaInlineRun, type GigaLinkTarget, type GigaList, type GigaListItem, type GigaListMarker, type GigaMergeRange, type GigaOutlineNode, type GigaPage, type GigaPageGeometry, type GigaParaPatch, type GigaParagraph, type GigaParagraphStyle, type GigaPathSeg, GigaPdfDoc, GigaPdfEngine, type GigaPlaceholder, type GigaPlaceholderRole, type GigaRect, type GigaRotation, type GigaSection, type GigaShape, type GigaSheet, type GigaSheetBlock, type GigaSheetCell, type GigaSheetRow, type GigaSlide, type GigaSlideBlock, type GigaStylePatch, type GigaTable, type GigaTableCell, type GigaTableRow, type GigaTextBox, type HeaderFooterAlign, type HeaderFooterSpec, type HtmlFont, type HtmlFontRequest, type HtmlMargins, type HtmlRenderOptions, type HtmlResource, type HtmlResourceNeed, type ImageElementInfo, type LayerInfo, type LinkInfo, type ModelOp, type NamedDest, type OutlineEntry, type PageInfo, type PageMargins, type PathSegment, type PdfPermissions, type RadioOption, type SearchHit, type SignLtvOptions, type SignP12Options, type SignTsaOptions, type TextElementInfo, type TextLine, type TextRunInfo, type VectorPathInfo, type XlsxSheet, defaultCrlGet, defaultOcspPost, defaultTsaPost };
package/dist/index.d.ts CHANGED
@@ -845,7 +845,7 @@ interface GigaSection {
845
845
  /**
846
846
  * A document outline (bookmark) entry — a label, a zero-based destination page,
847
847
  * and nested children (mirror of `model::OutlineNode`). Populated by
848
- * {@link GigaPdf.officeToModel}/reconstruction from the source's own bookmarks
848
+ * {@link GigaPdfEngine.officeToModel}/reconstruction from the source's own bookmarks
849
849
  * (PDF `/Outlines`) or, lacking those, from detected headings.
850
850
  */
851
851
  interface GigaOutlineNode {
@@ -1328,6 +1328,27 @@ interface FieldInfo {
1328
1328
  required: boolean;
1329
1329
  multiline: boolean;
1330
1330
  fillable: boolean;
1331
+ /**
1332
+ * Whether this is a **comb** text field (`/Ff` bit 25): the value is laid out
1333
+ * one character per equally-spaced cell across {@link maxLen} cells (SSN, dates
1334
+ * and reference numbers on official forms). A host reproducing the field's
1335
+ * original spacing must honour this — the cells can't be inferred from the
1336
+ * value alone.
1337
+ */
1338
+ comb: boolean;
1339
+ /** Text alignment from `/Q` (AcroForm default applied): 0 = left, 1 = centre, 2 = right. */
1340
+ quadding: number;
1341
+ /**
1342
+ * Font resource name from the field's `/DA` default appearance (e.g. `"Helv"`,
1343
+ * `"ZaDb"`), resolved against the AcroForm; absent when no `Tf` is present.
1344
+ */
1345
+ daFont?: string;
1346
+ /** Font size in points from the `/DA` (`0` = auto-size), AcroForm default applied. */
1347
+ daSize: number;
1348
+ /**
1349
+ * `/MaxLen` for text fields; for a comb field this is the number of
1350
+ * equally-spaced cells the value is drawn into.
1351
+ */
1331
1352
  maxLen?: number;
1332
1353
  /** 1-based page the widget sits on (from its `/P`); absent if it has no widget. */
1333
1354
  page?: number;
@@ -1623,7 +1644,7 @@ declare class GigaPdfDoc {
1623
1644
  * stream, painted last); otherwise it is sent behind everything (moved to the
1624
1645
  * start, painted first). The moved range is re-wrapped in `q … Q` so it neither
1625
1646
  * inherits nor leaks graphics state. Works for text, image and shape elements.
1626
- * The element's index changes after the move — re-read {@link pageElements}.
1647
+ * The element's index changes after the move — re-read {@link GigaPdfDoc.elements}.
1627
1648
  * Returns `false` if the page/index doesn't exist.
1628
1649
  */
1629
1650
  reorderElement(page: number, index: number, toFront: boolean): boolean;
@@ -1786,20 +1807,24 @@ declare class GigaPdfDoc {
1786
1807
  /**
1787
1808
  * Rasterize a page to a PNG **without the page content stream's text** — glyphs
1788
1809
  * are suppressed while gradients, shadings, images, vectors and patterns are
1789
- * preserved. Annotation/widget appearances are still painted in full. Use this
1790
- * to paint a text-free raster background the editor can overlay real, editable
1791
- * text on top of.
1810
+ * preserved. Form-field **widget** appearances are omitted (the editor re-shows
1811
+ * their values as an editable overlay, so baking them in would double every
1812
+ * field); other annotation appearances (stamps, highlights, ink) are still
1813
+ * painted. Use this to paint a text-free raster background the editor can
1814
+ * overlay real, editable text on top of.
1792
1815
  */
1793
1816
  renderPageNoText(page: number, scale?: number): Uint8Array;
1794
1817
  /**
1795
1818
  * Rasterize a page to a PNG while **omitting** the given top-level element
1796
- * `indices` (from {@link pageElements}). Each excluded element paints nothing
1819
+ * `indices` (from {@link GigaPdfDoc.elements}). Each excluded element paints nothing
1797
1820
  * — fills, strokes, shadings, images and text alike — while everything else
1798
1821
  * (including the non-text content of non-excluded elements) renders normally.
1799
1822
  * Use it to paint a background without specific elements and overlay live,
1800
1823
  * editable versions on top. Generalises {@link renderPageNoText} (which
1801
- * suppresses *all* text). An empty `indices` renders the full page; unknown
1802
- * indices are ignored.
1824
+ * suppresses *all* text). Like {@link renderPageNoText}, form-field **widget**
1825
+ * appearances are omitted (the editor re-shows them as an editable overlay);
1826
+ * other annotation appearances are painted. An empty `indices` renders the full
1827
+ * page; unknown indices are ignored.
1803
1828
  */
1804
1829
  renderPageExcluding(page: number, indices: number[], scale?: number): Uint8Array;
1805
1830
  /**
@@ -1905,7 +1930,7 @@ declare class GigaPdfDoc {
1905
1930
  */
1906
1931
  flags?: Partial<PdfPermissions>;
1907
1932
  /**
1908
- * Raw signed 32-bit `/P` bitmask. Use {@link flags} for a readable API.
1933
+ * Raw signed 32-bit `/P` bitmask. Use `flags` (above) for a readable API.
1909
1934
  * Defaults to all permissions granted when neither is given.
1910
1935
  */
1911
1936
  permissions?: number;
@@ -2110,4 +2135,4 @@ declare class GigaPdfDoc {
2110
2135
  }): boolean;
2111
2136
  }
2112
2137
 
2113
- export { type AnnotationInfo, type Attachment, type Box, type DecodedImage, type DocumentLanguage, type Element, type EmbeddedFont, type FieldInfo, type FieldKind, type FieldStyle, type FontInfo, type GigaBlock, type GigaBlockAddr, type GigaBlockKind, type GigaBorderStyle, type GigaCellValue, type GigaCharStyle, type GigaDocument, type GigaGeneric, type GigaHeading, type GigaImageRef, type GigaInline, type GigaInlineRun, type GigaLinkTarget, type GigaList, type GigaListItem, type GigaListMarker, type GigaMergeRange, type GigaOutlineNode, type GigaPage, type GigaPageGeometry, type GigaParaPatch, type GigaParagraph, type GigaParagraphStyle, type GigaPathSeg, GigaPdfDoc, GigaPdfEngine, type GigaPlaceholder, type GigaPlaceholderRole, type GigaRect, type GigaRotation, type GigaSection, type GigaShape, type GigaSheet, type GigaSheetBlock, type GigaSheetCell, type GigaSheetRow, type GigaSlide, type GigaSlideBlock, type GigaStylePatch, type GigaTable, type GigaTableCell, type GigaTableRow, type GigaTextBox, type HeaderFooterAlign, type HeaderFooterSpec, type HtmlFont, type HtmlFontRequest, type HtmlMargins, type HtmlRenderOptions, type HtmlResource, type HtmlResourceNeed, type ImageElementInfo, type LayerInfo, type LinkInfo, type ModelOp, type NamedDest, type OutlineEntry, type PageInfo, type PageMargins, type PathSegment, type PdfPermissions, type RadioOption, type SearchHit, type SignLtvOptions, type SignP12Options, type SignTsaOptions, type TextElementInfo, type TextLine, type TextRunInfo, type VectorPathInfo, type XlsxSheet, defaultCrlGet, defaultOcspPost, defaultTsaPost };
2138
+ export { type AnnotationInfo, type Attachment, type Box, type DecodedImage, type DocumentLanguage, type Element, type EmbeddedFont, type Exports, type FieldInfo, type FieldKind, type FieldStyle, type FontInfo, type GigaBlock, type GigaBlockAddr, type GigaBlockKind, type GigaBorderStyle, type GigaCellValue, type GigaCharStyle, type GigaDocument, type GigaGeneric, type GigaHeading, type GigaImageRef, type GigaInline, type GigaInlineRun, type GigaLinkTarget, type GigaList, type GigaListItem, type GigaListMarker, type GigaMergeRange, type GigaOutlineNode, type GigaPage, type GigaPageGeometry, type GigaParaPatch, type GigaParagraph, type GigaParagraphStyle, type GigaPathSeg, GigaPdfDoc, GigaPdfEngine, type GigaPlaceholder, type GigaPlaceholderRole, type GigaRect, type GigaRotation, type GigaSection, type GigaShape, type GigaSheet, type GigaSheetBlock, type GigaSheetCell, type GigaSheetRow, type GigaSlide, type GigaSlideBlock, type GigaStylePatch, type GigaTable, type GigaTableCell, type GigaTableRow, type GigaTextBox, type HeaderFooterAlign, type HeaderFooterSpec, type HtmlFont, type HtmlFontRequest, type HtmlMargins, type HtmlRenderOptions, type HtmlResource, type HtmlResourceNeed, type ImageElementInfo, type LayerInfo, type LinkInfo, type ModelOp, type NamedDest, type OutlineEntry, type PageInfo, type PageMargins, type PathSegment, type PdfPermissions, type RadioOption, type SearchHit, type SignLtvOptions, type SignP12Options, type SignTsaOptions, type TextElementInfo, type TextLine, type TextRunInfo, type VectorPathInfo, type XlsxSheet, defaultCrlGet, defaultOcspPost, defaultTsaPost };
package/dist/index.js CHANGED
@@ -1154,7 +1154,7 @@ var GigaPdfDoc = class {
1154
1154
  * stream, painted last); otherwise it is sent behind everything (moved to the
1155
1155
  * start, painted first). The moved range is re-wrapped in `q … Q` so it neither
1156
1156
  * inherits nor leaks graphics state. Works for text, image and shape elements.
1157
- * The element's index changes after the move — re-read {@link pageElements}.
1157
+ * The element's index changes after the move — re-read {@link GigaPdfDoc.elements}.
1158
1158
  * Returns `false` if the page/index doesn't exist.
1159
1159
  */
1160
1160
  reorderElement(page, index, toFront) {
@@ -1479,22 +1479,26 @@ var GigaPdfDoc = class {
1479
1479
  /**
1480
1480
  * Rasterize a page to a PNG **without the page content stream's text** — glyphs
1481
1481
  * are suppressed while gradients, shadings, images, vectors and patterns are
1482
- * preserved. Annotation/widget appearances are still painted in full. Use this
1483
- * to paint a text-free raster background the editor can overlay real, editable
1484
- * text on top of.
1482
+ * preserved. Form-field **widget** appearances are omitted (the editor re-shows
1483
+ * their values as an editable overlay, so baking them in would double every
1484
+ * field); other annotation appearances (stamps, highlights, ink) are still
1485
+ * painted. Use this to paint a text-free raster background the editor can
1486
+ * overlay real, editable text on top of.
1485
1487
  */
1486
1488
  renderPageNoText(page, scale = 1) {
1487
1489
  return this.g._buffer((o) => this.ex().gp_render_page_no_text(this.h, page, scale, o));
1488
1490
  }
1489
1491
  /**
1490
1492
  * Rasterize a page to a PNG while **omitting** the given top-level element
1491
- * `indices` (from {@link pageElements}). Each excluded element paints nothing
1493
+ * `indices` (from {@link GigaPdfDoc.elements}). Each excluded element paints nothing
1492
1494
  * — fills, strokes, shadings, images and text alike — while everything else
1493
1495
  * (including the non-text content of non-excluded elements) renders normally.
1494
1496
  * Use it to paint a background without specific elements and overlay live,
1495
1497
  * editable versions on top. Generalises {@link renderPageNoText} (which
1496
- * suppresses *all* text). An empty `indices` renders the full page; unknown
1497
- * indices are ignored.
1498
+ * suppresses *all* text). Like {@link renderPageNoText}, form-field **widget**
1499
+ * appearances are omitted (the editor re-shows them as an editable overlay);
1500
+ * other annotation appearances are painted. An empty `indices` renders the full
1501
+ * page; unknown indices are ignored.
1498
1502
  */
1499
1503
  renderPageExcluding(page, indices, scale = 1) {
1500
1504
  return this.g._buffer(