renderpdf-js 0.0.0-stage → 0.2.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.
@@ -0,0 +1,24 @@
1
+ import type { RegisteredFont } from './api-types.js';
2
+ import type { LayoutSnapshot } from './types.js';
3
+ /** Prepare browser resources, then snapshot the supported static DOM subset without changing it.
4
+ * @param root Connected, visible HTMLElement whose existing browser layout is exported.
5
+ * @param fonts Explicit faces used both by the browser and PDF embedding.
6
+ * @param options Whether safe local effects may choose raster boundaries automatically.
7
+ */
8
+ export declare function snapshotLayout(root: HTMLElement, fonts: readonly RegisteredFont[], options?: {
9
+ /** Strict mode keeps native errors unless a boundary has explicit data-raster markup. */
10
+ fallback?: 'auto' | 'strict';
11
+ /** Reserve and replay a native THEAD on each body continuation page. */
12
+ repeatTableHeaders?: boolean;
13
+ }): Promise<LayoutSnapshot>;
14
+ /** Measure settled browser resources synchronously so a source guard can share the same task.
15
+ * @param root Connected, visible HTMLElement with its fonts and source images already prepared.
16
+ * @param fonts Exact registered faces used both by the browser and PDF embedding.
17
+ * @param options Whether safe local effects may choose raster boundaries automatically.
18
+ */
19
+ export declare function measurePreparedLayout(root: HTMLElement, fonts: readonly RegisteredFont[], options?: {
20
+ /** Strict mode keeps native errors unless a boundary has explicit data-raster markup. */
21
+ fallback?: 'auto' | 'strict';
22
+ /** Reserve and replay a native THEAD on each body continuation page. */
23
+ repeatTableHeaders?: boolean;
24
+ }): LayoutSnapshot;
@@ -0,0 +1,24 @@
1
+ import type { PageGeometry, RegisteredFont, RenderPDFOptions } from './api-types.js';
2
+ /** Copied, validated inputs for one repeated text band. */
3
+ export interface PageText {
4
+ /** Caller text with supported page placeholders preserved until pagination finishes. */
5
+ readonly text: string;
6
+ /** Reserved height in CSS pixels. */
7
+ readonly height: number;
8
+ /** Exact face also supplied to the source renderer. */
9
+ readonly font: RegisteredFont;
10
+ /** Font size in CSS pixels. */
11
+ readonly fontSize: number;
12
+ /** Horizontal placement inside the original page margins. */
13
+ readonly align: 'left' | 'center' | 'right';
14
+ }
15
+ /** Reserve page text outside the source area without changing the caller's DOM layout. */
16
+ export declare function resolvePageBands(
17
+ /** Original physical page and outer margins. */
18
+ page: PageGeometry,
19
+ /** Validated options whose font handles remain immutable. */
20
+ options: RenderPDFOptions): {
21
+ content: PageGeometry;
22
+ header: PageText | undefined;
23
+ footer: PageText | undefined;
24
+ };
package/dist/page.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { PageGeometry, PDFPageOptions, RenderPDFOptions } from './api-types.js';
2
+ /** Resolve physical paper dimensions without requiring DOM content or registered fonts. */
3
+ export declare function resolvePageGeometry(
4
+ /** Caller-owned options; resolving them never changes their values. */
5
+ options: PDFPageOptions): PageGeometry;
6
+ /** Validate HTML rendering settings around the shared physical page geometry. */
7
+ export declare function resolvePage(
8
+ /** Caller-owned HTML rendering options. */
9
+ options: RenderPDFOptions): PageGeometry;
@@ -0,0 +1,21 @@
1
+ import type { RenderWarning } from './diagnostics.js';
2
+ import type { LayoutSnapshot, TableHeader } from './types.js';
3
+ /** One source-coordinate interval mapped into a PDF page. */
4
+ export interface PageSlice {
5
+ /** Inclusive source top in CSS pixels. */
6
+ start: number;
7
+ /** Exclusive source bottom in CSS pixels. */
8
+ end: number;
9
+ /** Original header replayed before this continuation interval; absent on its first page. */
10
+ header?: TableHeader;
11
+ /** Reserved repeated band, counting any leading source row gap only once. */
12
+ headerHeight?: number;
13
+ }
14
+ /** Map one continuous source into pages with required cuts and best-effort CSS avoidance. */
15
+ export declare function paginate(
16
+ /** Browser-measured display list plus optional CSS page-break metadata. */
17
+ snapshot: LayoutSnapshot,
18
+ /** Usable height after top/bottom page margins, in CSS pixels. */
19
+ contentHeight: number,
20
+ /** Optional observer for a preference that cannot fit without splitting native content. */
21
+ onWarning?: (warning: RenderWarning) => void): PageSlice[];
package/dist/pdf.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ import type { PageGeometry, PDFMetadata, RegisteredFont, RenderProgress } from './api-types.js';
2
+ import type { PageText } from './page-bands.js';
3
+ import type { PageSlice } from './pagination.js';
4
+ import type { LayoutSnapshot } from './types.js';
5
+ /** Bounded writer settings independent of DOM layout measurement. */
6
+ export interface PDFWriteOptions {
7
+ /** Physical pixels per CSS pixel for explicitly selected raster regions. */
8
+ rasterScale?: number;
9
+ /** Include extraction-only text inside a region already painted as a bitmap. */
10
+ includeRasterText?: boolean;
11
+ /** Stop before beginning subsequent asynchronous writing stages. */
12
+ signal?: AbortSignal;
13
+ /** Copied plain text placed above the source, outside its page clip. */
14
+ header?: PageText;
15
+ /** Copied plain text placed below the source, outside its page clip. */
16
+ footer?: PageText;
17
+ /** Owned Unicode document properties, resolved before preparation begins. */
18
+ metadata?: Readonly<PDFMetadata>;
19
+ /** Internal awaited reporter; public application callbacks remain synchronous. */
20
+ reportProgress?: (progress: RenderProgress) => Promise<void>;
21
+ }
22
+ /** Serialized PDF and the exact source intervals used for page ownership. */
23
+ export interface PDFWriteResult {
24
+ /** Complete PDF file owned by this export. */
25
+ bytes: Uint8Array;
26
+ /** Shared source offsets for visible objects and extraction text. */
27
+ slices: PageSlice[];
28
+ }
29
+ /** Serialize a measured display list with consistent ordered paint and page mapping. */
30
+ export declare function writePDF(
31
+ /** Prepared source geometry; this adapter never performs DOM measurement. */
32
+ snapshot: LayoutSnapshot,
33
+ /** Exact font programs already registered for source browser layout. */
34
+ fonts: readonly RegisteredFont[],
35
+ /** Validated physical page and per-edge margins, in CSS pixels. */
36
+ geometry: PageGeometry,
37
+ /** Validated source intervals planned before diagnostics and any PDF allocation. */
38
+ slices: PageSlice[],
39
+ /** Optional raster quality and cancellation controls. */
40
+ options?: PDFWriteOptions): Promise<PDFWriteResult>;
@@ -0,0 +1,9 @@
1
+ /** Identify only effects that a bounded subtree can reproduce without surrounding pixels.
2
+ * @param style Browser-computed declarations; native layout and typography remain unchanged.
3
+ */
4
+ export declare function automaticRasterReason(style: CSSStyleDeclaration): string | undefined;
5
+ /** Require a single formatting box that can be cloned into an independent rectangular viewport.
6
+ * @param element Candidate selected for its own local visual effects.
7
+ * @param style Browser-computed display mode for the candidate.
8
+ */
9
+ export declare function assertAutomaticRasterBoundary(element: HTMLElement, style: CSSStyleDeclaration): void;
@@ -0,0 +1,17 @@
1
+ /** Wait for one browser stage while releasing the cancellation listener on every outcome. */
2
+ export declare function withCancellation<T>(
3
+ /** Work whose underlying browser API may not itself accept an AbortSignal. */
4
+ pending: Promise<T>,
5
+ /** Optional application cancellation. */
6
+ signal?: AbortSignal): Promise<T>;
7
+ /** Observe caller ownership throughout preparation, capture and asynchronous PDF writing. */
8
+ export declare function prepareSource(
9
+ /** Connected browser element; a live source is measured without cloning application state. */
10
+ root: HTMLElement,
11
+ /** Optional cancellation for fonts and image preparation. */
12
+ signal?: AbortSignal): {
13
+ ready: () => Promise<void>;
14
+ captureBaseline: () => void;
15
+ assertUnchanged: () => void;
16
+ dispose: () => void;
17
+ };
@@ -0,0 +1,11 @@
1
+ import type { RenderProgress } from './api-types.js';
2
+ /** One export owns its callback error and optional browser scheduling state. */
3
+ export declare function createProgressReporter(
4
+ /** Synchronous application listener, absent when progress was not requested. */
5
+ callback: ((progress: RenderProgress) => void) | undefined,
6
+ /** Optional cooperative cancellation shared with the rendering pipeline. */
7
+ signal?: AbortSignal): {
8
+ report: ((progress: RenderProgress) => Promise<void>) | undefined;
9
+ /** Preserve application exceptions across lower-level PDF adapter error wrapping. */
10
+ rethrow(error: unknown): never;
11
+ };
@@ -0,0 +1,20 @@
1
+ import type { RegisteredFont } from './api-types.js';
2
+ /**
3
+ * Captures one explicitly isolated, self-contained HTML region as PNG bytes.
4
+ * Gradients, rounded corners and inset shadows remain browser-painted. Effects
5
+ * involving a backdrop, external assets or pixels beyond the box fail explicitly.
6
+ */
7
+ export declare function captureRaster(
8
+ /** Connected source region; capture never mutates its DOM. */
9
+ element: HTMLElement,
10
+ /** Font bytes also used to lay out the original browser document. */
11
+ fonts: readonly RegisteredFont[],
12
+ /** Physical bitmap pixels per CSS pixel. */
13
+ scale: number,
14
+ /** Fractional CSS origin retained inside a bitmap placed on an integer pixel grid. */
15
+ offset?: {
16
+ /** Horizontal transparent padding in CSS pixels, from zero inclusive to one exclusive. */
17
+ x: number;
18
+ /** Vertical transparent padding in CSS pixels, from zero inclusive to one exclusive. */
19
+ y: number;
20
+ }): Promise<Uint8Array>;
@@ -0,0 +1,21 @@
1
+ import type { RenderPDFOptions, RenderPDFResult } from './api-types.js';
2
+ import { type RenderWarning } from './diagnostics.js';
3
+ /** Measure a stable browser element and export supported paint as selectable, paginated PDF. */
4
+ export declare function renderDocument(
5
+ /** Connected source in the current browser document; its width and markup stay caller-owned. */
6
+ element: HTMLElement,
7
+ /** Explicit fonts and the small supported page, raster and diagnostic options. */
8
+ options: RenderPDFOptions,
9
+ /** Research-only switch for comparing visible pixels without the invisible text layer. */
10
+ includeRasterText?: boolean): Promise<{
11
+ snapshot: import("./types.js").LayoutSnapshot;
12
+ warnings: RenderWarning[];
13
+ bytes: Uint8Array;
14
+ slices: import("./pagination.js").PageSlice[];
15
+ }>;
16
+ /** Export a stable browser element through the minimal public PDF API. */
17
+ export declare function renderPDF(
18
+ /** Connected source; browser layout and caller-owned markup remain unchanged. */
19
+ element: HTMLElement,
20
+ /** Explicit font programs and supported conversion options. */
21
+ options: RenderPDFOptions): Promise<RenderPDFResult>;
@@ -0,0 +1,10 @@
1
+ import type { RenderPDFResult } from './api-types.js';
2
+ import type { RenderWarning } from './diagnostics.js';
3
+ /** Retain immutable PDF output and expose browser-native forms without re-rendering the source. */
4
+ export declare function createResult(
5
+ /** Complete successfully written PDF bytes; never expose this owned buffer directly. */
6
+ bytes: Uint8Array,
7
+ /** Physical PDF page count from the shared page mapping. */
8
+ pageCount: number,
9
+ /** Export diagnostics, copied and frozen to preserve the original outcome. */
10
+ warnings: readonly RenderWarning[]): RenderPDFResult;
@@ -0,0 +1,52 @@
1
+ import type { BorderOperation, Bounds } from './types.js';
2
+ /** One authored border competing for a measured collapsed grid edge. */
3
+ export interface TableBorderCandidate {
4
+ /** Horizontal or vertical source-coordinate grid line. */
5
+ direction: 'horizontal' | 'vertical';
6
+ /** Fixed grid coordinate perpendicular to the edge. */
7
+ position: number;
8
+ /** Inclusive coordinate along the edge. */
9
+ start: number;
10
+ /** Exclusive coordinate along the edge. */
11
+ end: number;
12
+ /** Computed thickness; hidden borders retain priority even when their computed width is zero. */
13
+ width: number;
14
+ /** Supported CSS border style; hidden suppresses every competing border. */
15
+ style: 'solid' | 'none' | 'hidden';
16
+ /** Browser-resolved color of this candidate. */
17
+ color: string;
18
+ /** Cells outrank the table when equally wide solid borders compete. */
19
+ owner: 'cell' | 'table';
20
+ /** Owner's top grid coordinate, used for the upper-cell tie break. */
21
+ row: number;
22
+ /** Owner's left grid coordinate, used for the left-cell tie break in LTR tables. */
23
+ column: number;
24
+ }
25
+ /** Native border paint and replay limits for one measured collapsed table. */
26
+ export interface CollapsedTablePaint {
27
+ /** Nonoverlapping final fills in border conflict priority order. */
28
+ operations: BorderOperation[];
29
+ /** Header grid bounds expanded through the outer top, left and right half-borders. */
30
+ headerBounds?: Bounds;
31
+ /** Continuations can reuse half-boundaries only when their horizontal winners agree. */
32
+ repeatSafe: boolean;
33
+ }
34
+ /** Resolve pure measured-border inputs without depending on browser or PDF globals.
35
+ * @param candidates Competing authored borders with already measured grid coordinates.
36
+ */
37
+ export declare function resolveCollapsedBorders(candidates: readonly TableBorderCandidate[]): BorderOperation[];
38
+ /** Find native HTML table parts whose borders participate in one collapsed grid.
39
+ * @param element Current element from the existing static layout traversal.
40
+ * @param style Already computed style for this element.
41
+ */
42
+ export declare function collapsedTableOwner(element: HTMLElement, style: CSSStyleDeclaration): HTMLTableElement | undefined;
43
+ /** Enforce the deliberately bounded collapsed-border contributions before native box emission.
44
+ * @param element Native table part whose sides will be resolved together after its cells.
45
+ * @param style Browser-computed authored sides, independent of the winning shared border.
46
+ */
47
+ export declare function validateCollapsedTablePart(element: HTMLElement, style: CSSStyleDeclaration): void;
48
+ /** Measure cell centerlines and resolve the native table's single border paint layer.
49
+ * @param table Connected native collapsed table with existing browser-calculated column widths.
50
+ * @param origin Source root rectangle defining the shared CSS pixel coordinate system.
51
+ */
52
+ export declare function measureCollapsedTableBorders(table: HTMLTableElement, origin: DOMRect): CollapsedTablePaint;
package/dist/text.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ import { PDFHexString } from 'pdf-lib';
2
+ import type { PDFDocument, PDFFont } from 'pdf-lib';
3
+ /** One encoded glyph at its shaped origin, in unscaled font units. */
4
+ export interface PositionedGlyph {
5
+ /** Authoritative PDF encoding returned by the public font adapter. */
6
+ encoded: PDFHexString;
7
+ /** Horizontal pen position including the font's placement offset. */
8
+ x: number;
9
+ /** Vertical pen position including the font's placement offset, positive upward. */
10
+ y: number;
11
+ }
12
+ /** Reusable shaping state for one exact static font during a single export. */
13
+ export declare class PositionedFont {
14
+ readonly font: PDFFont;
15
+ /** Original font metrics and OpenType positioning owned by this export. */
16
+ private readonly program;
17
+ /** Identical words share shaping work without sharing browser coordinates. */
18
+ private readonly words;
19
+ /** Used glyph mappings include GSUB ligatures without Unicode cmap entries. */
20
+ private readonly unicode;
21
+ /** Used substituted glyphs also need nominal PDF widths even without cmap entries. */
22
+ private readonly widths;
23
+ /** Font units per em, used to convert shaped origins without stretching outlines. */
24
+ readonly unitsPerEm: number;
25
+ /** Own a shaper matching the font program embedded through pdf-lib.
26
+ * @param font Public PDF font whose encoding remains authoritative.
27
+ * @param bytes Exact registered program shared with browser layout.
28
+ */
29
+ constructor(font: PDFFont, bytes: Uint8Array);
30
+ /** Shape one browser-measured word while retaining kerning, ligatures and marks.
31
+ * @param text Complete word; splitting into characters would lose OpenType context.
32
+ * @param kerning Whether CSS admits kerning for this line.
33
+ */
34
+ shape(text: string, kerning?: boolean): readonly PositionedGlyph[];
35
+ /** Measure shaped advance and ink extents so repeated page text cannot overflow its band.
36
+ * @param text Complete single line using this exact embedded font.
37
+ */
38
+ measure(text: string): {
39
+ left: number;
40
+ right: number;
41
+ ascent: number;
42
+ descent: number;
43
+ };
44
+ /** Preserve extraction for every used shaped glyph, including uncoded ligatures.
45
+ * @param document Export document owning the public font reference and object context.
46
+ */
47
+ embedUnicode(document: PDFDocument): Promise<void>;
48
+ }
package/dist/tiff.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ /** A single unrotated TIFF raster; the PDF writer applies its explicit orientation matrix. */
2
+ export interface TiffFrame {
3
+ /** Original stored columns, before orientation. */
4
+ width: number;
5
+ /** Original stored rows, before orientation. */
6
+ height: number;
7
+ /** Straight-alpha eight-bit RGBA pixels owned by this decode. */
8
+ rgba: Uint8Array;
9
+ /** TIFF orientation in the inclusive range one through eight. */
10
+ orientation: number;
11
+ }
12
+ /** Bounded metadata access without retaining decoded rasters for every page. */
13
+ export interface TiffDocument {
14
+ /** Number of image-bearing main IFDs in their original linked order. */
15
+ readonly pageCount: number;
16
+ /** Decode one requested frame; no previous frame raster is retained. */
17
+ decodeFrame(index: number): Promise<TiffFrame>;
18
+ }
19
+ /** Open only metadata first; decode requested scan frames individually through public UTIF APIs.
20
+ * @param input Complete caller-owned TIFF bytes; the adapter keeps an independent encoded copy.
21
+ * @param signal Cooperative cancellation before metadata work and each synchronous frame decode.
22
+ */
23
+ export declare function openTiff(input: Uint8Array, signal?: AbortSignal): Promise<TiffDocument>;
@@ -0,0 +1,122 @@
1
+ import type { RenderWarning } from './diagnostics.js';
2
+ /** A rectangle relative to the source root, measured in CSS pixels. */
3
+ export interface Bounds {
4
+ /** Horizontal distance from the root's left edge. */
5
+ x: number;
6
+ /** Vertical distance from the root's top edge. */
7
+ y: number;
8
+ /** Browser-measured width. */
9
+ width: number;
10
+ /** Browser-measured height. */
11
+ height: number;
12
+ }
13
+ /** A browser-measured line of selectable text. */
14
+ export interface TextOperation {
15
+ /** Discriminant for ordered paint dispatch. */
16
+ kind: 'text';
17
+ /** Line fragment bounds in root CSS pixels. */
18
+ bounds: Bounds;
19
+ /** Browser-resolved visible text for this line. */
20
+ text: string;
21
+ /** Browser-measured words retain native origins without accumulating run-width drift. */
22
+ runs: {
23
+ /** Word text, retaining ligatures and non-breaking spaces within each run. */
24
+ text: string;
25
+ /** Horizontal word origin relative to the source root, in CSS pixels. */
26
+ x: number;
27
+ /** Browser-measured word advance width in CSS pixels. */
28
+ width: number;
29
+ }[];
30
+ /** Baseline position relative to the root's top edge. */
31
+ baseline: number;
32
+ /** CSS font size in pixels. */
33
+ fontSize: number;
34
+ /** Exact registered family selected by the browser-facing font contract. */
35
+ family: string;
36
+ /** Registered face weight. */
37
+ weight: number;
38
+ /** Registered face style. */
39
+ style: 'normal' | 'italic';
40
+ /** Disable OpenType kerning when the browser explicitly selects font-kerning: none. */
41
+ kerning?: boolean;
42
+ /** Computed CSS rgb/rgba text color. */
43
+ color: string;
44
+ /** True for extraction-only text inside a raster subtree. */
45
+ invisible: boolean;
46
+ }
47
+ /** A supported axis-aligned box painted by native PDF operations. */
48
+ export interface BoxOperation {
49
+ /** Discriminant for ordered paint dispatch. */
50
+ kind: 'box';
51
+ /** Border-box geometry in root CSS pixels. */
52
+ bounds: Bounds;
53
+ /** Computed solid background. */
54
+ background: string;
55
+ /** Uniform border color. */
56
+ borderColor: string;
57
+ /** Uniform border width in CSS pixels. */
58
+ borderWidth: number;
59
+ }
60
+ /** One disjoint solid fill belonging to a resolved collapsed table border. */
61
+ export interface BorderOperation {
62
+ /** Discriminant for native filled-border dispatch. */
63
+ kind: 'border';
64
+ /** Actual positive painted rectangle, including the half-width outside its grid line. */
65
+ bounds: Bounds;
66
+ /** Browser-computed winning border color, including any alpha component. */
67
+ color: string;
68
+ /** Winning CSS border thickness before crossing rectangles are partitioned. */
69
+ width: number;
70
+ /** Grid direction retained independently of the final clipped fill rectangle. */
71
+ direction: 'horizontal' | 'vertical';
72
+ }
73
+ /** An explicitly isolated DOM subtree captured at its paint-order position. */
74
+ export interface RasterOperation {
75
+ /** Discriminant for ordered paint dispatch. */
76
+ kind: 'raster';
77
+ /** Region in root CSS pixels; effects must stay within this box. */
78
+ bounds: Bounds;
79
+ /** Live source used only by the browser capture adapter. */
80
+ element: HTMLElement;
81
+ }
82
+ /** An image source embedded once as a PDF image object. */
83
+ export interface ImageOperation {
84
+ /** Discriminant for ordered paint dispatch. */
85
+ kind: 'image';
86
+ /** Browser-measured image border box. */
87
+ bounds: Bounds;
88
+ /** Decoded image source; experiment fixtures use self-contained PNGs. */
89
+ element: HTMLImageElement;
90
+ }
91
+ /** A flattened, ordered experiment display list, not a general CSS paint tree. */
92
+ export type PaintOperation = TextOperation | BoxOperation | BorderOperation | RasterOperation | ImageOperation;
93
+ /** Native table header replayed above each continuation interval without changing source geometry. */
94
+ export interface TableHeader {
95
+ /** Original THEAD border box in source CSS pixels. */
96
+ bounds: Bounds;
97
+ /** First visible body row top; the gap after THEAD belongs to every repeated header. */
98
+ bodyStart: number;
99
+ /** Last visible body row bottom, excluding any TFOOT. */
100
+ bodyEnd: number;
101
+ /** Original paint references, including ancestor boxes clipped to the header band by the writer. */
102
+ operations: PaintOperation[];
103
+ }
104
+ /** Immutable geometry metadata plus a bounded list of ordered paint operations. */
105
+ export interface LayoutSnapshot {
106
+ /** Measured root width in CSS pixels. */
107
+ width: number;
108
+ /** Measured root height in CSS pixels. */
109
+ height: number;
110
+ /** Operations in the supported static DOM paint order. */
111
+ operations: PaintOperation[];
112
+ /** Explicitly diagnosed approximations and unsupported behavior. */
113
+ warnings: RenderWarning[];
114
+ /** Indivisible browser-measured table rows and spanning cells, in root CSS pixels. */
115
+ atomicBounds?: Bounds[];
116
+ /** Forced CSS page boundaries in source coordinates; zero/end boundaries create no empty pages. */
117
+ forcedBreaks?: number[];
118
+ /** Preferred indivisible blocks; oversized preferences may relax with an explicit warning. */
119
+ avoidBreakBounds?: Bounds[];
120
+ /** Explicitly requested native THEAD repetitions for nonoverlapping tables. */
121
+ tableHeaders?: TableHeader[];
122
+ }
package/package.json CHANGED
@@ -1,6 +1,81 @@
1
1
  {
2
2
  "name": "renderpdf-js",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Browser-side HTML and image to PDF renderer with explicit fonts, local rasters and multipage TIFF",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/MichalekJan93/renderPDF.js.git"
9
+ },
10
+ "homepage": "https://github.com/MichalekJan93/renderPDF.js#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/MichalekJan93/renderPDF.js/issues"
13
+ },
14
+ "keywords": [
15
+ "pdf",
16
+ "html",
17
+ "browser",
18
+ "typescript",
19
+ "html-to-pdf",
20
+ "image-to-pdf",
21
+ "tiff-to-pdf"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "registry": "https://registry.npmjs.org/"
26
+ },
27
+ "type": "module",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ }
33
+ },
34
+ "types": "./dist/index.d.ts",
35
+ "sideEffects": false,
36
+ "files": [
37
+ "dist/index.js",
38
+ "dist/*.d.ts",
39
+ "README.md",
40
+ "LICENSE",
41
+ "assets/renderpdf-logo.png"
42
+ ],
43
+ "engines": {
44
+ "node": ">=22.13.0"
45
+ },
46
+ "scripts": {
47
+ "dev": "vp dev --host 127.0.0.1",
48
+ "build": "npm run build:library",
49
+ "build:library": "npm run typecheck && vp build --config vite.library.config.ts && tsc -p tsconfig.build.json",
50
+ "prepack": "npm run build:library && npm run check:package",
51
+ "check:package": "node scripts/check-package.ts",
52
+ "typecheck": "vp check --no-fmt --no-lint",
53
+ "test": "vp test",
54
+ "test:browser": "playwright test",
55
+ "benchmark": "npm run build:library && playwright test --config playwright.benchmark.config.ts",
56
+ "lint": "vp lint",
57
+ "format": "vp fmt",
58
+ "format:check": "vp fmt --check",
59
+ "check": "vp check && npm test && npm run test:browser && npm run build && npm run check:package"
60
+ },
61
+ "dependencies": {
62
+ "@pdf-lib/fontkit": "^1.1.1",
63
+ "html-to-image": "^1.11.13",
64
+ "pdf-lib": "^1.17.1",
65
+ "utif2": "4.1.0"
66
+ },
67
+ "devDependencies": {
68
+ "@playwright/test": "^1.64.1",
69
+ "@types/node": "^26.6.5",
70
+ "@types/pngjs": "^6.0.5",
71
+ "pdfjs-dist": "^6.4.299",
72
+ "pixelmatch": "^8.0.0",
73
+ "pngjs": "^7.0.0",
74
+ "typescript": "^6.0.3",
75
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
76
+ "vite-plus": "1.4.0"
77
+ },
78
+ "overrides": {
79
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0"
80
+ }
81
+ }