Skip to content
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Convert PDF to Image

Overview

ComPDF Conversion SDK provides an API for converting PDFs to images.

Supported image formats include JPG, JPEG, JPEG2000, PNG, BMP, TIFF, TGA, GIF, and WEBP.

Sample

js
const ImageType = {
  JPG: 0,
  JPEG: 1,
  JPEG2000: 2,
  PNG: 3,
  BMP: 4,
  TIFF: 5,
  TGA: 6,
  GIF: 7,
  WEBP: 8
};

const options = {
  imageType: ImageType.PNG,
  imageColorMode: 0,
  imageScaling: 1.0
};

const result = sdk.startPDFToImage(
  inputFilePath,
  "",
  outputDirectory,
  options
);