@polotno/pdf-export 0.1.37 → 0.1.39
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/README.md +61 -8
- package/lib/index.d.ts +66 -8
- package/lib/index.js +25 -145
- package/package.json +17 -18
- package/lib/browser-entry.d.ts +0 -7
- package/lib/browser-entry.js +0 -11
- package/lib/compare-render.d.ts +0 -1
- package/lib/compare-render.js +0 -185
- package/lib/core/index.d.ts +0 -26
- package/lib/core/index.js +0 -87
- package/lib/figure.d.ts +0 -10
- package/lib/figure.js +0 -54
- package/lib/filters.d.ts +0 -2
- package/lib/filters.js +0 -163
- package/lib/ghostscript.d.ts +0 -21
- package/lib/ghostscript.js +0 -132
- package/lib/group.d.ts +0 -5
- package/lib/group.js +0 -5
- package/lib/image.d.ts +0 -38
- package/lib/image.js +0 -279
- package/lib/line.d.ts +0 -10
- package/lib/line.js +0 -66
- package/lib/platform/adapter.d.ts +0 -37
- package/lib/platform/adapter.js +0 -13
- package/lib/platform/browser-polyfill.d.ts +0 -1
- package/lib/platform/browser-polyfill.js +0 -5
- package/lib/platform/browser.d.ts +0 -7
- package/lib/platform/browser.js +0 -145
- package/lib/platform/node.d.ts +0 -7
- package/lib/platform/node.js +0 -142
- package/lib/spot-colors.d.ts +0 -38
- package/lib/spot-colors.js +0 -141
- package/lib/svg-render.d.ts +0 -9
- package/lib/svg-render.js +0 -63
- package/lib/svg.d.ts +0 -12
- package/lib/svg.js +0 -224
- package/lib/text/fonts.d.ts +0 -16
- package/lib/text/fonts.js +0 -82
- package/lib/text/index.d.ts +0 -8
- package/lib/text/index.js +0 -42
- package/lib/text/layout.d.ts +0 -22
- package/lib/text/layout.js +0 -522
- package/lib/text/parser.d.ts +0 -46
- package/lib/text/parser.js +0 -415
- package/lib/text/render.d.ts +0 -8
- package/lib/text/render.js +0 -237
- package/lib/text/types.d.ts +0 -91
- package/lib/text/types.js +0 -1
- package/lib/text.d.ts +0 -49
- package/lib/text.js +0 -1277
- package/lib/utils.d.ts +0 -16
- package/lib/utils.js +0 -124
package/lib/text/render.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { stripHtml } from 'string-strip-html';
|
|
2
|
-
import { parseColor } from '../utils.js';
|
|
3
|
-
import { calculateLineXOffset, calculateTextContentXOffset, calculateEffectiveWidth, buildRenderSegmentsForLine, } from './layout.js';
|
|
4
|
-
import { loadFontForSegment } from './fonts.js';
|
|
5
|
-
export async function drawListMarker(doc, element, line, lineXOffset, lineYOffset, fonts, color, opacity, mode, textOptions) {
|
|
6
|
-
if (!line.listMeta || !line.listMeta.showMarker) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const markerSegment = {
|
|
10
|
-
text: line.listMeta.markerText,
|
|
11
|
-
};
|
|
12
|
-
const fontKey = await loadFontForSegment(doc, markerSegment, element, fonts);
|
|
13
|
-
const previousFontSize = doc._fontSize !== undefined
|
|
14
|
-
? doc._fontSize
|
|
15
|
-
: element.fontSize;
|
|
16
|
-
doc.font(fontKey);
|
|
17
|
-
doc.fontSize(line.listMeta.markerFontSize);
|
|
18
|
-
if (mode === 'fill') {
|
|
19
|
-
doc.fillColor(color, opacity);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
doc.strokeColor(color, opacity);
|
|
23
|
-
}
|
|
24
|
-
doc.text(line.listMeta.markerText, lineXOffset + line.listMeta.indentPx, lineYOffset, {
|
|
25
|
-
...textOptions,
|
|
26
|
-
width: line.listMeta.markerBoxWidth,
|
|
27
|
-
align: line.listMeta.markerAlignment,
|
|
28
|
-
continued: false,
|
|
29
|
-
lineBreak: false,
|
|
30
|
-
underline: false,
|
|
31
|
-
characterSpacing: 0,
|
|
32
|
-
stroke: mode === 'stroke',
|
|
33
|
-
fill: mode === 'fill',
|
|
34
|
-
});
|
|
35
|
-
doc.fontSize(previousFontSize);
|
|
36
|
-
}
|
|
37
|
-
export async function prepareLineForRendering(doc, element, line, lineIndex, yOffset, lineHeightPx, cumulativeYOffset, textOptions, fonts, markerColor, markerOpacity, markerMode) {
|
|
38
|
-
const markerXOffset = calculateLineXOffset(element, line);
|
|
39
|
-
const lineYOffset = yOffset + cumulativeYOffset;
|
|
40
|
-
const strippedLineText = stripHtml(line.text).result;
|
|
41
|
-
const heightOfLine = line.text === ''
|
|
42
|
-
? lineHeightPx
|
|
43
|
-
: doc.heightOfString(strippedLineText, textOptions);
|
|
44
|
-
const contentStartX = calculateTextContentXOffset(element, line);
|
|
45
|
-
const isJustify = element.align === 'justify';
|
|
46
|
-
// Disable justification if line contains tabs - tabs position content precisely,
|
|
47
|
-
// and justification would interfere by spreading spaces
|
|
48
|
-
const hasTabs = line.text.includes('\t');
|
|
49
|
-
const widthOption = isJustify && !hasTabs
|
|
50
|
-
? Math.max(element.width - (line.listMeta ? line.listMeta.textStartPx : 0), 1)
|
|
51
|
-
: undefined;
|
|
52
|
-
// Handle list markers if needed
|
|
53
|
-
if (line.listMeta?.showMarker) {
|
|
54
|
-
await drawListMarker(doc, element, line, markerXOffset, lineYOffset, fonts, markerColor, markerOpacity, markerMode, textOptions);
|
|
55
|
-
// Restore color after drawing marker (marker may have changed the color state)
|
|
56
|
-
if (markerMode === 'fill') {
|
|
57
|
-
doc.fillColor(markerColor, markerOpacity);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
doc.strokeColor(markerColor, markerOpacity);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
markerXOffset,
|
|
65
|
-
lineYOffset,
|
|
66
|
-
contentStartX,
|
|
67
|
-
widthOption,
|
|
68
|
-
heightOfLine,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export async function renderSegmentsForLine(doc, element, line, renderSegments, context, textOptions, options) {
|
|
72
|
-
const { mode, color, opacity = element.opacity, heightOfLine, offsetX = 0, offsetY = 0, applySegmentColor, } = options;
|
|
73
|
-
const totalTextSegments = renderSegments.filter((seg) => seg.type === 'text').length;
|
|
74
|
-
let processedTextSegments = 0;
|
|
75
|
-
// Position cursor at line start (with optional offset)
|
|
76
|
-
doc.x = context.contentStartX + offsetX;
|
|
77
|
-
doc.y = context.lineYOffset + offsetY;
|
|
78
|
-
for (const renderSegment of renderSegments) {
|
|
79
|
-
if (renderSegment.type === 'tab') {
|
|
80
|
-
const advanceWidth = renderSegment.advanceWidth ?? 0;
|
|
81
|
-
doc.x = context.contentStartX + advanceWidth + offsetX;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const { segment, text = '', wordSpacing = 0, fontKey } = renderSegment;
|
|
85
|
-
processedTextSegments += 1;
|
|
86
|
-
const isLastSegment = processedTextSegments === totalTextSegments;
|
|
87
|
-
doc.font(fontKey);
|
|
88
|
-
doc.fontSize(element.fontSize);
|
|
89
|
-
// Apply color (either segment-specific or global)
|
|
90
|
-
if (applySegmentColor) {
|
|
91
|
-
applySegmentColor(segment);
|
|
92
|
-
}
|
|
93
|
-
else if (color) {
|
|
94
|
-
if (mode === 'fill') {
|
|
95
|
-
doc.fillColor(color, opacity);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
doc.strokeColor(color, opacity);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const hasUnderline = segment.underline || textOptions.underline || false;
|
|
102
|
-
const effectiveWidth = calculateEffectiveWidth(element, line, context.widthOption, hasUnderline);
|
|
103
|
-
doc.text(text, {
|
|
104
|
-
...textOptions,
|
|
105
|
-
width: effectiveWidth,
|
|
106
|
-
height: heightOfLine,
|
|
107
|
-
continued: !isLastSegment,
|
|
108
|
-
underline: hasUnderline,
|
|
109
|
-
lineBreak: hasUnderline,
|
|
110
|
-
stroke: mode === 'stroke',
|
|
111
|
-
fill: mode === 'fill',
|
|
112
|
-
wordSpacing,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
export async function renderPDFX1aStroke(doc, element, textLines, yOffset, lineHeightPx, textOptions, fonts) {
|
|
117
|
-
const strokeColor = parseColor(element.stroke).hex;
|
|
118
|
-
const strokeWidth = element.strokeWidth;
|
|
119
|
-
// Generate stroke offsets in a circle pattern (8 directions)
|
|
120
|
-
const offsets = [];
|
|
121
|
-
for (let angle = 0; angle < 360; angle += 45) {
|
|
122
|
-
const radian = (angle * Math.PI) / 180;
|
|
123
|
-
offsets.push({
|
|
124
|
-
x: Math.cos(radian) * strokeWidth,
|
|
125
|
-
y: Math.sin(radian) * strokeWidth,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
// Render stroke layer by drawing text multiple times with offsets
|
|
129
|
-
doc.save();
|
|
130
|
-
doc.fillColor(strokeColor, element.opacity);
|
|
131
|
-
for (let i = 0; i < textLines.length; i++) {
|
|
132
|
-
const line = textLines[i];
|
|
133
|
-
const context = await prepareLineForRendering(doc, element, line, i, yOffset, lineHeightPx, i * lineHeightPx, textOptions, fonts, strokeColor, element.opacity, 'fill');
|
|
134
|
-
const renderSegments = await buildRenderSegmentsForLine(doc, element, line.text, textOptions, fonts);
|
|
135
|
-
// Render with each offset to create stroke effect
|
|
136
|
-
for (const offset of offsets) {
|
|
137
|
-
doc.text('', context.contentStartX + offset.x, context.lineYOffset + offset.y, {
|
|
138
|
-
height: 0,
|
|
139
|
-
width: 0,
|
|
140
|
-
});
|
|
141
|
-
await renderSegmentsForLine(doc, element, line, renderSegments, context, textOptions, {
|
|
142
|
-
mode: 'fill',
|
|
143
|
-
color: strokeColor,
|
|
144
|
-
opacity: element.opacity,
|
|
145
|
-
offsetX: offset.x,
|
|
146
|
-
offsetY: offset.y,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
doc.restore();
|
|
151
|
-
await renderTextFill(doc, element, textLines, yOffset, lineHeightPx, textOptions, fonts);
|
|
152
|
-
}
|
|
153
|
-
export async function renderStandardStroke(doc, element, textLines, yOffset, lineHeightPx, textOptions, fonts) {
|
|
154
|
-
const strokeParsedColor = parseColor(element.stroke);
|
|
155
|
-
doc.save();
|
|
156
|
-
doc.lineWidth(element.strokeWidth);
|
|
157
|
-
doc.lineCap('round').lineJoin('round');
|
|
158
|
-
doc.strokeColor(strokeParsedColor.hex, element.opacity);
|
|
159
|
-
let cumulativeYOffset = 0;
|
|
160
|
-
for (let i = 0; i < textLines.length; i++) {
|
|
161
|
-
const line = textLines[i];
|
|
162
|
-
const context = await prepareLineForRendering(doc, element, line, i, yOffset, lineHeightPx, cumulativeYOffset, textOptions, fonts, strokeParsedColor.hex, element.opacity, 'stroke');
|
|
163
|
-
cumulativeYOffset += context.heightOfLine;
|
|
164
|
-
const renderSegments = await buildRenderSegmentsForLine(doc, element, line.text, textOptions, fonts);
|
|
165
|
-
await renderSegmentsForLine(doc, element, line, renderSegments, context, textOptions, {
|
|
166
|
-
mode: 'stroke',
|
|
167
|
-
color: strokeParsedColor.hex,
|
|
168
|
-
opacity: element.opacity,
|
|
169
|
-
heightOfLine: context.heightOfLine,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
doc.restore();
|
|
173
|
-
}
|
|
174
|
-
export async function renderTextFill(doc, element, textLines, yOffset, lineHeightPx, textOptions, fonts) {
|
|
175
|
-
if (!element.fill) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
const baseParsedColor = parseColor(element.fill);
|
|
179
|
-
const baseOpacity = Math.min(baseParsedColor.rgba[3] ?? 1, element.opacity, 1);
|
|
180
|
-
doc.fillColor(baseParsedColor.hex, baseOpacity);
|
|
181
|
-
let cumulativeYOffset = 0;
|
|
182
|
-
for (let i = 0; i < textLines.length; i++) {
|
|
183
|
-
const line = textLines[i];
|
|
184
|
-
const context = await prepareLineForRendering(doc, element, line, i, yOffset, lineHeightPx, cumulativeYOffset, textOptions, fonts, baseParsedColor.hex, baseOpacity, 'fill');
|
|
185
|
-
cumulativeYOffset += context.heightOfLine;
|
|
186
|
-
const renderSegments = await buildRenderSegmentsForLine(doc, element, line.text, textOptions, fonts);
|
|
187
|
-
// Apply segment-specific colors for rich text
|
|
188
|
-
const applySegmentColor = (segment) => {
|
|
189
|
-
const segmentParsedColor = segment.color
|
|
190
|
-
? parseColor(segment.color)
|
|
191
|
-
: parseColor(element.fill);
|
|
192
|
-
// Fallback to element fill if segment color parsing fails
|
|
193
|
-
const segmentColor = segmentParsedColor?.hex || parseColor(element.fill).hex || '#000000';
|
|
194
|
-
// Segment alpha can be NaN (e.g. rgba(..., var(--x, 1))) -> fallback to 1
|
|
195
|
-
const a = segmentParsedColor?.rgba?.[3];
|
|
196
|
-
const segmentOpacity = Math.min(typeof a === 'number' && a >= 0 && a <= 1 ? a : 1, element.opacity, 1);
|
|
197
|
-
doc.fillColor(segmentColor, segmentOpacity);
|
|
198
|
-
};
|
|
199
|
-
await renderSegmentsForLine(doc, element, line, renderSegments, context, textOptions, {
|
|
200
|
-
mode: 'fill',
|
|
201
|
-
heightOfLine: context.heightOfLine,
|
|
202
|
-
applySegmentColor,
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
export function renderTextBackground(doc, element, verticalAlignmentOffset, textOptions) {
|
|
207
|
-
if (!element.backgroundEnabled) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const strippedContent = stripHtml(element.text).result;
|
|
211
|
-
const padding = element.backgroundPadding * (element.fontSize * element.lineHeight);
|
|
212
|
-
const cornerRadius = element.backgroundCornerRadius *
|
|
213
|
-
(element.fontSize * element.lineHeight * 0.5);
|
|
214
|
-
const textWidth = doc.widthOfString(strippedContent, {
|
|
215
|
-
...textOptions,
|
|
216
|
-
width: element.width,
|
|
217
|
-
});
|
|
218
|
-
const textHeight = doc.heightOfString(strippedContent, {
|
|
219
|
-
...textOptions,
|
|
220
|
-
width: element.width,
|
|
221
|
-
});
|
|
222
|
-
let bgX = -padding / 2;
|
|
223
|
-
let bgY = verticalAlignmentOffset - padding / 2;
|
|
224
|
-
const bgWidth = textWidth + padding;
|
|
225
|
-
const bgHeight = textHeight + padding;
|
|
226
|
-
// Adjust horizontal position based on text alignment
|
|
227
|
-
if (element.align === 'center') {
|
|
228
|
-
bgX = (element.width - textWidth) / 2 - padding / 2;
|
|
229
|
-
}
|
|
230
|
-
else if (element.align === 'right') {
|
|
231
|
-
bgX = element.width - textWidth - padding / 2;
|
|
232
|
-
}
|
|
233
|
-
doc.roundedRect(bgX, bgY, bgWidth, bgHeight, cornerRadius);
|
|
234
|
-
doc.fillColor(parseColor(element.backgroundColor).hex);
|
|
235
|
-
doc.fill();
|
|
236
|
-
doc.fillColor(parseColor(element.fill).hex, element.opacity);
|
|
237
|
-
}
|
package/lib/text/types.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export interface TextElement {
|
|
2
|
-
fontFamily: string;
|
|
3
|
-
fontWeight?: string;
|
|
4
|
-
fontSize: number;
|
|
5
|
-
fontStyle?: string;
|
|
6
|
-
fill: string;
|
|
7
|
-
opacity: number;
|
|
8
|
-
strokeWidth: number;
|
|
9
|
-
stroke?: string;
|
|
10
|
-
align: string;
|
|
11
|
-
textDecoration: string;
|
|
12
|
-
letterSpacing?: number;
|
|
13
|
-
lineHeight: number;
|
|
14
|
-
text: string;
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
verticalAlign?: string;
|
|
18
|
-
backgroundEnabled?: boolean;
|
|
19
|
-
backgroundPadding?: number;
|
|
20
|
-
backgroundCornerRadius?: number;
|
|
21
|
-
backgroundColor?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface RenderAttrs {
|
|
24
|
-
pdfx1a?: boolean;
|
|
25
|
-
textVerticalResizeEnabled?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface TextSegment {
|
|
28
|
-
text: string;
|
|
29
|
-
bold?: boolean;
|
|
30
|
-
italic?: boolean;
|
|
31
|
-
underline?: boolean;
|
|
32
|
-
color?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface TabExpansionSegment {
|
|
35
|
-
type: 'text' | 'tab';
|
|
36
|
-
text?: string;
|
|
37
|
-
wordSpacing?: number;
|
|
38
|
-
advanceWidth?: number;
|
|
39
|
-
}
|
|
40
|
-
export interface RenderSegment {
|
|
41
|
-
segment: TextSegment;
|
|
42
|
-
fontKey: string;
|
|
43
|
-
type: 'text' | 'tab';
|
|
44
|
-
text?: string;
|
|
45
|
-
wordSpacing?: number;
|
|
46
|
-
advanceWidth?: number;
|
|
47
|
-
}
|
|
48
|
-
export interface ListParagraphMeta {
|
|
49
|
-
type: 'ul' | 'ol';
|
|
50
|
-
index: number;
|
|
51
|
-
indentLevel: number;
|
|
52
|
-
displayMarker: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface ListLineMeta {
|
|
55
|
-
type: 'ul' | 'ol';
|
|
56
|
-
markerText: string;
|
|
57
|
-
indentPx: number;
|
|
58
|
-
markerBoxWidth: number;
|
|
59
|
-
markerFontSize: number;
|
|
60
|
-
markerAlignment: 'center' | 'right';
|
|
61
|
-
showMarker: boolean;
|
|
62
|
-
textStartPx: number;
|
|
63
|
-
}
|
|
64
|
-
export interface TextLine {
|
|
65
|
-
text: string;
|
|
66
|
-
width: number;
|
|
67
|
-
fullWidth: number;
|
|
68
|
-
listMeta?: ListLineMeta;
|
|
69
|
-
}
|
|
70
|
-
export interface LineRenderContext {
|
|
71
|
-
markerXOffset: number;
|
|
72
|
-
lineYOffset: number;
|
|
73
|
-
contentStartX: number;
|
|
74
|
-
widthOption: number | undefined;
|
|
75
|
-
heightOfLine: number;
|
|
76
|
-
}
|
|
77
|
-
export interface SegmentRenderOptions {
|
|
78
|
-
mode: 'fill' | 'stroke';
|
|
79
|
-
color?: string;
|
|
80
|
-
opacity?: number;
|
|
81
|
-
heightOfLine?: number;
|
|
82
|
-
offsetX?: number;
|
|
83
|
-
offsetY?: number;
|
|
84
|
-
applySegmentColor?: (segment: TextSegment) => void;
|
|
85
|
-
}
|
|
86
|
-
export interface TextMetrics {
|
|
87
|
-
textOptions: PDFKit.Mixins.TextOptions;
|
|
88
|
-
lineHeightPx: number;
|
|
89
|
-
baselineOffset: number;
|
|
90
|
-
textLines: TextLine[];
|
|
91
|
-
}
|
package/lib/text/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/text.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export interface TextElement {
|
|
2
|
-
fontFamily: string;
|
|
3
|
-
fontWeight?: string;
|
|
4
|
-
fontSize: number;
|
|
5
|
-
fontStyle?: string;
|
|
6
|
-
fill: string;
|
|
7
|
-
opacity: number;
|
|
8
|
-
strokeWidth: number;
|
|
9
|
-
stroke?: string;
|
|
10
|
-
align: string;
|
|
11
|
-
textDecoration: string;
|
|
12
|
-
letterSpacing?: number;
|
|
13
|
-
lineHeight: number;
|
|
14
|
-
text: string;
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
verticalAlign?: string;
|
|
18
|
-
backgroundEnabled?: boolean;
|
|
19
|
-
backgroundPadding?: number;
|
|
20
|
-
backgroundCornerRadius?: number;
|
|
21
|
-
backgroundColor?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface RenderAttrs {
|
|
24
|
-
pdfx1a?: boolean;
|
|
25
|
-
textVerticalResizeEnabled?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface TextSegment {
|
|
28
|
-
text: string;
|
|
29
|
-
bold?: boolean;
|
|
30
|
-
italic?: boolean;
|
|
31
|
-
underline?: boolean;
|
|
32
|
-
color?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Normalize rich text HTML by converting block-level line breaks into newline characters
|
|
36
|
-
* while preserving inline formatting tags.
|
|
37
|
-
*/
|
|
38
|
-
declare function normalizeRichText(text: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Parse HTML text into styled segments
|
|
41
|
-
*/
|
|
42
|
-
declare function parseHTMLToSegments(html: string, baseElement: TextElement): TextSegment[];
|
|
43
|
-
export declare function getGoogleFontPath(fontFamily: string, fontWeight?: string, italic?: boolean): Promise<string>;
|
|
44
|
-
export declare function loadFontIfNeeded(doc: any, element: TextElement, fonts: Record<string, boolean>): Promise<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Main text rendering function
|
|
47
|
-
*/
|
|
48
|
-
export declare function renderText(doc: PDFKit.PDFDocument, element: TextElement, fonts: Record<string, boolean>, attrs?: RenderAttrs): Promise<void>;
|
|
49
|
-
export { normalizeRichText as __normalizeRichTextForTests, parseHTMLToSegments as __parseHTMLToSegmentsForTests, };
|