October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Convert PDF Pages to Images with PHP

Use PHP Imagick to render PDF pages as images, with practical setup checks for Ghostscript, page selection, resolution, output formats, security, and errors.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use PHP’s Imagick extension to read a PDF as an image sequence and write its pages as image files. The essential steps are to ensure ImageMagick can use Ghostscript to read PDFs, set any desired raster resolution before loading the document, and write each page separately. The example below is a starting point: output naming and PDF support depend on the ImageMagick build and security policy installed on your host.

Convert every PDF page with Imagick

Imagick exposes ImageMagick to PHP. Its readImage() method reads a file, and the PHP manual includes a user-contributed example that writes an image sequence with writeImages(). In practice, test the output filenames with your installed version rather than assuming a particular naming convention.

<?php
$pdfPath = __DIR__ . '/input.pdf';
$outputPattern = __DIR__ . '/output/page.jpg';

$pages = new Imagick();

try {
    // Optional: set raster density before reading, based on your output needs.
    // $pages->setResolution(150, 150);

    $pages->readImage($pdfPath);
    $pages->writeImages($outputPattern, false);
} finally {
    $pages->clear();
    $pages->destroy();
}
?>

Create the output directory first and ensure the PHP process can write to it. The second argument to writeImages() is false for sequence output rather than combining the sequence into one file. The manual’s example uses writeImages('converted.jpg', false) for all pages; inspect the generated names on your stack and adjust the output pattern if needed.

Check PDF support in the PHP runtime

Installing the PHP extension alone does not establish that the server can decode PDFs. Imagick relies on ImageMagick, and ImageMagick documents that PDF reading requires Ghostscript. ImageMagick’s security policy may also intentionally deny PDF interpretation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images
  • Confirm Imagick is loaded in the same runtime that will perform conversion: PHP-FPM, a queue worker, or another service may differ from command-line PHP.
  • Confirm ImageMagick can locate a working Ghostscript delegate and is configured to read PDFs.
  • Check the effective ImageMagick policy for coder or delegate restrictions before changing it. A denial may be deliberate rather than a broken installation.
  • Confirm the output directory is writable and has enough space for the expected page images.
  • Bound document page count, page dimensions, and requested raster density for the workload.

The available documentation does not establish one compatibility matrix covering every operating system, PHP version, ImageMagick build, and Ghostscript release. Pin and verify the versions used in your deployment rather than assuming that an example from another environment will work.

Select pages, resolution, and output format

Convert selected pages

Imagick supports page selectors in filenames. A user-contributed note on the PHP manual demonstrates a zero-based selector such as test.pdf[0]. Since this detail is shown in a note rather than the formal method description, validate the selector syntax and page indexing with your installed versions before relying on it.

Rank #2
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner
  • PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
  • QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
  • VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
  • INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
  • EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0

Choose raster density for the use case

Higher resolution creates larger pixel dimensions and generally increases memory use, CPU time, and output storage. Set resolution before reading the PDF when you need to control rendered quality, then test representative documents. A thumbnail, on-screen preview, OCR input, and print asset may need different densities; the documentation does not prescribe a universal DPI.

Choose an image format

  • JPEG: often suitable for photographic or compact previews, but it is lossy and does not preserve transparency.
  • PNG: lossless and can preserve transparency where applicable, usually with a different storage trade-off.

If the source has transparency and the selected output cannot preserve it, decide whether to flatten onto a background and inspect the results. Format and background are application choices, not fixed conversion requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
  • READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
  • WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
  • OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)

Or skip the browser setup

ScreenshotNeo captures web pages; it does not convert an existing PDF into page images. If what you actually need is an image of a webpage, its one-call API is:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response includes page-verdict and billing headers. Its MCP server provides screenshot tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Those are webpage-capture features, not PDF rasterization features.

Sign up for ScreenshotNeo’s free plan to try webpage screenshots with 1,000 shots a month and no card.

Rank #4
Sale
Epson Workforce ES-400 II High-Speed Color Duplex Desktop Document Scanner
  • FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
  • INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
  • SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
  • EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
  • SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning

Protect conversion jobs and control resource use

