API Freaks logoAPI Freaks logo
CTRL+K

    APIs

  • Pricing
  • Resources
  • Tools

  • Contact us
CTRL+K
Sign InGet Started For Free
  • Overview
  • Documentation
  • How to Guides
  • Pricing
  • APIFreaks
  • Organization and Teams
  • Credits Usage API
  • IP Geolocation Lookup
  • Bulk IP Geolocation Lookup
  • Domain WHOIS Lookup
  • IP WHOIS Lookup
  • ASN Lookup
  • Domain WHOIS Historical Lookup
  • Domain WHOIS Reverse Lookup
  • Bulk Domain WHOIS Lookup
  • DNS Lookup
  • Historical DNS Lookup
  • Reverse DNS Lookup
  • Bulk DNS Lookup
  • Email Checker API
  • SSL Certificate Lookup
  • Domain Availability
  • Bulk Domain Availability API
  • Website Screenshot
  • Bulk Screenshot
  • PDF Merge
  • PDF Delete Pages
  • PDF Split & Extract Pages
  • PDF Rotate
  • PDF Compress
  • PDF Linearize
  • PDF Protect
  • PDF Unlock
  • PDF to Image
  • Currencies Exchange Rates
  • Currency Converter
  • Currency Time Series
  • Currency Fluctuation
  • Geolocalized Currency Converter
  • Live Commodity Prices
  • Commodity Historical Prices
  • Commodity Fluctuation
  • Commodity Time Series
  • IBAN Validation
  • SWIFT/BIC Code Lookup & Finder
  • ZIP Code API
  • ZIP Code Search Inside Radius
  • ZIP Code Distance API
  • ZIP Code Search By City
  • Live Weather API
  • Weather Forecast API
  • Historical Weather API
  • Air Quality API
  • Marine Weather API
  • Flood Forecast API
  • Timezone Lookup
  • Timezone Converter
  • User Agent Parser
  • Bulk User Agent Parser
  • Astronomy API

PDF to Image APIs - Convert PDF to JPG, PNG, TIFF, BMP & GIF

Transform PDF documents into high-quality images with our comprehensive PDF to Image conversion APIs. Convert PDFs to JPG, PNG, TIFF, BMP, and GIF formats with precise control over resolution, color profiles, and page selection. Whether you need to generate thumbnails for document previews, create high-resolution images for print workflows, or extract specific PDF pages as images for web display, our APIs handle it all with exceptional speed and reliability.

Set resolution from 20 to 1200 DPI, choose from multiple color profiles including grayscale, RGB, RGBA, CMYK, and specialized formats like 1-bit black & white, convert specific page ranges, and handle files up to 1GB in size. Select exactly which pages to convert using flexible syntax, apply image smoothing for enhanced quality, and control color profiles for optimal file sizes.

Perfect for document management systems generating preview images, publishing platforms creating thumbnails, archival services digitizing records, e-learning applications displaying course materials, and SaaS applications requiring on-demand PDF page rendering. With asynchronous request processing and webhook support, you can seamlessly integrate PDF to image conversion into your automation workflows.

10K Free Credits, No Credit Card Required

Features

Multiple Image Format Support

Convert PDFs to five popular image formats: PNG, JPG, TIFF, BMP, and GIF. Each format is optimized for different workflows, from web thumbnails and transparent graphics to professional print preparation and legacy system compatibility.

Flexible Resolution Control

Configure output resolution from 20 to 1200 DPI to meet any quality requirement. Whether you're optimizing for web performance, archival storage, or high-resolution print production, precise DPI control ensures your images match your exact specifications.

Advanced Compression Control

Balance image quality against file size with granular compression settings. JPG quality levels from 1-100, indexed color palettes for reduced file sizes, and format-specific optimizations give you complete control over output characteristics without sacrificing visual fidelity.

Versatile Color Profiles

Support for multiple color spaces including monochrome, grayscale, RGB, RGBA with transparency, and CMYK for print. Select the optimal color profile based on your output medium and file size requirements.

Professional Print Support

Convert PDFs with specialized color spaces for professional workflows. Support for CMYK print-ready output and indexed color palettes (4-bit, 8-bit) for optimized file sizes without compromising visual quality.

Granular Page Selection

Extract specific pages, ranges, or entire documents with flexible selection syntax. Support for individual pages, continuous ranges, combined selections, and special keywords like "odd", "even", "last", and "all" for precise control over conversion output.

Anti-Aliasing Support

Enhance output quality with configurable anti-aliasing controls. Apply smoothing globally or selectively to text, lines, and images to eliminate jagged edges and improve visual clarity while maintaining processing speed and file efficiency.

