evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A service that generates base64-encoded thumbnail images from PDF documents for embedding in web APIs and HTML.
/**
* Converts a PDF page to a base64-encoded image string
*
* @param {string} pdfPath - Path to the PDF file
* @param {number} pageNumber - Page number to convert (1-indexed)
* @param {object} options - Configuration options
* @param {number} options.width - Desired image width in pixels
* @param {boolean} options.preserveAspectRatio - Whether to maintain aspect ratio
* @returns {Promise<string>} Base64-encoded image string
*/
async function convertToBase64(pdfPath, pageNumber, options);
/**
* Converts multiple PDF pages to base64-encoded images
*
* @param {string} pdfPath - Path to the PDF file
* @param {number[]} pages - Array of page numbers to convert
* @param {object} options - Configuration options
* @returns {Promise<Array<{page: number, base64: string}>>} Array of base64 results
*/
async function convertMultipleToBase64(pdfPath, pages, options);
module.exports = {
convertToBase64,
convertMultipleToBase64
};Provides PDF to image conversion with base64 output support.