DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

How to Add Custom Headers and Footers to PDFs with PDFCrowd

Add custom running headers and footers to PDFCrowd output with HTML templates, page-number classes, layout reservations, and page-specific controls.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To add running text, branding, or page numbers to a PDF made with PDFCrowd, supply a header template with header_html or header_url and a footer with footer_html or footer_url. Set header_height and footer_height to reserve room, and use the pdfcrowd-page-number and pdfcrowd-page-count classes for dynamic page values.

Choose how to provide the templates

PDFCrowd’s HTML-to-PDF HTTP API accepts either template markup in the conversion request or a URL from which it can load the template. Header and footer are independent, so configure each side you need.

As an Amazon Associate I earn from qualifying purchases.

  • header_html and footer_html: use these when the template belongs with the conversion request.
  • header_url and footer_url: use these when the HTML template is hosted separately. The API reference supports HTTP and HTTPS template URLs.

For example, a request can include an inline header and footer like this (replace the URL and credentials with your own):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -X POST "https://api.pdfcrowd.com/convert/" 
  -u "username:apikey" 
  -F "text=<html><body><h1>Quarterly report</h1><p>Report content goes here.</p></body></html>" 
  -F "header_html=<div>Acme | Quarterly report</div>" 
  -F "footer_html=<div>Page <span class='pdfcrowd-page-number'></span> of <span class='pdfcrowd-page-count'></span></div>" 
  -F "header_height=0.6in" 
  -F "footer_height=0.6in" 
  -o report.pdf

This illustrates the documented parameter names and template classes. Confirm the current authentication and request format in the official PDFCrowd HTTP API reference before using it as a production request; this example has not been validated against a live conversion.

Insert page numbers and page counts

Put an element with class pdfcrowd-page-number where the current printed page number should appear. Use pdfcrowd-page-count for the total number of printed pages. The classes can be placed in either header or footer HTML, for example: <span class="pdfcrowd-page-number"></span> / <span class="pdfcrowd-page-count"></span>.

The client-library method index documents number-format attributes too, including a Roman-numeral example. Since exact method names and syntax vary by language, check the current reference for the client you use rather than assuming the HTTP form maps directly to an SDK method.

Rank #2
1 Second Auto Size Scanner PDF JPG 16MP Resolution Portable Document Scanner for Converting and Editing
  • LIGHTWEIGHT AND FOLDABLE STRUCTURE: Foldable design (30x6x8cm) and lightweight (1000g) make it portable for travel or home use. Compact shape fits perfectly on your workbench without taking up much space
  • SIMPLE CONNECTION: Works with USB connection without the need for additional programs for quick installation. Simple controls make it easy to operate both beginners and regular users with regular size papers
  • QUICK DOCUMENT PROCESSING: Automatically scan suggestions one page per second, greatly increase productivity. Ideal for workplaces, schools, legal/financial areas where large capacity is required
  • TEXT CONVERSION TECHNOLOGY: Smart OCR function works in over 200 languages, changes scanned files to editable text for easy storage and editing Seamless digital conversion of paper documents improves workflow
  • EXCELLENT IMAGEING: Equipped with a 16MP clear camera, this portable document scanner produces crisp, accurate images of documents and keeps important content intact. Perfect for striking scans of contracts, receipts and books

Reserve space and align the running content

header_height and footer_height reserve vertical space for their respective templates. The documented default for each is 0.5in. Increase a height if the template has multiple lines, larger text, or images; too little reserved space can clip the template or let it overlap the document body. Accepted units include inches, millimeters, centimeters, pixels, and points.

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.
  • no_header_footer_horizontal_margins makes header/footer width equal to the physical page width. The API reference lists this for converters at or above version 20.10; verify converter compatibility before relying on it.
  • header_footer_scale_factor adjusts header/footer zoom. Its documented default is 100, and the accepted range is 10–500.

Measure the space against the actual template, not just its text: line wrapping and image dimensions can change its height. Check a representative multi-page output to confirm that body content, header, and footer do not collide.

Show or hide headers and footers on selected pages

For simple exclusions, set exclude_header_on_pages or exclude_footer_on_pages to comma-separated page numbers. The documented examples include 1,-1 for excluding the first and last pages.

For more granular page or range behavior, use conversion_config with pageSetup entries. Page selectors can control displayHeader and displayFooter, with values such as none, space, and content. When the JSON conversion configuration specifies a setting, PDFCrowd says it takes precedence over the corresponding global option.

Handle conflicts with CSS @page rules

If the source HTML uses print CSS, css_page_rule_mode determines precedence between API page settings and CSS @page rules. The documented default mode prioritizes API page settings; mode2 prioritizes CSS rules. The reference also lists mode1 for backward-compatible legacy behavior. Choose deliberately when CSS margin or page rules seem to override the API configuration.

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

Use a PDFCrowd client library

PDFCrowd’s method index lists HTML-to-PDF header and footer support for HTTP and its client families, including PHP, Java, .NET, Python, Node.js, Ruby, Go, CLI, and WordPress. It includes methods corresponding to HTML templates, heights, scale factor, and conversion configuration. Names and request shapes are language-specific; use the method index to open the current reference for your chosen client: PDFCrowd API method index.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test and troubleshoot the PDF

  • Header or footer is clipped: raise the matching header_height or footer_height. Include enough room for wrapped text and images.
  • Running content overlaps the body: reserve more vertical space for the template and inspect the source page margins and print CSS.
  • Page number or total is missing: check that the relevant element has the exact class pdfcrowd-page-number or pdfcrowd-page-count, then verify with a multi-page document. The total refers to printed pages.
  • A header appears on an excluded page: review the comma-separated page numbers and whether a conversion_config page setup entry explicitly controls display; explicit JSON settings take precedence over global settings.
  • CSS and API page layout disagree: set css_page_rule_mode to the precedence behavior you want and check whether the converter supports any version-gated option you use.
  • Remote template is not loaded: confirm that the URL is reachable over HTTP or HTTPS by the conversion service and that it returns the intended HTML.

Before publishing or automating a template, inspect the generated PDF at the beginning, middle, and end of a representative document, including pages where headers or footers are suppressed. The available documentation describes the controls but does not establish behavior for every converter version or document layout.

Or skip the browser setup

If your task is capturing a web page as an image or PDF rather than configuring PDFCrowd’s HTML-to-PDF header and footer controls, ScreenshotNeo offers a one-request screenshot API. For example, save a page as WebP with cURL:

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. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, and cache hits are not billed. Its MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Sign up for the free plan.

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

Frequently Asked Questions

Can I use a remote HTML file for a PDFCrowd header?

Yes. Use header_url or footer_url with an HTTP or HTTPS template URL.

Does PDFCrowd support page numbers in headers and footers?

Yes. Add elements using the pdfcrowd-page-number and pdfcrowd-page-count classes.

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
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver 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.