renderpdf-js 0.1.0 → 0.2.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.
@@ -0,0 +1,19 @@
1
+ /** Validated native bitmap geometry; orientation transforms are applied by the PDF adapter. */
2
+ export interface BitmapInfo {
3
+ /** Actual compressed format, independent of the filename and MIME type. */
4
+ format: 'png' | 'jpeg';
5
+ /** Encoded pixel width before EXIF rotation. */
6
+ width: number;
7
+ /** Encoded pixel height before EXIF rotation. */
8
+ height: number;
9
+ /** Standard EXIF orientation, defaulting to one when absent. */
10
+ orientation: number;
11
+ }
12
+ /** Inspect PNG/JPEG bytes without a DOM, mutation, implicit file-type guessing or pixel allocation. */
13
+ export declare function inspectBitmap(bytes: Uint8Array): BitmapInfo;
14
+ /** Validate PNG's complete zlib stream and row layout before pdf-lib's permissive raw inflater. */
15
+ export declare function validatePngData(
16
+ /** Owned PNG bytes; filenames and MIME types never establish their validity. */
17
+ bytes: Uint8Array,
18
+ /** Optional cancellation released together with the native reader. */
19
+ signal?: AbortSignal): Promise<void>;
@@ -0,0 +1,7 @@
1
+ import type { ImagePDFOptions, ImageSource, RenderPDFResult } from './api-types.js';
2
+ /** Convert one standalone PNG/JPEG or every main TIFF frame to an immutable PDF result. */
3
+ export declare function imageToPDF(
4
+ /** Complete image bytes or browser File/Blob; filenames and MIME types do not determine decoding. */
5
+ source: ImageSource,
6
+ /** Shared paper settings, metadata, cancellation and optional stage-local progress. */
7
+ options?: ImagePDFOptions): Promise<RenderPDFResult>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { renderPDF } from './render-pdf.js';
2
+ export { imageToPDF } from './image-pdf.js';
2
3
  export { registerFont } from './fonts.js';
3
4
  export { RenderPDFError } from './diagnostics.js';
4
5
  export type { RenderErrorCode, RenderWarning } from './diagnostics.js';
5
- export type { FontSource, RegisteredFont, PageMargins, CustomPageSize, RenderPDFOptions, RenderPDFResult, } from './api-types.js';
6
+ export type { FontSource, RegisteredFont, PageMargins, PDFPageOptions, ImageSource, ImagePDFOptions, CustomPageSize, PageTextOptions, PDFMetadata, RenderStage, RenderProgress, RenderPDFOptions, RenderPDFResult, } from './api-types.js';