UNPKG

ppu-pdf

Version:

Easily extract text from digital PDF files with coordinate and font size included, and optionally group text by lines or render scanned pdf to canvas/png.

35 lines (34 loc) 1.25 kB
import { Canvas, type SKRSContext2D } from "@napi-rs/canvas"; /** * Factory class for creating and managing Node.js canvases using @napi-rs/canvas. */ export declare class NodeCanvasFactory { /** * Creates a new canvas with the specified dimensions. * @param width - The width of the canvas. * @param height - The height of the canvas. * @returns An object containing the created canvas and its 2D rendering context. */ create(width: number, height: number): { canvas: Canvas; context: SKRSContext2D; }; /** * Resets the given canvas to new dimensions. * @param canvasAndContext - The canvas object containing the canvas and its context. * @param width - The new width of the canvas. * @param height - The new height of the canvas. */ reset(canvasAndContext: { canvas: Canvas; context: SKRSContext2D; }, width: number, height: number): void; /** * Destroys the given canvas by clearing its dimensions and references. * @param canvasAndContext - The canvas object containing the canvas and its context. */ destroy(canvasAndContext: { canvas: Canvas | null; context: SKRSContext2D | null; }): void; }