Documentation Playground
Docs / Configuration
Configuration

Configuration Overview

Customize the final output of your PDFs. PDFKong provides powerful parameters to manipulate the DOM via CSS/JS injection, strip unwanted elements like ads and navigation bars, and set exact physical paper dimensions.

Select Group

CSS & JS Injection

Dynamically inject custom CSS stylesheets or execute JavaScript before the PDF is rendered. This is extremely useful for hiding specific elements on a target URL or modifying the layout for print.

{ "css": "nav { display: none !important; }", "js": "document.title = 'Ready';" }

Appearance Options

Clean up messy websites or alter the layout format by utilizing our appearance filters. Strip out ads, hide images, remove links, or force the browser to render backgrounds.

{ "print_backgrounds": true, "no_ads": true, "no_images": true }

Page Setup

Control the physical dimensions, margins, and scaling of the generated PDF document. Set portrait or landscape orientations or create full-bleed borderless PDFs.

{ "landscape": true, "margin_top": 0, "paper_width": 8.27 }