renderpdf-js 0.2.0 → 0.3.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/API.md +204 -0
- package/README.md +275 -307
- package/dist/compose-pdf.d.ts +26 -0
- package/dist/document-colors.d.ts +8 -0
- package/dist/document-page.d.ts +115 -0
- package/dist/document-types.d.ts +135 -0
- package/dist/document.d.ts +64 -0
- package/dist/fonts.d.ts +4 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2051 -552
- package/dist/jspdf-adapter.d.ts +159 -0
- package/package.json +8 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PDFDocument } from 'pdf-lib';
|
|
2
|
+
import type { PDFPage } from 'pdf-lib';
|
|
3
|
+
import type { PDFMetadata, RenderPDFResult, RenderProgress } from './api-types.js';
|
|
4
|
+
/** An existing PDF or an immutable export result; URLs are fetched by the application. */
|
|
5
|
+
export type PDFSource = Blob | ArrayBuffer | Uint8Array | Pick<RenderPDFResult, 'toUint8Array'>;
|
|
6
|
+
/** Shared metadata and cooperative cancellation for native page composition. */
|
|
7
|
+
export interface PDFCompositionOptions {
|
|
8
|
+
/** Properties of the new document; source document metadata is not merged. */
|
|
9
|
+
metadata?: PDFMetadata;
|
|
10
|
+
/** Cancel between loading, page copying and serialization stages. */
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
/** Frozen stage-local counters, using preparing/resources/pages/saving/complete. */
|
|
13
|
+
onProgress?: (progress: RenderProgress) => void;
|
|
14
|
+
}
|
|
15
|
+
/** Share strict PDF input loading with the document builder; not a public entry-point export. */
|
|
16
|
+
export declare function loadPDFSource(source: PDFSource, signal?: AbortSignal): Promise<PDFDocument>;
|
|
17
|
+
/** Reuse validated native page copying and local navigation in the document builder. */
|
|
18
|
+
export declare function appendPDFPages(target: PDFDocument, donor: PDFDocument, pageNumbers?: readonly number[], signal?: AbortSignal): Promise<readonly PDFPage[]>;
|
|
19
|
+
/** Merge native pages in source order, preserving text, vectors, dimensions and rotation.
|
|
20
|
+
* Interactive forms must be flattened. Document-level outlines, signatures and attachments are not copied.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mergePDFs(sources: readonly PDFSource[], options?: PDFCompositionOptions): Promise<RenderPDFResult>;
|
|
23
|
+
/** Copy selected one-based pages in caller order; repeated numbers produce repeated pages. */
|
|
24
|
+
export declare function extractPDFPages(source: PDFSource, pageNumbers: readonly number[], options?: PDFCompositionOptions): Promise<RenderPDFResult>;
|
|
25
|
+
/** Split into one PDF per page; cross-page links require a multi-page extraction instead. */
|
|
26
|
+
export declare function splitPDF(source: PDFSource, options?: PDFCompositionOptions): Promise<readonly RenderPDFResult[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RGB } from 'pdf-lib';
|
|
2
|
+
/** Color components and alpha stay separate so native PDF paint retains transparency. */
|
|
3
|
+
export interface DocumentColor {
|
|
4
|
+
color: RGB;
|
|
5
|
+
opacity: number;
|
|
6
|
+
}
|
|
7
|
+
/** Parse portable CSS hex/rgb colors without relying on a browser document. */
|
|
8
|
+
export declare function parseDocumentColor(value: string): DocumentColor;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { PDFPage } from 'pdf-lib';
|
|
2
|
+
import type { DocumentCheckBoxOptions, DocumentDropdownOptions, DocumentImageOptions, DocumentImageSource, DocumentLineOptions, DocumentPageContext, DocumentRectangle, DocumentShapeOptions, DocumentTextFieldOptions, DocumentTextOptions } from './document-types.js';
|
|
3
|
+
/** Six coefficients map top-left document coordinates to transformed document coordinates. */
|
|
4
|
+
type Matrix = readonly [number, number, number, number, number, number];
|
|
5
|
+
/** Native drawing surface; asynchronous image calls must finish before later drawing. */
|
|
6
|
+
export declare class PDFPageBuilder {
|
|
7
|
+
private readonly page;
|
|
8
|
+
private readonly context;
|
|
9
|
+
/** Path and graphics state are tracked because PDF readers otherwise accept accidental leakage. */
|
|
10
|
+
private pathOpen;
|
|
11
|
+
private pendingImages;
|
|
12
|
+
private matrix;
|
|
13
|
+
private readonly stack;
|
|
14
|
+
private readonly userUnit;
|
|
15
|
+
private readonly scale;
|
|
16
|
+
/** The owning document supplies registered fonts, units and finalization/cancellation checks. */
|
|
17
|
+
constructor(page: PDFPage, context: DocumentPageContext);
|
|
18
|
+
/** Physical page width in document units. */
|
|
19
|
+
get width(): number;
|
|
20
|
+
/** Physical page height in document units. */
|
|
21
|
+
get height(): number;
|
|
22
|
+
/** Reader-facing page rotation does not change its unrotated drawing coordinates. */
|
|
23
|
+
get rotation(): number;
|
|
24
|
+
/** Rotate the completed page view by an integral number of quarter turns. */
|
|
25
|
+
setRotation(angle: number): this;
|
|
26
|
+
/** Guard both finalization and paint order before a synchronous operation changes the page. */
|
|
27
|
+
private ready;
|
|
28
|
+
/** Finalization refuses incomplete operations instead of silently saving partial content. */
|
|
29
|
+
assertComplete(): void;
|
|
30
|
+
/** Convert a caller point to the backend's upward-pointing page coordinates. */
|
|
31
|
+
private point;
|
|
32
|
+
/** Emit a separate native text run per line so alignment remains correct after wrapping. */
|
|
33
|
+
drawText(text: string, options: DocumentTextOptions): this;
|
|
34
|
+
/** Draw one native line with a width in document units. */
|
|
35
|
+
drawLine(options: DocumentLineOptions): this;
|
|
36
|
+
/** Resolve shared paint before rectangle, ellipse or SVG operators are appended. */
|
|
37
|
+
private paint;
|
|
38
|
+
/** Rectangle coordinates identify its top-left corner. */
|
|
39
|
+
drawRectangle(options: DocumentRectangle & DocumentShapeOptions): this;
|
|
40
|
+
/** Ellipses use a top-left bounding rectangle, matching other document shapes. */
|
|
41
|
+
drawEllipse(options: DocumentRectangle & DocumentShapeOptions): this;
|
|
42
|
+
/** Circle x/y identify its center; radius uses document units. */
|
|
43
|
+
drawCircle(options: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
radius: number;
|
|
47
|
+
} & DocumentShapeOptions): this;
|
|
48
|
+
/** Draw SVG path geometry; this API does not load or interpret SVG documents. */
|
|
49
|
+
drawSvgPath(path: string, options: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
scale?: number;
|
|
53
|
+
rotation?: number;
|
|
54
|
+
} & DocumentShapeOptions): this;
|
|
55
|
+
/** Save clipping and transforms together with the PDF graphics state. */
|
|
56
|
+
saveGraphicsState(): this;
|
|
57
|
+
/** Restore a previously saved state; an unmatched restore is an error. */
|
|
58
|
+
restoreGraphicsState(): this;
|
|
59
|
+
/** Compose an affine transform expressed in top-left document coordinates. */
|
|
60
|
+
transform(matrix: Matrix): this;
|
|
61
|
+
/** Start a new subpath without implicitly discarding an earlier subpath. */
|
|
62
|
+
moveTo(x: number, y: number): this;
|
|
63
|
+
/** Append a native straight segment to the current path. */
|
|
64
|
+
lineTo(x: number, y: number): this;
|
|
65
|
+
/** Append a cubic Bezier curve using two control points and one end point. */
|
|
66
|
+
curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): this;
|
|
67
|
+
/** Close the current subpath while retaining it for painting or clipping. */
|
|
68
|
+
closePath(): this;
|
|
69
|
+
/** Require actual geometry before a path-ending operation. */
|
|
70
|
+
private requirePath;
|
|
71
|
+
/** Intersect the clip with the current path; discardPath ends the path afterwards. */
|
|
72
|
+
clip(rule?: 'nonzero' | 'evenodd'): this;
|
|
73
|
+
/** Clip to one rectangle and consume its path. */
|
|
74
|
+
clipRectangle(options: DocumentRectangle): this;
|
|
75
|
+
/** Discard pending geometry without painting it. */
|
|
76
|
+
discardPath(): this;
|
|
77
|
+
/** Stroke an accumulated native path. */
|
|
78
|
+
stroke(options?: {
|
|
79
|
+
color?: string;
|
|
80
|
+
width?: number;
|
|
81
|
+
opacity?: number;
|
|
82
|
+
}): this;
|
|
83
|
+
/** Fill an accumulated native path. */
|
|
84
|
+
fill(options?: {
|
|
85
|
+
color?: string;
|
|
86
|
+
opacity?: number;
|
|
87
|
+
}): this;
|
|
88
|
+
/** Fill and stroke an accumulated native path in one paint operation. */
|
|
89
|
+
fillAndStroke(options?: DocumentShapeOptions): this;
|
|
90
|
+
/** Alpha is stored in a page resource and scoped to this path operation. */
|
|
91
|
+
private paintPath;
|
|
92
|
+
/** Read image bytes before modifying page paint; no network is initiated for string inputs. */
|
|
93
|
+
private imageBytes;
|
|
94
|
+
/** Embed one PNG/JPEG at explicit dimensions, applying EXIF orientation and clockwise rotation. */
|
|
95
|
+
drawImage(source: DocumentImageSource, options: DocumentImageOptions): Promise<this>;
|
|
96
|
+
/** Transform annotation rectangles separately because PDF annotations do not inherit page graphics state. */
|
|
97
|
+
private annotationRectangle;
|
|
98
|
+
/** Add a clickable external link without an opaque border. */
|
|
99
|
+
addLink(url: string, rect: DocumentRectangle): this;
|
|
100
|
+
/** Add a Unicode note annotation; it remains separate from visible page content. */
|
|
101
|
+
addNote(text: string, rect: DocumentRectangle, options?: {
|
|
102
|
+
title?: string;
|
|
103
|
+
}): this;
|
|
104
|
+
/** Field appearances cannot faithfully represent sheared or arbitrary transformed widgets. */
|
|
105
|
+
private fieldOptions;
|
|
106
|
+
/** Apply common flags after creating a field but before marking appearances clean. */
|
|
107
|
+
private fieldFlags;
|
|
108
|
+
/** Create a Unicode-capable text input with its explicitly selected embedded font. */
|
|
109
|
+
addTextField(name: string, rect: DocumentRectangle, options?: DocumentTextFieldOptions): this;
|
|
110
|
+
/** Create an interactive checkbox with a native checkmark appearance. */
|
|
111
|
+
addCheckBox(name: string, rect: DocumentRectangle, options?: DocumentCheckBoxOptions): this;
|
|
112
|
+
/** Create a dropdown with copied choices and a validated initial selection. */
|
|
113
|
+
addDropdown(name: string, rect: DocumentRectangle, choices: readonly string[], options?: DocumentDropdownOptions): this;
|
|
114
|
+
}
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { PDFFont, PDFDocument } from 'pdf-lib';
|
|
2
|
+
import type { FontSource, PDFMetadata, ImageSource } from './api-types.js';
|
|
3
|
+
/** Coordinate unit; font sizes always use typographic points. */
|
|
4
|
+
export type DocumentUnit = 'pt' | 'mm' | 'px';
|
|
5
|
+
/** Physical page dimensions in the document's chosen coordinate unit. */
|
|
6
|
+
export interface DocumentPageOptions {
|
|
7
|
+
/** Named paper or explicit width and height, including page edges. */
|
|
8
|
+
format?: 'A4' | 'A3' | 'Letter' | {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
/** Landscape swaps the supplied base dimensions. */
|
|
13
|
+
orientation?: 'portrait' | 'landscape';
|
|
14
|
+
}
|
|
15
|
+
/** Prepare a document independently of browser layout and the DOM. */
|
|
16
|
+
export interface PDFDocumentOptions extends DocumentPageOptions {
|
|
17
|
+
/** Coordinate unit, defaulting to points. */
|
|
18
|
+
unit?: DocumentUnit;
|
|
19
|
+
/** Static fonts embedded before synchronous drawing and measurement begin. */
|
|
20
|
+
fonts?: readonly FontSource[];
|
|
21
|
+
/** PDF document properties. */
|
|
22
|
+
metadata?: PDFMetadata;
|
|
23
|
+
/** Cooperative cancellation during resource preparation and serialization. */
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
/** Exact font face; all built-in families have regular, bold and italic variants. */
|
|
27
|
+
export interface DocumentFontOptions {
|
|
28
|
+
/** Registered family, defaulting to Helvetica. */
|
|
29
|
+
font?: string;
|
|
30
|
+
/** Static weight, defaulting to 400. */
|
|
31
|
+
fontWeight?: number;
|
|
32
|
+
/** Static face style, defaulting to normal. */
|
|
33
|
+
fontStyle?: 'normal' | 'italic';
|
|
34
|
+
}
|
|
35
|
+
/** Text metrics use the document's coordinate unit. */
|
|
36
|
+
export interface DocumentTextMetrics {
|
|
37
|
+
/** Largest line width. */
|
|
38
|
+
width: number;
|
|
39
|
+
/** Total line advance, including line spacing. */
|
|
40
|
+
height: number;
|
|
41
|
+
/** Distance from the baseline to the top of the font. */
|
|
42
|
+
ascent: number;
|
|
43
|
+
/** Positive distance below the baseline. */
|
|
44
|
+
descent: number;
|
|
45
|
+
}
|
|
46
|
+
/** Axis-aligned rectangle measured from the page's top-left corner. */
|
|
47
|
+
export interface DocumentRectangle {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
}
|
|
53
|
+
/** Vector paint settings; colors use CSS color strings. */
|
|
54
|
+
export interface DocumentShapeOptions {
|
|
55
|
+
fill?: string;
|
|
56
|
+
stroke?: string;
|
|
57
|
+
strokeWidth?: number;
|
|
58
|
+
opacity?: number;
|
|
59
|
+
}
|
|
60
|
+
/** Text position uses a baseline measured down from the top edge. */
|
|
61
|
+
export interface DocumentTextOptions extends DocumentFontOptions {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
/** Font size in points, independent of coordinate units. */
|
|
65
|
+
fontSize?: number;
|
|
66
|
+
color?: string;
|
|
67
|
+
align?: 'left' | 'center' | 'right';
|
|
68
|
+
/** Baseline advance as a multiple of fontSize, defaulting to 1.15. */
|
|
69
|
+
lineHeight?: number;
|
|
70
|
+
rotation?: number;
|
|
71
|
+
maxWidth?: number;
|
|
72
|
+
opacity?: number;
|
|
73
|
+
link?: string;
|
|
74
|
+
}
|
|
75
|
+
/** One line segment in top-left page coordinates. */
|
|
76
|
+
export interface DocumentLineOptions {
|
|
77
|
+
x1: number;
|
|
78
|
+
y1: number;
|
|
79
|
+
x2: number;
|
|
80
|
+
y2: number;
|
|
81
|
+
color?: string;
|
|
82
|
+
width?: number;
|
|
83
|
+
opacity?: number;
|
|
84
|
+
}
|
|
85
|
+
/** Native bitmap bytes, a data URL, or an existing browser image/canvas. */
|
|
86
|
+
export type DocumentImageSource = ImageSource | string | HTMLCanvasElement | HTMLImageElement;
|
|
87
|
+
/** Explicit image placement; dimensions use document units. */
|
|
88
|
+
export interface DocumentImageOptions extends DocumentRectangle {
|
|
89
|
+
rotation?: number;
|
|
90
|
+
opacity?: number;
|
|
91
|
+
}
|
|
92
|
+
/** Common interactive field appearance and validation settings. */
|
|
93
|
+
export interface DocumentFieldOptions extends DocumentFontOptions {
|
|
94
|
+
fontSize?: number;
|
|
95
|
+
textColor?: string;
|
|
96
|
+
borderColor?: string;
|
|
97
|
+
backgroundColor?: string;
|
|
98
|
+
borderWidth?: number;
|
|
99
|
+
readOnly?: boolean;
|
|
100
|
+
required?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** Text field content and display behavior. */
|
|
103
|
+
export interface DocumentTextFieldOptions extends DocumentFieldOptions {
|
|
104
|
+
value?: string;
|
|
105
|
+
multiline?: boolean;
|
|
106
|
+
maxLength?: number;
|
|
107
|
+
}
|
|
108
|
+
/** Checkbox initial state. */
|
|
109
|
+
export interface DocumentCheckBoxOptions extends DocumentFieldOptions {
|
|
110
|
+
checked?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/** Dropdown selection and editability. */
|
|
113
|
+
export interface DocumentDropdownOptions extends DocumentFieldOptions {
|
|
114
|
+
value?: string | readonly string[];
|
|
115
|
+
editable?: boolean;
|
|
116
|
+
multiselect?: boolean;
|
|
117
|
+
}
|
|
118
|
+
/** Internal page services; the public page API does not expose backend objects. */
|
|
119
|
+
export interface DocumentPageContext {
|
|
120
|
+
readonly pdf: PDFDocument;
|
|
121
|
+
readonly scale: number;
|
|
122
|
+
resolveFont(options?: DocumentFontOptions): PDFFont;
|
|
123
|
+
assertActive(): void;
|
|
124
|
+
}
|
|
125
|
+
/** Page destinations are one-based and belong to the current document. */
|
|
126
|
+
export interface DocumentBookmarkOptions {
|
|
127
|
+
pageNumber: number;
|
|
128
|
+
/** Optional parent returned by addBookmark. */
|
|
129
|
+
parent?: DocumentBookmark;
|
|
130
|
+
}
|
|
131
|
+
/** Opaque destination handle used to build a bookmark hierarchy. */
|
|
132
|
+
export interface DocumentBookmark {
|
|
133
|
+
readonly title: string;
|
|
134
|
+
readonly pageNumber: number;
|
|
135
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { RenderPDFResult } from './api-types.js';
|
|
2
|
+
import type { DocumentBookmark, DocumentBookmarkOptions, DocumentFontOptions, DocumentPageOptions, DocumentTextMetrics, DocumentUnit, PDFDocumentOptions } from './document-types.js';
|
|
3
|
+
import type { PDFSource } from './compose-pdf.js';
|
|
4
|
+
import { PDFPageBuilder } from './document-page.js';
|
|
5
|
+
/** Mutable PDF document; drawing is synchronous after resources are prepared. */
|
|
6
|
+
export declare class PDFBuilder {
|
|
7
|
+
private readonly pdf;
|
|
8
|
+
private readonly fonts;
|
|
9
|
+
private readonly fontNames;
|
|
10
|
+
private readonly defaults;
|
|
11
|
+
private readonly signal;
|
|
12
|
+
/** Point conversion shared by page drawing and compatibility adapters. */
|
|
13
|
+
readonly unitScale: number;
|
|
14
|
+
/** Coordinate unit selected at document creation. */
|
|
15
|
+
readonly unit: DocumentUnit;
|
|
16
|
+
private readonly pages;
|
|
17
|
+
private readonly activePages;
|
|
18
|
+
private readonly characterSets;
|
|
19
|
+
private readonly bookmarks;
|
|
20
|
+
private readonly roots;
|
|
21
|
+
private readonly outlines;
|
|
22
|
+
private finished;
|
|
23
|
+
private pending;
|
|
24
|
+
private output;
|
|
25
|
+
private constructor();
|
|
26
|
+
/** Prepare font programs without reading any browser globals. */
|
|
27
|
+
static create(options?: PDFDocumentOptions): Promise<PDFBuilder>;
|
|
28
|
+
/** Number of physical pages currently in the document. */
|
|
29
|
+
get pageCount(): number;
|
|
30
|
+
/** Snapshot of registered family names, including standard PDF fonts. */
|
|
31
|
+
getFontNames(): readonly string[];
|
|
32
|
+
private assertMutable;
|
|
33
|
+
private assertActive;
|
|
34
|
+
private resolveFont;
|
|
35
|
+
private wrapPage;
|
|
36
|
+
/** Add an independently sized page; no empty page is created implicitly. */
|
|
37
|
+
addPage(options?: DocumentPageOptions): PDFPageBuilder;
|
|
38
|
+
/** Insert a page before the given one-based position; pageCount + 1 appends. */
|
|
39
|
+
insertPage(pageNumber: number, options?: DocumentPageOptions): PDFPageBuilder;
|
|
40
|
+
/** Reorder existing pages while retaining native destination references. */
|
|
41
|
+
movePage(from: number, to: number): this;
|
|
42
|
+
/** Remove a page only when it is not a bookmark/link target or interactive form owner. */
|
|
43
|
+
removePage(pageNumber: number): this;
|
|
44
|
+
/** Look up an existing page by its one-based number. */
|
|
45
|
+
getPage(pageNumber: number): PDFPageBuilder;
|
|
46
|
+
/** Return page handles in document order without exposing the mutable page list. */
|
|
47
|
+
getPages(): readonly PDFPageBuilder[];
|
|
48
|
+
/** Measure using the same embedded font program used by page drawing. */
|
|
49
|
+
measureText(text: string, options?: DocumentFontOptions & {
|
|
50
|
+
fontSize?: number;
|
|
51
|
+
lineHeight?: number;
|
|
52
|
+
}): DocumentTextMetrics;
|
|
53
|
+
/** Append native PDF pages, preserving page geometry and supported page content. */
|
|
54
|
+
appendPDF(source: PDFSource, pageNumbers?: readonly number[]): Promise<this>;
|
|
55
|
+
/** Flatten prepared interactive appearances into ordinary page content. */
|
|
56
|
+
flattenForms(): this;
|
|
57
|
+
/** Create a bookmark pointing to an existing page, optionally below another bookmark. */
|
|
58
|
+
addBookmark(title: string, options: DocumentBookmarkOptions): DocumentBookmark;
|
|
59
|
+
private writeBookmarks;
|
|
60
|
+
/** Finalize once; subsequent output requests reuse the same immutable PDF. */
|
|
61
|
+
toResult(): Promise<RenderPDFResult>;
|
|
62
|
+
}
|
|
63
|
+
/** Prepare an empty document with registered fonts and explicit coordinate units. */
|
|
64
|
+
export declare function createDocument(options?: PDFDocumentOptions): Promise<PDFBuilder>;
|
package/dist/fonts.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { FontSource, RegisteredFont } from './api-types.js';
|
|
2
|
+
/** Admit only static SFNT programs whose exact browser and PDF instances can agree.
|
|
3
|
+
* @param bytes Owned TTF/OTF program; the browser still validates its actual font tables.
|
|
4
|
+
*/
|
|
5
|
+
export declare function assertStaticSfnt(bytes: Uint8Array): void;
|
|
2
6
|
/** Validate immutable registration handles against the current browser's live font set.
|
|
3
7
|
* @param fonts Explicit handles whose owned programs must still control browser font selection.
|
|
4
8
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,12 @@ export { renderPDF } from './render-pdf.js';
|
|
|
2
2
|
export { imageToPDF } from './image-pdf.js';
|
|
3
3
|
export { registerFont } from './fonts.js';
|
|
4
4
|
export { RenderPDFError } from './diagnostics.js';
|
|
5
|
+
export { createDocument, PDFBuilder } from './document.js';
|
|
6
|
+
export { PDFPageBuilder } from './document-page.js';
|
|
7
|
+
export { mergePDFs, extractPDFPages, splitPDF } from './compose-pdf.js';
|
|
8
|
+
export type { PDFSource, PDFCompositionOptions } from './compose-pdf.js';
|
|
9
|
+
export { createJsPDFAdapter, JsPDFAdapter } from './jspdf-adapter.js';
|
|
10
|
+
export type { JsPDFAdapterFont, JsPDFAdapterTextOptions, JsPDFAdapterMeasureOptions, JsPDFAdapterColorOptions, } from './jspdf-adapter.js';
|
|
11
|
+
export type { DocumentUnit, DocumentPageOptions, PDFDocumentOptions, DocumentFontOptions, DocumentTextMetrics, DocumentRectangle, DocumentShapeOptions, DocumentTextOptions, DocumentLineOptions, DocumentImageSource, DocumentImageOptions, DocumentFieldOptions, DocumentTextFieldOptions, DocumentCheckBoxOptions, DocumentDropdownOptions, DocumentBookmarkOptions, DocumentBookmark, } from './document-types.js';
|
|
5
12
|
export type { RenderErrorCode, RenderWarning } from './diagnostics.js';
|
|
6
13
|
export type { FontSource, RegisteredFont, PageMargins, PDFPageOptions, ImageSource, ImagePDFOptions, CustomPageSize, PageTextOptions, PDFMetadata, RenderStage, RenderProgress, RenderPDFOptions, RenderPDFResult, } from './api-types.js';
|