Convert Image to PDF and PDF to Image avatar

Convert Image to PDF and PDF to Image

Pricing

from $0.00005 / actor start

Go to Apify Store
Convert Image to PDF and PDF to Image

Convert Image to PDF and PDF to Image

Convert images (JPG, PNG, BMP, and more) into high-quality PDFs, or extract images from PDF files in seconds. Image–PDF Converter Pro delivers fast, reliable, and professional results for all your document and image conversion needs.

Pricing

from $0.00005 / actor start

Rating

0.0

(0)

Developer

Akash Kumar Naik

Akash Kumar Naik

Maintained by Community

Actor stats

1

Bookmarked

72

Total users

19

Monthly active users

8 days ago

Last modified

Security

Limited permissions

Share

Image and PDF Converter is an Apify Actor that provides bidirectional conversion between images (JPEG, PNG, BMP) and PDF documents with professional quality. Convert images to PDF and PDFs to images with high-resolution output, optional watermarking, flexible page-merging, and auto-detected conversion direction — built for document archiving, content creation, OCR pipelines, and cross-platform workflows.

What Is Image and PDF Converter?

Give the Actor a direct URL to an image or a PDF — including Google Drive and Dropbox share links — and it downloads the file, converts it, stores the result in the Apify Key-Value Store, and pushes a dataset record with the output URL. The conversion direction is detected automatically, or you can force imageToPdf / pdfToImages.

Key Features

  • Bidirectional Conversion — convert images → PDF and PDF → images in a single Actor
  • Auto-Detection — automatically detects file type and picks the right conversion direction
  • High-Resolution Output — configurable scale factor (default 3×) for crisp, OCR-ready images
  • Quality Control — adjust compression quality (1-100) to balance file size vs. fidelity
  • Custom Watermarking — add text watermarks with configurable opacity, font size, color, and position
  • Merge Mode — combine all PDF pages into one composite image for previews or social sharing
  • Page Size & Orientation — choose A4/A3/A5/Letter/Legal and portrait or landscape for image→PDF
  • Adjustable DPI — output resolution for PDF→images from 72 to 600 DPI
  • Cloud Storage Support — process files directly from Google Drive, Dropbox, or any public URL
  • Pay-Per-Event Pricing — only pay for what you convert; no flat subscription fees

Supported Formats

  • Image inputs (image → PDF): JPEG, PNG, BMP
  • Document inputs (PDF → images): PDF
  • Source links: direct URLs, Google Drive, Dropbox, and other shared links

Use Cases

  • Document archiving — turn images into clean, paginated PDFs for records
  • Content creation — generate previews, thumbnails, and shareable page images
  • OCR pipelines — render PDF pages as high-resolution images for OCR or AI vision models
  • Cross-platform workflows — convert files straight from Google Drive or Dropbox links

Input Parameters

ParameterTypeRequiredDefaultDescription
urlstringYes—Direct URL to an image (JPEG, PNG, BMP) or PDF file. Supports Google Drive, Dropbox, and other shared links
conversionDirectionstringNoautoauto detects file type automatically; or force imageToPdf / pdfToImages
qualityintegerNo90Output quality 1-100 (higher = better quality, larger file)
watermarkstringNo—Text to add as a watermark on each page. Leave empty for no watermark
pageSizestringNoA4Page size when converting images to PDF: A4, A3, A5, Letter, Legal
orientationstringNoportraitPage orientation when converting images to PDF: portrait or landscape
resolutionintegerNo150Output resolution when converting PDF to images (72-600 DPI). Higher values mean sharper images
mergeOutputbooleanNofalseWhen converting PDF → images, merge all pages into a single image output

Example input:

{
"url": "https://www.africau.edu/images/default/sample.pdf",
"conversionDirection": "auto",
"quality": 90,
"mergeOutput": false
}

Watermarked image-to-PDF example:

{
"url": "https://example.com/photo.jpg",
"conversionDirection": "imageToPdf",
"quality": 95,
"watermark": {
"text": "© 2025 My Company",
"opacity": 0.4,
"fontSize": 28,
"color": "gray",
"position": "bottom-right"
}
}

Sample Output

Results are stored in the Apify Dataset and the converted files are saved in the Key-Value Store.

Successful record (image → PDF):

{
"inputUrl": "https://example.com/photo.jpg",
"fileName": "photo.jpg",
"conversionType": "imageToPdf",
"outputUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/result_1234567890.pdf",
"outputKey": "result_1234567890.pdf"
}

Successful record (PDF → images, one record per page):

{
"inputUrl": "https://example.com/document.pdf",
"fileName": "document.pdf",
"conversionType": "pdfToImages",
"outputUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/result_page_1_1234567890.png",
"outputKey": "result_page_1_1234567890.png",
"page": 1
}

Error record:

{
"inputUrl": "https://example.com/broken.pdf",
"status": "error",
"errorCode": "CONVERSION_ERROR",
"message": "Failed to process file: HTTP error! status: 403"
}

Conversion Examples

Convert PDF to High-Resolution Images (for OCR)

{
"url": "https://example.com/document.pdf",
"conversionDirection": "pdfToImages",
"quality": 100
}

Produces one dataset record per page with a direct image URL — ideal for feeding into OCR or AI vision models.

Merge All PDF Pages into One Image

{
"url": "https://example.com/multi-page.pdf",
"conversionDirection": "pdfToImages",
"mergeOutput": true,
"quality": 90
}

