@qrcommunication/gigapdf-lib 0.121.0 → 0.122.1
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/CHANGELOG.md +53 -0
- package/dist/editor.d.cts +2 -1
- package/dist/editor.d.ts +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -2
- package/dist/index.d.ts +87 -2
- package/dist/index.js.map +1 -1
- package/dist/node-fs.cjs +1 -1
- package/dist/node-fs.cjs.map +1 -1
- package/dist/viewer.d.cts +2 -1
- package/dist/viewer.d.ts +2 -1
- package/gigapdf.wasm +0 -0
- package/package.json +6 -5
package/dist/index.d.cts
CHANGED
|
@@ -601,8 +601,14 @@ interface TextElementInfo {
|
|
|
601
601
|
y: number;
|
|
602
602
|
width: number;
|
|
603
603
|
height: number;
|
|
604
|
-
/**
|
|
604
|
+
/**
|
|
605
|
+
* Resolved `/BaseFont` family (e.g. "Helvetica", "Times New Roman").
|
|
606
|
+
* `"Helvetica"` (the standard viewer substitution) when the font could not
|
|
607
|
+
* be resolved — see {@link fontResolved}.
|
|
608
|
+
*/
|
|
605
609
|
fontFamily: string;
|
|
610
|
+
/** `false` when the run's font could not be resolved (`fontFamily` is then the Helvetica substitute). */
|
|
611
|
+
fontResolved: boolean;
|
|
606
612
|
/**
|
|
607
613
|
* The raw `/BaseFont` name with the subset prefix kept (e.g.
|
|
608
614
|
* `"ABCDEF+TimesNewRomanPSMT"`), resolved against the run's own scope — the
|
|
@@ -636,6 +642,34 @@ interface TextElementInfo {
|
|
|
636
642
|
* run is only digits/punctuation/whitespace.
|
|
637
643
|
*/
|
|
638
644
|
direction: 'ltr' | 'rtl' | 'neutral';
|
|
645
|
+
/** Non-stroking alpha (`/ExtGState` `/ca`) the run was painted with, `0..=1` (`1` = opaque). */
|
|
646
|
+
fillAlpha: number;
|
|
647
|
+
/**
|
|
648
|
+
* The `/ExtGState` `/BM` blend mode the run was painted with, verbatim from the
|
|
649
|
+
* PDF (`"Normal"`, `"Multiply"`, `"Screen"`, …), or `null` when no graphics
|
|
650
|
+
* state set one. An open string: a PDF may carry any name here.
|
|
651
|
+
*/
|
|
652
|
+
blendMode: string | null;
|
|
653
|
+
/** Stroke colour `[r,g,b]` in `0..=1` when the rendering mode strokes (`Tr` 1, 2, 5, 6), else `null`. */
|
|
654
|
+
strokeColor: [number, number, number] | null;
|
|
655
|
+
/**
|
|
656
|
+
* Text rendering mode (`Tr`, ISO 32000-1 §9.3.6): `0` fill, `1` stroke,
|
|
657
|
+
* `2` fill+stroke, `3` invisible, `4`–`6` the same plus clip, `7` clip only.
|
|
658
|
+
*/
|
|
659
|
+
renderingMode: TextRenderingMode;
|
|
660
|
+
/**
|
|
661
|
+
* Horizontal scale of the text matrix × CTM, decomposed as
|
|
662
|
+
* `rotate(rotation) · scale(scaleX, scaleY) · skewX(skewX)` — the convention
|
|
663
|
+
* of Fabric.js `util.qrDecompose` / `composeMatrix`, so feeding these values
|
|
664
|
+
* back rebuilds the exact matrix (in PDF user space, y up). `1` = unscaled.
|
|
665
|
+
*/
|
|
666
|
+
scaleX: number;
|
|
667
|
+
/** Vertical scale in the same decomposition; negative when mirrored. */
|
|
668
|
+
scaleY: number;
|
|
669
|
+
/** Horizontal skew in degrees (positive leans the glyphs right; non-zero for synthetically obliqued text). */
|
|
670
|
+
skewX: number;
|
|
671
|
+
/** Always `0`: rotation, both scales and `skewX` fully determine the transform. */
|
|
672
|
+
skewY: number;
|
|
639
673
|
/**
|
|
640
674
|
* The run's visually contiguous fragments when it contains internal `TJ`
|
|
641
675
|
* position jumps — justified / per-glyph-positioned text (a legal footer, a
|
|
@@ -658,7 +692,28 @@ interface TextSegment {
|
|
|
658
692
|
y: number;
|
|
659
693
|
width: number;
|
|
660
694
|
height: number;
|
|
695
|
+
/** Effective word spacing (`Tw`) applied to this fragment, in user-space units. */
|
|
696
|
+
wordSpacing: number;
|
|
697
|
+
/** Effective character spacing (`Tc`) applied to this fragment, in user-space units. */
|
|
698
|
+
charSpacing: number;
|
|
699
|
+
/**
|
|
700
|
+
* Sum of the raw `TJ` kerning numbers between the fragment's first and last
|
|
701
|
+
* glyph, in thousandths of an em (PDF sign convention: positive tightens).
|
|
702
|
+
* `0` when no intra-fragment kerning was applied.
|
|
703
|
+
*/
|
|
704
|
+
totalKerning: number;
|
|
661
705
|
}
|
|
706
|
+
/**
|
|
707
|
+
* Text rendering mode (`Tr`, ISO 32000-1 §9.3.6). The engine clamps the
|
|
708
|
+
* operand to this range.
|
|
709
|
+
*/
|
|
710
|
+
type TextRenderingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
711
|
+
/** Fill rule of a painted path, chosen by its painting operator (`f*`/`B*`/`b*` = even-odd). */
|
|
712
|
+
type PathFillRule = 'nonzero' | 'evenodd';
|
|
713
|
+
/** Line cap style (`J`): `0` butt, `1` round, `2` square. */
|
|
714
|
+
type PathLineCap = 'butt' | 'round' | 'square';
|
|
715
|
+
/** Line join style (`j`): `0` miter, `1` round, `2` bevel. */
|
|
716
|
+
type PathLineJoin = 'miter' | 'round' | 'bevel';
|
|
662
717
|
/**
|
|
663
718
|
* The aggregate language signal of a document from
|
|
664
719
|
* {@link GigaPdfDoc.documentLanguage}: its dominant reading {@link
|
|
@@ -1505,6 +1560,25 @@ interface ImageElementInfo {
|
|
|
1505
1560
|
rotation: number;
|
|
1506
1561
|
/** Non-stroking fill alpha (`/ExtGState` `/ca`), `0..=1` (`1` = opaque). */
|
|
1507
1562
|
opacity: number;
|
|
1563
|
+
/** The `/BM` blend mode the image was painted with, verbatim, or `null` when unset. */
|
|
1564
|
+
blendMode: string | null;
|
|
1565
|
+
/**
|
|
1566
|
+
* Horizontal scale of the placement CTM, in the same decomposition as
|
|
1567
|
+
* {@link TextElementInfo.scaleX} (the unit image square maps to this box).
|
|
1568
|
+
*/
|
|
1569
|
+
scaleX: number;
|
|
1570
|
+
/** Vertical scale in the same decomposition; negative when mirrored. */
|
|
1571
|
+
scaleY: number;
|
|
1572
|
+
/** Horizontal skew in degrees in the same decomposition. */
|
|
1573
|
+
skewX: number;
|
|
1574
|
+
/** Always `0` (see {@link TextElementInfo.skewY}). */
|
|
1575
|
+
skewY: number;
|
|
1576
|
+
/**
|
|
1577
|
+
* Axis-aligned box `[x0, y0, x1, y1]` (user space) of the clip path active
|
|
1578
|
+
* when the image was painted, or `null` when none was. Reported separately:
|
|
1579
|
+
* the placement box above is NOT intersected with it.
|
|
1580
|
+
*/
|
|
1581
|
+
clipBounds: [number, number, number, number] | null;
|
|
1508
1582
|
}
|
|
1509
1583
|
/**
|
|
1510
1584
|
* One path segment from {@link GigaPdfDoc.vectorPaths} (page user space, origin
|
|
@@ -1550,6 +1624,16 @@ interface VectorPathInfo {
|
|
|
1550
1624
|
strokeAlpha: number;
|
|
1551
1625
|
/** Dash pattern (`d` array); empty for a solid line. */
|
|
1552
1626
|
dash: number[];
|
|
1627
|
+
/** The `/BM` blend mode the path was painted with, verbatim, or `null` when unset. */
|
|
1628
|
+
blendMode: string | null;
|
|
1629
|
+
/** Fill rule selected by the painting operator. */
|
|
1630
|
+
fillRule: PathFillRule;
|
|
1631
|
+
/** Line cap style (`J`). */
|
|
1632
|
+
lineCap: PathLineCap;
|
|
1633
|
+
/** Line join style (`j`). */
|
|
1634
|
+
lineJoin: PathLineJoin;
|
|
1635
|
+
/** Miter limit (`M`), `≥ 1` (default `10`). */
|
|
1636
|
+
miterLimit: number;
|
|
1553
1637
|
}
|
|
1554
1638
|
interface TextLine extends Box {
|
|
1555
1639
|
text: string;
|
|
@@ -3799,4 +3883,5 @@ declare class GigaPdfDoc {
|
|
|
3799
3883
|
regenerateFieldAppearance(name: string): boolean;
|
|
3800
3884
|
}
|
|
3801
3885
|
|
|
3802
|
-
export {
|
|
3886
|
+
export { GigaPdfDoc, GigaPdfEngine, PAGE_BOX_KINDS, PAGE_TRANSITION_STYLES, defaultCrlGet, defaultOcspPost, defaultTsaPost };
|
|
3887
|
+
export type { Action, AfRelationship, AnnotationInfo, Attachment, AttachmentOptions, Bookmark, Box, CollectionConfig, CollectionField, CollectionFieldSubtype, CollectionItem, CollectionView, Color, DecodedImage, Destination, DocumentJavascript, DocumentLanguage, Element, EmbeddedFont, EmbeddedFontV2, Exports, FieldInfo, FieldKind, FieldStyle, FileAttachmentIcon, FontInfo, GigaBlock, GigaBlockAddr, GigaBlockKind, GigaBorderStyle, GigaCellValue, GigaCharStyle, GigaDocument, GigaFootnote, GigaGeneric, GigaGradient, GigaHeading, GigaImageRef, GigaInline, GigaInlineRun, GigaLinkTarget, GigaList, GigaListItem, GigaListLevelStyle, GigaListMarker, GigaMergeRange, GigaOutlineNode, GigaPage, GigaPageGeometry, GigaParaBorder, GigaParaPatch, GigaParagraph, GigaParagraphStyle, GigaPathSeg, GigaPlaceholder, GigaPlaceholderRole, GigaRect, GigaRotation, GigaSection, GigaShadow, GigaShape, GigaSheet, GigaSheetBlock, GigaSheetCell, GigaSheetRow, GigaSlide, GigaSlideBlock, GigaStylePatch, GigaTable, GigaTableCell, GigaTableRow, GigaTextBox, GradientSpec, GradientStop, HFAlign, HFItem, HFZone, HeaderFooterAlign, HeaderFooterSpec, HtmlFont, HtmlFontRequest, HtmlMargins, HtmlRenderOptions, HtmlResource, HtmlResourceNeed, HtmlToPdfOptions, ImageElementInfo, InfoFields, LayerInfo, LinkInfo, MergePart, ModelOp, NamedDest, OutlineEntry, PageBoxKind, PageBoxes, PageInfo, PageLabelRange, PageLabelStyle, PageLayout, PageMargins, PageMode, PageTransition, PageTransitionDimension, PageTransitionDirection, PageTransitionMotion, PageTransitionStyle, PathFillRule, PathLineCap, PathLineJoin, PathSegment, PdfPermissions, PdfVersion, RadioOption, RunningHeaderFooter, SearchHit, SignLtvOptions, SignP12Options, SignTsaOptions, SignatureInfo, SignatureReport, TextElementInfo, TextLine, TextRenderingMode, TextRunInfo, TextSegment, VectorPathInfo, ViewerPreferences, WidgetPlacement, XlsxSheet };
|
package/dist/index.d.ts
CHANGED
|
@@ -601,8 +601,14 @@ interface TextElementInfo {
|
|
|
601
601
|
y: number;
|
|
602
602
|
width: number;
|
|
603
603
|
height: number;
|
|
604
|
-
/**
|
|
604
|
+
/**
|
|
605
|
+
* Resolved `/BaseFont` family (e.g. "Helvetica", "Times New Roman").
|
|
606
|
+
* `"Helvetica"` (the standard viewer substitution) when the font could not
|
|
607
|
+
* be resolved — see {@link fontResolved}.
|
|
608
|
+
*/
|
|
605
609
|
fontFamily: string;
|
|
610
|
+
/** `false` when the run's font could not be resolved (`fontFamily` is then the Helvetica substitute). */
|
|
611
|
+
fontResolved: boolean;
|
|
606
612
|
/**
|
|
607
613
|
* The raw `/BaseFont` name with the subset prefix kept (e.g.
|
|
608
614
|
* `"ABCDEF+TimesNewRomanPSMT"`), resolved against the run's own scope — the
|
|
@@ -636,6 +642,34 @@ interface TextElementInfo {
|
|
|
636
642
|
* run is only digits/punctuation/whitespace.
|
|
637
643
|
*/
|
|
638
644
|
direction: 'ltr' | 'rtl' | 'neutral';
|
|
645
|
+
/** Non-stroking alpha (`/ExtGState` `/ca`) the run was painted with, `0..=1` (`1` = opaque). */
|
|
646
|
+
fillAlpha: number;
|
|
647
|
+
/**
|
|
648
|
+
* The `/ExtGState` `/BM` blend mode the run was painted with, verbatim from the
|
|
649
|
+
* PDF (`"Normal"`, `"Multiply"`, `"Screen"`, …), or `null` when no graphics
|
|
650
|
+
* state set one. An open string: a PDF may carry any name here.
|
|
651
|
+
*/
|
|
652
|
+
blendMode: string | null;
|
|
653
|
+
/** Stroke colour `[r,g,b]` in `0..=1` when the rendering mode strokes (`Tr` 1, 2, 5, 6), else `null`. */
|
|
654
|
+
strokeColor: [number, number, number] | null;
|
|
655
|
+
/**
|
|
656
|
+
* Text rendering mode (`Tr`, ISO 32000-1 §9.3.6): `0` fill, `1` stroke,
|
|
657
|
+
* `2` fill+stroke, `3` invisible, `4`–`6` the same plus clip, `7` clip only.
|
|
658
|
+
*/
|
|
659
|
+
renderingMode: TextRenderingMode;
|
|
660
|
+
/**
|
|
661
|
+
* Horizontal scale of the text matrix × CTM, decomposed as
|
|
662
|
+
* `rotate(rotation) · scale(scaleX, scaleY) · skewX(skewX)` — the convention
|
|
663
|
+
* of Fabric.js `util.qrDecompose` / `composeMatrix`, so feeding these values
|
|
664
|
+
* back rebuilds the exact matrix (in PDF user space, y up). `1` = unscaled.
|
|
665
|
+
*/
|
|
666
|
+
scaleX: number;
|
|
667
|
+
/** Vertical scale in the same decomposition; negative when mirrored. */
|
|
668
|
+
scaleY: number;
|
|
669
|
+
/** Horizontal skew in degrees (positive leans the glyphs right; non-zero for synthetically obliqued text). */
|
|
670
|
+
skewX: number;
|
|
671
|
+
/** Always `0`: rotation, both scales and `skewX` fully determine the transform. */
|
|
672
|
+
skewY: number;
|
|
639
673
|
/**
|
|
640
674
|
* The run's visually contiguous fragments when it contains internal `TJ`
|
|
641
675
|
* position jumps — justified / per-glyph-positioned text (a legal footer, a
|
|
@@ -658,7 +692,28 @@ interface TextSegment {
|
|
|
658
692
|
y: number;
|
|
659
693
|
width: number;
|
|
660
694
|
height: number;
|
|
695
|
+
/** Effective word spacing (`Tw`) applied to this fragment, in user-space units. */
|
|
696
|
+
wordSpacing: number;
|
|
697
|
+
/** Effective character spacing (`Tc`) applied to this fragment, in user-space units. */
|
|
698
|
+
charSpacing: number;
|
|
699
|
+
/**
|
|
700
|
+
* Sum of the raw `TJ` kerning numbers between the fragment's first and last
|
|
701
|
+
* glyph, in thousandths of an em (PDF sign convention: positive tightens).
|
|
702
|
+
* `0` when no intra-fragment kerning was applied.
|
|
703
|
+
*/
|
|
704
|
+
totalKerning: number;
|
|
661
705
|
}
|
|
706
|
+
/**
|
|
707
|
+
* Text rendering mode (`Tr`, ISO 32000-1 §9.3.6). The engine clamps the
|
|
708
|
+
* operand to this range.
|
|
709
|
+
*/
|
|
710
|
+
type TextRenderingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
711
|
+
/** Fill rule of a painted path, chosen by its painting operator (`f*`/`B*`/`b*` = even-odd). */
|
|
712
|
+
type PathFillRule = 'nonzero' | 'evenodd';
|
|
713
|
+
/** Line cap style (`J`): `0` butt, `1` round, `2` square. */
|
|
714
|
+
type PathLineCap = 'butt' | 'round' | 'square';
|
|
715
|
+
/** Line join style (`j`): `0` miter, `1` round, `2` bevel. */
|
|
716
|
+
type PathLineJoin = 'miter' | 'round' | 'bevel';
|
|
662
717
|
/**
|
|
663
718
|
* The aggregate language signal of a document from
|
|
664
719
|
* {@link GigaPdfDoc.documentLanguage}: its dominant reading {@link
|
|
@@ -1505,6 +1560,25 @@ interface ImageElementInfo {
|
|
|
1505
1560
|
rotation: number;
|
|
1506
1561
|
/** Non-stroking fill alpha (`/ExtGState` `/ca`), `0..=1` (`1` = opaque). */
|
|
1507
1562
|
opacity: number;
|
|
1563
|
+
/** The `/BM` blend mode the image was painted with, verbatim, or `null` when unset. */
|
|
1564
|
+
blendMode: string | null;
|
|
1565
|
+
/**
|
|
1566
|
+
* Horizontal scale of the placement CTM, in the same decomposition as
|
|
1567
|
+
* {@link TextElementInfo.scaleX} (the unit image square maps to this box).
|
|
1568
|
+
*/
|
|
1569
|
+
scaleX: number;
|
|
1570
|
+
/** Vertical scale in the same decomposition; negative when mirrored. */
|
|
1571
|
+
scaleY: number;
|
|
1572
|
+
/** Horizontal skew in degrees in the same decomposition. */
|
|
1573
|
+
skewX: number;
|
|
1574
|
+
/** Always `0` (see {@link TextElementInfo.skewY}). */
|
|
1575
|
+
skewY: number;
|
|
1576
|
+
/**
|
|
1577
|
+
* Axis-aligned box `[x0, y0, x1, y1]` (user space) of the clip path active
|
|
1578
|
+
* when the image was painted, or `null` when none was. Reported separately:
|
|
1579
|
+
* the placement box above is NOT intersected with it.
|
|
1580
|
+
*/
|
|
1581
|
+
clipBounds: [number, number, number, number] | null;
|
|
1508
1582
|
}
|
|
1509
1583
|
/**
|
|
1510
1584
|
* One path segment from {@link GigaPdfDoc.vectorPaths} (page user space, origin
|
|
@@ -1550,6 +1624,16 @@ interface VectorPathInfo {
|
|
|
1550
1624
|
strokeAlpha: number;
|
|
1551
1625
|
/** Dash pattern (`d` array); empty for a solid line. */
|
|
1552
1626
|
dash: number[];
|
|
1627
|
+
/** The `/BM` blend mode the path was painted with, verbatim, or `null` when unset. */
|
|
1628
|
+
blendMode: string | null;
|
|
1629
|
+
/** Fill rule selected by the painting operator. */
|
|
1630
|
+
fillRule: PathFillRule;
|
|
1631
|
+
/** Line cap style (`J`). */
|
|
1632
|
+
lineCap: PathLineCap;
|
|
1633
|
+
/** Line join style (`j`). */
|
|
1634
|
+
lineJoin: PathLineJoin;
|
|
1635
|
+
/** Miter limit (`M`), `≥ 1` (default `10`). */
|
|
1636
|
+
miterLimit: number;
|
|
1553
1637
|
}
|
|
1554
1638
|
interface TextLine extends Box {
|
|
1555
1639
|
text: string;
|
|
@@ -3799,4 +3883,5 @@ declare class GigaPdfDoc {
|
|
|
3799
3883
|
regenerateFieldAppearance(name: string): boolean;
|
|
3800
3884
|
}
|
|
3801
3885
|
|
|
3802
|
-
export {
|
|
3886
|
+
export { GigaPdfDoc, GigaPdfEngine, PAGE_BOX_KINDS, PAGE_TRANSITION_STYLES, defaultCrlGet, defaultOcspPost, defaultTsaPost };
|
|
3887
|
+
export type { Action, AfRelationship, AnnotationInfo, Attachment, AttachmentOptions, Bookmark, Box, CollectionConfig, CollectionField, CollectionFieldSubtype, CollectionItem, CollectionView, Color, DecodedImage, Destination, DocumentJavascript, DocumentLanguage, Element, EmbeddedFont, EmbeddedFontV2, Exports, FieldInfo, FieldKind, FieldStyle, FileAttachmentIcon, FontInfo, GigaBlock, GigaBlockAddr, GigaBlockKind, GigaBorderStyle, GigaCellValue, GigaCharStyle, GigaDocument, GigaFootnote, GigaGeneric, GigaGradient, GigaHeading, GigaImageRef, GigaInline, GigaInlineRun, GigaLinkTarget, GigaList, GigaListItem, GigaListLevelStyle, GigaListMarker, GigaMergeRange, GigaOutlineNode, GigaPage, GigaPageGeometry, GigaParaBorder, GigaParaPatch, GigaParagraph, GigaParagraphStyle, GigaPathSeg, GigaPlaceholder, GigaPlaceholderRole, GigaRect, GigaRotation, GigaSection, GigaShadow, GigaShape, GigaSheet, GigaSheetBlock, GigaSheetCell, GigaSheetRow, GigaSlide, GigaSlideBlock, GigaStylePatch, GigaTable, GigaTableCell, GigaTableRow, GigaTextBox, GradientSpec, GradientStop, HFAlign, HFItem, HFZone, HeaderFooterAlign, HeaderFooterSpec, HtmlFont, HtmlFontRequest, HtmlMargins, HtmlRenderOptions, HtmlResource, HtmlResourceNeed, HtmlToPdfOptions, ImageElementInfo, InfoFields, LayerInfo, LinkInfo, MergePart, ModelOp, NamedDest, OutlineEntry, PageBoxKind, PageBoxes, PageInfo, PageLabelRange, PageLabelStyle, PageLayout, PageMargins, PageMode, PageTransition, PageTransitionDimension, PageTransitionDirection, PageTransitionMotion, PageTransitionStyle, PathFillRule, PathLineCap, PathLineJoin, PathSegment, PdfPermissions, PdfVersion, RadioOption, RunningHeaderFooter, SearchHit, SignLtvOptions, SignP12Options, SignTsaOptions, SignatureInfo, SignatureReport, TextElementInfo, TextLine, TextRenderingMode, TextRunInfo, TextSegment, VectorPathInfo, ViewerPreferences, WidgetPlacement, XlsxSheet };
|