Asynchronous Processing

Upon successful request, our API immediately returns a 200 OK response with a unique Task ID, processing your file in the background. You can track the task progress via our Task Status API using the unique Task ID.

Webhook Notifications

If you don't want to poll for task status, you can simply provide the webhook data in your request. Instead of manually checking status, we will automatically notify your endpoint the moment the task processing is completed.

Zero Data Retention

Your privacy matters. When you set the destroy parameter, your files are permanently wiped from our servers immediately after processing finishes, ensuring complete data security. If destroy is not set, files are retained up to 30 days based on user's plan.

Large File Support

Handle heavy documents and high-resolution assets with ease. Our API supports a massive 1GB payload size per request, allowing you to process even the largest PDF files without worrying about size restrictions.

Note: The output zip file and task status is only retained up to a 1 day at max for PDF to Image APIs

Documentation

API Endpoints

Select an image format to view its specific endpoint, parameters, and examples:

API Endpoint

POST

https://api.apifreaks.com/v1.0/pdf/jpg

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
JavaScript
C#
$ pip install requests

API Request

All PDF to image endpoints accept the same common parameters with additional format-specific controls for color profiles and quality.

File Upload

File uploads must use multipart/form-data format. PDF API accepts a single file upload.

ParameterRequiredTypeDefaultDescription
fileNomultipart/form-data-The PDF file to process. Only used if you're uploading a file instead of using file_id.

Input Priority Rule:

If both file and file_id are provided, the multipart file upload takes priority and file_id is ignored.

Common Query Parameters

These parameters are supported by all PDF to image endpoints. All parameters must be included as query parameters.

ParameterRequiredTypeDefaultDescription
file_idNoString-The unique ID of a PDF file already present on our server. Use this instead of uploading the file again.
outputNoStringpdf_to_{format}Name of the output zip file (without extension) containing all generated images. Format can either be png, jpg, tif, bmp or gif.
destroyNoBooleanfalseIf true, we delete the input file immediately after generating the output images.
resolutionNoint150 (100 for GIF)Output image resolution in DPI. Acceptable range: 20 to 1200. Higher values produce sharper images but larger file sizes. Default value for pdf to gif is 100.
image_smoothingNoStringnoneAnti-aliasing options to apply during conversion. Valid values: none, all, or comma-separated combination of text, line, and image (e.g., "text,line").
pagesNoStringallSpecify the pages to be converted to image format from the PDF. Provide individual page numbers and/or ascending page ranges (e.g., 1, 3-5, 7). Use commas to separate entries and hyphens for ranges. Any duplicate pages will be removed, while preserving the original page order. You may instead provide only one of the special keywords: • even — converts all even-numbered pages • odd — converts all odd-numbered pages • last — converts only the last page • all — converts all pages Examples: ✓ "1,4-2,last" ✓ "odd" ✓ "all" ✗ "1,odd" (invalid) Note: Mixing special keywords with specific pages/ranges is not allowed.

Format-Specific Parameters

PDF to JPG

Endpoint: https://api.apifreaks.com/v1.0/pdf/jpg

Best For: Photographs, small file sizes, general viewing

ParameterRequiredTypeDefaultDescription
profileNoStringrgbSpecifies the color profile for the output JPG images. Acceptable values: • gray – 8-bit grayscale. • rgb – 24-bit RGB color (default). • cmyk – 32-bit CMYK color, commonly used for print workflows.
qualityNoint70Controls JPG compression quality. Higher values yield sharper images with larger file sizes. Acceptable range: 1 to 100.

Webhook Support

Webhook Parameters

ParameterRequiredTypeDefaultDescription
webhook_urlNoString-The URL where we'll send the webhook notification after the task completes. Authentication parameters in the URL (e.g., ?auth=token123) are passed as-is.
webhook_failure_notificationNoBooleanfalseIf true, we'll send an email notification if the webhook request fails after 3 retries. The email goes to the requesting user or their org admin if user is part of an organization.

Webhook Headers

HeaderRequiredTypeDefaultDescription
X-Webhook-AuthorizationNoString-
Custom authorization header sent with the webhook request. Format: Key:Value (e.g., Authorization:Bearer token123).

API Response

Explore detailed response fields including field names, data types, requirements, and descriptions in the interactive Response Table below. For complete response documentation click here.

Utility & Resource APIs

Use these endpoints to manage files and check task status.

Task Status API