All pages are stacked vertically into a single PNG — great for document previews or social media thumbnails.

Convert Image to Watermarked PDF

{
"url": "https://example.com/photo.png",
"conversionDirection": "imageToPdf",
"quality": 95,
"watermark": {
"text": "CONFIDENTIAL",
"opacity": 0.6,
"fontSize": 30,
"color": "red",
"position": "center"
}
}

How to Use Image and PDF Converter

  1. Open the Image and PDF Converter Actor on Apify Store and click Try for free.
  2. Paste your file URL into the url field.
  3. Set conversionDirection to auto (or choose explicitly).
  4. Optionally configure quality, watermark, page size, DPI, and merge settings.
  5. Click "Start" and monitor the run.
  6. Download your converted file from the Output tab or via the dataset record URL.

Connect via API

cURL:

curl -X POST "https://api.apify.com/v2/acts/akash9078/image-pdf-converter/runs" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/document.pdf", "conversionDirection": "auto", "quality": 90}'

Python with the Apify Client:

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("akash9078/image-pdf-converter").call(
run_input={
"url": "https://example.com/document.pdf",
"conversionDirection": "pdfToImages",
"quality": 90,
}
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)

Node.js with the Apify Client:

const { ApifyClient } = require('apify-client');
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('akash9078/image-pdf-converter').call({
url: 'https://example.com/document.pdf',
conversionDirection: 'pdfToImages',
quality: 90,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Pricing

This Actor uses Pay-Per-Event (PPE) pricing — you are only charged for what you actually use:

EventEvent NamePrice
Actor start (synthetic, auto-charged by Apify)apify-actor-start$0.00005 per start
File converted (image → PDF or PDF → images)converted-file$0.005 per file
PDF page extracted (PDF → images, per page)extracted-page$0.005 per page

The apify-actor-start event is automatically charged by Apify and covers the first 5 seconds of compute cost. You do not need to charge it manually in your code.

Cost Examples

TaskCost BreakdownTotal
Convert 1 image to PDF$0.00005 (start) + $0.005 (file)~$0.005
Convert a 10-page PDF to images$0.00005 (start) + $0.005 (file) + 10 × $0.005 (pages)~$0.055
Convert 100 images to PDFs$0.00005 (start) + 100 × $0.005 (files)~$0.50

Spending Limits

Users can set a maximum spend per run in the Apify Console. The Actor respects this limit — if the budget is reached mid-run, it stops gracefully and outputs whatever has been converted so far.

Free tier: New Apify accounts include free platform credits. Check Apify Pricing for current free tier limits.

Why Use Image and PDF Converter?

One Actor covers both directions — image→PDF and PDF→images — with auto-detection, so you do not maintain two separate tools or local binaries. Cloud storage links are resolved automatically, watermarks and page geometry are configurable in the same run, and the pay-per-event model means a 1-page job costs a fraction of a cent. Files land in Apify storage with dataset records, so results are immediately downloadable and API-accessible.

Troubleshooting

"File is corrupted or empty"

  • Ensure the URL is publicly accessible (no login required)
  • Check that the file is not password-protected or empty

"Unsupported file format"

  • Supported image formats: JPEG, PNG, BMP
  • Supported document format: PDF
  • Verify the file extension matches the actual content type

"HTTP error! status: 403 / 404"

  • The URL may require authentication or the file has been moved/deleted
  • For Google Drive: make sure sharing is set to "Anyone with the link"

Low image quality for OCR

  • The default scale factor (3×) already produces ~216 DPI equivalent output
  • For very fine text, try passing "scale": 4.0 via the pdfOptions field

Performance Tips

  • Use mergeOutput: false (default) for large PDFs to avoid memory spikes
  • Higher quality settings increase processing time and output file size
  • Watermarking adds minimal overhead

Limitations

  • Supported image inputs are JPEG, PNG, and BMP; the only supported document format is PDF
  • Files must be publicly accessible — password-protected or login-gated files cannot be converted
  • Merging pages into one image increases memory usage for large PDFs

FAQ

Which conversion directions are supported?

Image → PDF (imageToPdf) and PDF → images (pdfToImages). With auto, the Actor detects the file type and picks the right direction.

Which image formats can I convert to PDF?

JPEG, PNG, and BMP images can be converted to PDF.

Can I add a watermark?

Yes. Provide watermark text in the watermark field; you can configure opacity, font size, color, and position for styled watermarks.

Can I merge all PDF pages into a single image?

Yes. Set mergeOutput to true and all pages are stacked vertically into one PNG.

What page sizes and orientations are supported?

A4, A3, A5, Letter, and Legal page sizes, in portrait or landscape orientation, when converting images to PDF.

Can I control the output resolution of PDF-to-image conversion?

Yes. Use the resolution input (72-600 DPI, default 150) for sharper images when converting PDFs.

Can I convert files from Google Drive or Dropbox?

Yes. Share links from Google Drive, Dropbox, OneDrive, and similar services are processed directly — make sure sharing is set to "Anyone with the link".

Support

  • Issues & Feature Requests: Use the Issues tab on the Actor page
  • Community: Join the Apify Discord to connect with other developers
  • Documentation: Apify Docs for platform guidance

If you need more image and document processing from Apify, check out my other Apify Actors:


Built and maintained by akash9078 on the Apify platform.