pdf-to-png-converter
Version:
Node.js utility to convert PDF file/buffer pages to PNG files/buffers. No build-time compilation required — pre-built native binaries included for all major platforms.
20 lines (19 loc) • 936 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.pdfToPng = pdfToPng;
const normalizePdfToPngOptions_js_1 = require("./normalizePdfToPngOptions.js");
const pdfToPngCore_js_1 = require("./pdfToPngCore.js");
/**
* Convert PDF pages to PNG buffers and/or files.
*
* Sole public entry point. Validates and defaults `props` via `normalizePdfToPngOptions`,
* then delegates to the internal `pdfToPngCore`. The CLI calls `pdfToPngCore` directly
* with its own already-normalized options to avoid double validation.
*
* @param pdfFile - PDF file path (string), `ArrayBufferLike`, or `Uint8Array`.
* @param props - Optional caller-facing options; see {@link PdfToPngOptions}.
* @returns One `PngPageOutput` per processed page.
*/
async function pdfToPng(pdfFile, props) {
return (0, pdfToPngCore_js_1.pdfToPngCore)(pdfFile, (0, normalizePdfToPngOptions_js_1.normalizePdfToPngOptions)(props));
}