Check real-time status and retrieve input/output file ID(s) using the unique task_id. The response includes creation and expiry timestamps to help you track result availability, along with specific error details if a task fails. Results are retained for up to 7 days, depending on the operation.
Try Task Status API

File Status API

Retrieve detailed metadata for any file using its unique file_id. Returns details including file name, size, type, and creation/deletion timestamps. Generated or uploaded files are retained up to 30 days based on user's plan, unless destroy is enabled to delete them immediately. You can use this endpoint to check if the file has expired using its file_id.
Try File Status API

File Download API

Download any file from API Freaks server using its file ID. Works for both processed PDF files and ZIP archives containing multiple output files.
Try File Download API

PDF Delete API

Permanently delete a specific file you uploaded or generated using the file ID which you no longer need.
Try PDF Delete API

Files List API

Retrieve a list of all your PDF files stored on API Freaks server, with their file names and corresponding file IDs. Organization admins and maintainers can view all files in their organization, while members see only their own.
Try Files List API

File Upload API

Upload one or multiple PDF files in a single multipart/form-data request. Each file receives a unique file_id that can be used with the PDF APIs.
Try File Upload API

Upload Binary API

Upload a single large as a raw binary stream. This method eliminates multipart boundary overhead, offering faster upload speeds for larger files. Returns a unique file_id for uses with the PDF APIs.
Try Upload Binary API

HTTP Error Codes

All PDF to Image endpoints return consistent error codes:

HTTP StatusReasons
400
Invalid PDF File: Please provide a valid PDF file. We don't support other types.
400
Missing File or ID: You must provide either a file or a file ID.
400
Invalid Parameter: The value for 'param_name' is invalid.
404
File ID Not Found: Please provide a valid file ID.
500
File Saving Exception: An unknown error occurred while saving. Try again later.
500
Internal Server Error: Internal Server Error Occurred.
400
Invalid Image Profile: Please provide a valid image profile. Refer to the documentation for valid profiles.
400
Invalid Image Smoothing: Please provide a valid smoothing option or combination. Refer to the documentation for valid options.
400
Invalid Image Resolution: Please provide a valid image resolution (DPI). Refer to the documentation for valid resolution values.
400
Invalid Image Quality: Please provide a valid image quality value from 1 to 100. (JPG only)

Task Processing Error Messages

These errors might appear in the task-status response if the background job fails.

ErrorDescription
Invalid PDF File
The provided file is not a valid PDF file.
File Saving Exception
An unknown error occurred while saving the file. Try again later.
PDF Generation Exception
An unknown error occurred while generating the PDF. Try again later.
Internal Server Error
Internal Server Error Occurred.
Invalid File ID Provided
Please provide a valid file ID.
Encrypted PDF Provided
The provided PDF file is encrypted. Please decrypt it first to perform operations.
Invalid Image Profile
Please provide a valid image profile. Refer to the documentation for valid profiles.
Invalid Page Range
One or more specified page numbers exceed the total number of pages in the PDF document.
Invalid Page Number Format
The provided page number format is invalid. Refer to the documentation for valid page number formats.

How to Guides

Optimizing Your Image Conversion

Use this quick reference to tune the API parameters for your specific needs.

  • Resolution (resolution):

    • 72 - 150 DPI: Best for standard screens and web thumbnails (fastest processing).
    • 300 DPI: Standard for high-res displays, OCR processing, and general printing.
    • 600+ DPI: Required for professional offset printing or architectural blueprints.
  • Color Profiles (profile):

    • rgb: The standard for all digital screens (Web, Mobile, Email).
    • rgba: Adds an alpha channel for transparency (Available for PNG and GIF only).
    • cmyk: Essential for commercial printing workflows (Available for TIFF and JPG).
    • bw / gray: Use bw (1-bit) for fax/archiving to get the absolute smallest file size. Use gray (8-bit) for standard black & white documents.
  • JPG Quality (quality):

    • JPG Only. Scale from 1 to 100.
    • We recommend 75-85 for a balance of sharp details and small file size. Use 90+ only for photography portfolios where size doesn't matter.
  • Image Smoothing (image_smoothing):

    • none: Default. Fastest performance.
    • text: Best for documents. Smooths jagged edges on fonts for better readability.
    • line: Best for blueprints and diagrams.
    • image: Best for PDFs containing photos.
    • all: Applies smoothing to everything. Recommended for high-quality outputs.

Converting PDFs to Images

Follow these examples to convert PDF files to images using different formats and configurations. Choose the format and settings that best match your use case.

Step 1: Convert PDF to Images

1. High-Quality Web & Display Assets (JPG & PNG)