PDF conversion processes complex input and may invoke an external delegate. ImageMagick’s security policy describes restrictions for coders, modules, delegates, and resource use, including controls for memory and image-sequence length. The Imagick project also recommends restricting the files and system resources available to scripts using Imagick, while noting that its guidance is not a security guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • For uploaded PDFs, enforce file-size, page-count, dimension, and processing-time limits that fit your service.
  • Run conversion with least privilege and consider isolating workers from the rest of the application.
  • Do not broadly enable PDF reading or external delegates without assessing the exposure for your environment.
  • Generate output filenames on the server instead of using client-provided names as paths.
  • Store temporary files outside executable locations, clean them up after jobs, and handle exceptions.

These are operational precautions based on the documented parser, delegate, and resource-control risks; the cited documentation is not a complete application security design.

Best Value
Sale
ScanSnap iX1300 Wireless or USB Double-Sided Color Document Scanner, Black
  • FITS SMALL SPACES AND STAYS OUT OF THE WAY. Innovative space-saving design to free up desk space, even when it's being used
  • SCAN DOCUMENTS, PHOTOS, CARDS, AND MORE. Handles most document types, including thick items and plastic cards. Exclusive QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
  • GREAT IMAGES EVERY TIME, NO EXPERIENCE REQUIRED. A single touch starts fast, up to 30ppm duplex scanning with automatic de-skew, color optimization, and blank page removal for outstanding results without driver setup
  • SCAN WHERE YOU WANT, WHEN YOU WANT. Connect with USB or Wi-Fi. Send to Mac, PC, mobile devices, and cloud services. Scan to Chromebook using the mobile app. Can be used without a computer
  • PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. ScanSnap Home all-in-one software brings together all your favorite functions. Easily manage, edit, and use scanned data from documents, receipts, business cards, photos, and more
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common conversion failures

Symptom Likely cause What to check
Imagick class or method is unavailable The Imagick extension is missing or not loaded in the PHP runtime executing the job. Check the extension in PHP-FPM or the worker itself, not only in CLI PHP; install or enable it for the relevant SAPI and restart that service as required by its deployment.
PDF read is denied or reports no decode delegate Ghostscript may be missing or unreachable, or ImageMagick policy may prohibit PDF reading. Verify the Ghostscript delegate in the application environment and inspect the effective ImageMagick policy. Do not remove a restriction without reviewing its security purpose.
Only one output appears, or filenames differ from expectations Sequence-writing behavior and generated names may vary with the installed build and chosen output path. Check that writeImages() receives false for sequence output; run a small multi-page test and inspect the actual files before changing the production naming logic.
Output is blurry or unexpectedly huge Raster density and source page dimensions determine pixel dimensions and resource demands. Set resolution before reading, choose it for the intended use, and compare quality and file size on representative PDFs.
Conversion runs out of memory, storage, or time A document may have many pages or unusually large dimensions, or the job may be unconstrained. Bound page count and dimensions, set policy resource limits, cap job duration, and process large workloads in isolated workers where practical.
Output has an unexpected background The output format may not preserve the source transparency. Choose a transparency-capable format or define and verify the intended flattening background.

When a PHP wrapper or another renderer makes sense

Wrappers can make application code more convenient, but they do not necessarily remove the underlying renderer dependency.

Option What it offers Dependency or caveat
Spatie pdf-to-image A PHP wrapper with page-saving workflows. It uses ImageMagick; its documentation identifies PDF security policy as a possible reason reading is denied. Review current release information and compatibility before adopting it.
Pop PHP PDF Pdf::extractAsImages() produces standalone image files, one per page. The documented feature requires Imagick, so it is a higher-level route over the same dependency.
Poppler command-line tools An alternative PDF rendering family to evaluate. The available evidence does not establish a complete official PHP integration workflow or a controlled comparison against Imagick.

Choose based on dependencies available in your target container, page selection and output controls, security boundaries, PHP compatibility and maintenance, and measured throughput, memory, temporary storage, and fidelity on your own representative PDFs. No comparative benchmark establishes a universal performance or security winner.

Frequently Asked Questions

Does Imagick convert a multipage PDF into one image or one image per page?

With sequence writing, the intent is separate page images; confirm the exact generated filenames with a small test on your installed ImageMagick version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use ScreenshotNeo to turn a PDF file into images?

No. ScreenshotNeo captures webpages; the PHP Imagick workflow in this article is for rasterizing an existing PDF.

Quick Recap

Bestseller No. 1
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Scanner type: Document; Connectivity technology: USB; With Auto Scan Mode, the scanner automatically detects what you're scanning
$75.00

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.