afpp
Version:
Async Fast PDF Parser for Node.js — dependency-light, TypeScript-first, production-ready.
22 lines • 897 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.pdf2image = void 0;
const core_1 = require("./core");
/**
* Converts a PDF file from various input formats (Buffer, Uint8Array, string path, or URL) to an array of image buffers.
*
* @async
* @function pdf2image
*
* @param {Buffer|Uint8Array|string|URL} input - The PDF source, which can be a file path, URL, Buffer, or Uint8Array.
* @param {AfppParseOptions} [options] - Optional parsing options for customizing the PDF parsing process.
*
* @since v1.0.0
*
* @returns {Promise<Buffer[]>} - A promise that resolves to an array of image buffers.
*
* @throws {Error} Throws an error if the input type is invalid.
*/
const pdf2image = async (input, options) => (0, core_1.parsePdfFile)(core_1.PROCESSING_TYPE.IMAGE, input, options);
exports.pdf2image = pdf2image;
//# sourceMappingURL=pdf2image.js.map