Use these examples to generate crisp images for websites, apps, or emails.

  • JPG: Ideal for general viewing. We use quality=85 and resolution=150 for sharp text without bloating the file size.
  • PNG: Ideal for design assets. We use profile=rgba to preserve transparency and image_smoothing=text to ensure crisp fonts on any background.

Example 1: Web-Ready JPG (Balanced Quality)

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/jpg?resolution=150&quality=85&profile=rgb&output=web_images' \ -H 'X-apiKey: YOUR_API_KEY' \ -F 'file=@/path/to/brochure.pdf'
# Standard Response { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "inputIds": [ "7a9e4b12-f3c8-4d56-b7e1-8c2f9d0a3e6f" ] }

Example 2: Transparent PNG (Selected pages only)

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/png?pages=1,5-8&profile=rgba&image_smoothing=text&output=transparent_assets' \ -H 'X-apiKey: YOUR_API_KEY' \ -F 'file=@/path/to/design_draft.pdf'
# Standard Response { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "inputIds": [ "7a9e4b12-f3c8-4d56-b7e1-8c2f9d0a3e6f" ] }

2. Professional Print & Archival Scans (TIFF & BMP)

Use these configurations for enterprise workflows, physical printing, or fax archives.

  • TIFF (Print Ready): Converts the file using the cmyk color profile and maximum 600 DPI resolution, required for offset printing.
  • BMP (Archival): Simulates a scanned document by converting to 1-bit Black & White (bw). This creates extremely small files perfect for faxing or long-term database storage.

Example 1: Print-Ready TIFF (CMYK, 600 DPI)

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/tif?resolution=600&profile=cmyk&image_smoothing=all&output=print_master' \ -H 'X-apiKey: YOUR_API_KEY' \ -F 'file=@/path/to/marketing.pdf'
# Standard Response { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "inputIds": [ "7a9e4b12-f3c8-4d56-b7e1-8c2f9d0a3e6f" ] }

Example 2: B&W Document Scan (Smallest size for Archiving)

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/bmp?resolution=300&profile=bw&image_smoothing=text&output=archive_scan&destroy=true' \ -H 'X-apiKey: YOUR_API_KEY' \ -F 'file=@/path/to/invoice.pdf'
# Response with destroy=true (No File IDs as they are deleted right away) { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d" }

3. Thumbnails & Low-Bandwidth Previews (GIF)

Use this configuration to generate lightweight thumbnails or simple previews that load instantly on slower connections.

  • GIF: Ideal for simple graphics or document previews. We use resolution=72 (standard screen DPI) and profile=8-bit (256 colors) to keep the file size extremely small while maintaining readability for large headers and diagrams.

Example: Generate Lightweight Thumbnails (First Page Only)

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/gif?pages=1&resolution=72&profile=8-bit&output=thumbnail_preview' \ -H 'X-apiKey: YOUR_API_KEY' \ -F 'file=@/path/to/report.pdf'
# Standard Response { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "inputIds": [ "7a9e4b12-f3c8-4d56-b7e1-8c2f9d0a3e6f" ] }
  • ZIP Output: All endpoints return a ZIP file containing the images (one image per page).
  • Destroy Parameter: Adding destroy=true (as seen in the Print example) deletes the input file immediately, so no inputIds are returned in the response.
  • File ID: You can use the file_id from the inputIds array to process the same file again (e.g., creating a thumbnail after a high-res conversion) without re-uploading.

Step 2: Check Task Status

After submitting a pdf to image conversion task, check its progress using the Task Status API with your taskId. The task goes through these statuses: queued, processing, completed, and failed. Monitor your task to know when the image task has finished and images are ready for download.

curl -X 'GET' \ 'https://api.apifreaks.com/v1.0/pdf/task-status?task_id=04a06cd5-158d-4191-a45b-6f58249c599d' \ -H 'X-apiKey: YOUR_API_KEY'
# Response (completed) { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "status": "completed", "createdAt": "2026-01-26 13:30:00", "zipFileUrl": "https://api.apifreaks.com/v1.0/pdf/resource/download?resource_id=9b2e7f3a-5c8d-4e1b-a6f9-0d3c8e7b2a5f", "zipFileId": "9b2e7f3a-5c8d-4e1b-a6f9-0d3c8e7b2a5f", "inputIds": [ "7a9e4b12-f3c8-4d56-b7e1-8c2f9d0a3e6f" ], "expiresAt": "2026-01-26 23:59:59" } # Response (failed) { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "status": "failed", "createdAt": "2025-01-26 10:30:00", "inputIds": [ "566dc743-d8fe-4943-8cef-61e5d3d6096c" ], "error": "Invalid PDF File", "message": "The provided file is not a valid PDF file.", "expiresAt": "2025-01-27 10:30:00" }

