Attach a Cover Page
from ironpdf import *

# Instantiate Renderer
renderer = ChromePdfRenderer()
 
""" Cover Page """
# Created Sample Cover using RenderHtmlAsPdf method
cover = renderer.RenderHtmlAsPdf("<h1> This is Cover Page</h1>")
 
""" Main Document """
# As we have a Cover Page, we're going to start the page numbers at 2.
renderer.RenderingOptions.FirstPageNumber = 2
 
# Set up headers and footers
# ...not included in the example
 
# Downloaded & Converted to PDF in Just One Line!
pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/")
 
# Only ONE Line command to merge two PDFs.
PdfDocument.Merge(cover, pdf).SaveAs("combined.pdf")
pip install ironpdf
Attach a Cover Page

Attach a Cover Page

IronPDF for Python makes it straightforward to prepend a custom cover page to any PDF document, creating professionally structured reports and documents.

Getting Started

Render two separate PDFs - one for the cover and one for the main content - then merge them into a single document using PdfDocument.Merge. Set FirstPageNumber = 2 on the main content renderer so that page numbers begin at 2, accounting for the cover page.

Understanding the Code

  • renderer.RenderHtmlAsPdf(html): Renders the cover page HTML as a standalone PdfDocument.
  • FirstPageNumber = 2: Tells IronPDF that the first page of the main content should be numbered 2. This is important when a footer or header includes {page} merge fields.
  • renderer.RenderUrlAsPdf(url): Renders the main document content from a URL.
  • PdfDocument.Merge(cover, pdf): Combines the cover page PDF with the main document PDF, placing the cover first. Returns a new merged PdfDocument.
  • SaveAs("combined.pdf"): Saves the merged document to disk.

Customizing the Cover Page

The cover page HTML can include any content - company logo, document title, author, date, and formatting. Use the same ChromePdfRenderer with its full range of rendering options (fonts, margins, backgrounds) to style the cover page.

Learn to create and merge PDF documents with IronPDF for Python!

Ready to Get Started?

Version:2026.11just released