CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-pdf2pic

A utility for converting pdf to image formats with support for different outputs: directly to file, base64 or buffer.

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-8/

PDF Bulk Converter

A utility that converts all pages of a PDF document to image files without needing to know the total page count in advance.

Capabilities

Complete PDF Conversion

Converts an entire PDF document to individual image files, automatically detecting the total number of pages.

  • Given a PDF file path "./sample.pdf" with 3 pages, converts all pages to PNG images and returns an array with 3 results @test
  • Given a PDF file with 1 page, converts to a single image and returns an array with 1 result @test
  • Each result in the array includes the page number, filename, file path, and image dimensions @test

Implementation

@generates

API

/**
 * Converts all pages of a PDF document to image files.
 *
 * @param {string} pdfPath - The path to the PDF file to convert
 * @param {Object} options - Configuration options
 * @param {string} options.format - Output image format (default: 'png')
 * @param {string} options.savePath - Directory to save images (default: './')
 * @param {string} options.saveFilename - Base filename for output images (default: 'page')
 * @returns {Promise<Array>} Array of conversion results, one per page
 */
async function convertAllPages(pdfPath, options = {});

module.exports = { convertAllPages };

Dependencies { .dependencies }

pdf2pic { .dependency }

Provides PDF to image conversion capabilities with bulk page processing support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-pdf2pic

tile.json