Step 3: Download Converted Images

Once the task status shows "completed", download your converted images as a zip file using the File Download API. The zip contains one image file per converted page, named sequentially.

curl -X 'GET' \ 'https://api.apifreaks.com/v1.0/pdf/download?resource_id=9b2e7f3a-5c8d-4e1b-a6f9-0d3c8e7b2a5f' \ -H 'X-apiKey: YOUR_API_KEY' \ -o high_quality_images.zip

Webhook Support

Get automatic notifications when your task completes instead of polling the task status endpoint. Good for event-driven applications and real-time document processing.

Add webhook_url to your request. We'll send a POST request to this URL when the task finishes (either completed or failed).

Example Request:

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/jpg?webhook_url=https://yourdomain.com/webhook/pdf-to-jpg&webhook_failure_notification=true&resolution=150&quality=85&profile=rgb&output=web_images' \ -H 'X-apiKey: YOUR_API_KEY' \ -F 'file=@/path/to/file.pdf'
# Response { "taskId": "04a06cd5-158d-4191-a45b-6f58249c599d", "inputIds": [ "566dc743-d8fe-4943-8cef-61e5d3d6096c" ] }

Webhook Delivery

Webhook delivery will be attempted up to 3 times. If all retries fail and webhook_failure_notification is enabled, we'll send an email notification to the requesting user or their organization admin.

Custom Authorization Header

Use X-Webhook-Authorization to add a custom header to webhook requests for endpoint security.

Format: Key:Value

Example: If you send Authorization:Bearer token123, the webhook request will include: Authorization: Bearer token123

Example with custom authorization:

curl -X 'POST' \ 'https://api.apifreaks.com/v1.0/pdf/jpg?webhook_url=https://yourdomain.com/webhook/pdf-to-image&webhook_failure_notification=true' \ -H 'X-apiKey: YOUR_API_KEY' \ -H 'X-Webhook-Authorization: Authorization:Bearer token123' \ -F 'file=@/path/to/document.pdf'

Webhook Request Format

When your task completes, we send a POST request to your webhook_url with these headers:

HeaderDescriptionExample
Content-TypeAlways application/jsonapplication/json
X-SignatureHMAC-SHA256 signature of the request body using your API key. Use this to verify the payload is authentic.4a7d1ed414474e4033ac29ccb8653d9b
Custom Header(If provided) Your custom header from X-Webhook-AuthorizationAuthorization: Bearer token123

Webhook Response

The webhook payload contains the same response structure as the Task Status API endpoint when checked for the task ID. For a comprehensive view of the webhook response structure and detailed field descriptions, explore the interactive Response Table.

Verifying Webhook Authenticity

Use the X-Signature header to verify webhook requests actually came from API Freaks and weren't tampered with.

How the signature works:

  1. We compute an HMAC-SHA256 hash of the request body using your API key as the secret
  2. We Base64-encode the result
  3. We send this as the X-Signature header value

To verify the webhook:

  1. Take the raw payload body (JSON string exactly as received without parsing it)
  2. Compute HMAC-SHA256 of the payload using your API key as the secret
  3. Base64-encode the result of the hash
  4. Compare with the X-Signature header value

Important: Don't transform or process the raw request body before verification. Adding whitespace or other formatting creates a different signature and verification will fail.

Pricing

To use the PDF to Image APIs, API credits are required. Charges apply only for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded.

For each successful request, 200 credit will be charged per page. 1 extra credit will be charged per MB beyond 50 MB.

Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.

Price Estimation Calculator

Ready to get started?

Sign Up for Free

APIFreaks

API Catalog

  • Geolocation APIs
  • WHOIS APIs
  • DNS APIs
  • Email Validation APIs
  • SSL APIs
  • Domain APIs
  • Screenshot APIs
  • PDF APIs
  • Currency APIs
  • Commodity APIs
  • Financial APIs
  • ZIP Code APIs
  • Weather APIs
  • Timezone APIs
  • User Agent APIs
  • Other APIs

Tools Catalog

  • Code Formatters
  • Data & Query Tools
  • Text Tools
  • Email Utilities
  • DNS Tools
  • Viewers
  • Converters
  • PDF Tools

Docs

  • APIs
  • Swagger Docs

Pricing & Accounts

  • Pricing
  • Sign up
  • Sign In

Company

  • About Us
  • Resources
  • Terms
  • Privacy

Copyright © 2026

Made in Pakistan