IRONSOFTWAREHOME
Parallel PDF Generation
from ironpdf import *
import concurrent.futures
import uuid

# Instantiate Renderer
renderer = ChromePdfRenderer()

htmlStrings = ["<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>"]

with concurrent.futures.ThreadPoolExecutor() as executor:
    futures = []
    for html in htmlStrings:
        futures.append(executor.submit(renderer.RenderHtmlAsPdf, html))

    # do something with each pdfDocument
    for future in concurrent.futures.as_completed(futures):
        pdf = future.result()
        pdf.SaveAs(f"{uuid.uuid4()}.pdf")
        # do something with each pdf
pip install ironpdf
Parallel PDF Generation

Parallel PDF Generation

IronPDF for Python supports multi-threaded PDF generation. A single ChromePdfRenderer instance is thread-safe and can be shared across concurrent tasks to render multiple PDFs in parallel.

Getting Started

Use Python's built-in concurrent.futures.ThreadPoolExecutor to submit render calls as parallel tasks. Each submitted task calls renderer.RenderHtmlAsPdf with a different HTML string, and the results are collected as they complete.

Understanding the Code

  • ChromePdfRenderer: A single instance can be reused across threads. IronPDF manages the underlying Chrome rendering engine safely under concurrent load.
  • ThreadPoolExecutor: Python's standard thread pool implementation. executor.submit schedules each render call as a non-blocking future.
  • concurrent.futures.as_completed(futures): Yields results as each thread finishes, regardless of submission order.
  • uuid.uuid4(): Generates a unique filename for each output PDF to avoid collisions when saving files concurrently.

Performance Considerations

Parallel rendering is most effective for batch jobs where many independent HTML documents need to be converted at the same time - for example, generating personalized reports or invoices for many recipients. The number of concurrent threads should be tuned based on the available CPU and memory on the host machine.

Learn to convert HTML to PDF with IronPDF for Python!

Ready to Get Started?

Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Python Module Download for PDF
Install with pip

Version: 2026.9

  1. Download and install Python 3.7+.
  2. Install pip from pypi.org if it isn't installed already.
  3. Execute the above command in the terminal.
Python PDF Module
Download Module

Version: 2026.9

Manually install into your project

  1. Download the package
  2. Run this command from the terminal
    pip install ironpdf-2026.9-py37-none-win_amd64.whi

Licenses from $999