Playground Sign in Start free
Use case · PDF generation

PDF Generation API

Convert any web page to high-quality PDF documents programmatically. Full JavaScript rendering, custom page dimensions, and reliable output for invoices, reports, compliance documentation, and content preservation.

No credit card required.
The challenge

The PDF generation challenge.

Converting web pages to PDF seems straightforward, but dynamic content, complex layouts, and authentication barriers make programmatic PDF generation a persistent engineering challenge.

Dynamic content not rendered
Simple HTML-to-PDF tools miss JavaScript-rendered content, interactive charts, and dynamically loaded data.
Broken CSS & layout
Complex CSS layouts, flexbox, grid, and media queries often break when converting to fixed PDF page formats.
Scaling & pagination issues
Content gets cut off at page boundaries, tables split awkwardly, and images overflow margins without proper handling.
Authentication walls
Pages behind login screens, paywalls, or cookie-based sessions require browser-level authentication to access.
Use cases

PDF generation use cases.

How businesses use automated PDF generation across industries.

Invoice & receipt archiving

Automatically convert online invoices, receipts, and billing statements into PDF documents for accounting and tax compliance. Scrape and archive invoices from supplier portals, SaaS dashboards, and e-commerce platforms on a schedule. Build a searchable document archive with consistent formatting regardless of the source.

Business outcomes
  • Automate monthly invoice collection from 50+ vendor portals
  • Reduce manual document processing time by 80%
  • Maintain audit-ready document archives
  • Ensure compliance with document retention requirements

Compliance documentation

Generate PDF snapshots of web content for regulatory compliance and legal evidence. Capture terms of service changes, privacy policy updates, advertising claims, and public disclosures as they appeared at specific points in time. Create immutable records for legal teams, regulators, and auditors.

Business outcomes
  • Create timestamped records of regulatory disclosures
  • Archive competitor advertising claims for legal review
  • Meet GDPR, CCPA, and industry-specific documentation requirements
  • Provide court-admissible evidence of web content

Report generation

Convert web-based dashboards, analytics reports, and data visualizations into distributable PDF documents. Generate weekly or monthly reports from tools like Google Analytics, Looker, and custom dashboards. Share insights with stakeholders who prefer PDF documents over live dashboards.

Business outcomes
  • Automate weekly executive report generation
  • Convert live dashboards to shareable PDF documents
  • Schedule automated report delivery to stakeholders
  • Archive historical performance data as PDF snapshots

Content preservation

Archive web articles, research papers, blog posts, and online documentation as PDF documents before they disappear or change. Build knowledge libraries from web content that may not persist. Preserve formatting, images, and layout in a portable document format that works offline.

Business outcomes
  • Archive valuable content before it's removed or changed
  • Build offline-accessible knowledge libraries from web sources
  • Preserve research materials with original formatting
  • Create distributable copies of online-only content
How it works

How PDF generation works.

Convert any web page to PDF in three steps.

1

Send a Scrape API request

Use the Scrape API with content_type: "pdf" and provide the target URL. Optionally configure viewport dimensions for the browser rendering, wait conditions to ensure dynamic content is loaded, and custom headers or cookies for authenticated pages. A single API call is all it takes.

2

Browser renders & converts

Ujeebu launches a headless Chromium browser, navigates to the URL, executes all JavaScript, waits for content to fully load, and converts the rendered page to PDF using Chrome's built-in PDF printing engine. This ensures perfect CSS rendering, proper fonts, and accurate layout in the output document.

3

Receive the PDF document

Get your PDF document as a base64-encoded response or have it uploaded directly to your S3, Google Cloud Storage, or other destination. The PDF preserves all visual elements including images, charts, and styling. Integrate with webhooks for async processing in batch workflows.

Try it

Try PDF generation now.

Enter any URL to convert it to PDF in the playground.

curl "https://api.ujeebu.com/scrape" \
  -H "Authorization: Bearer YOUR_KEY" \
  -d url=https://stripe.com/pricing \
  -d render=true \
  -d content_type=pdf \
  --output capture.pdf
No API key required for testing. Powered by /scrape
Features

PDF generation features.

Full-page PDF

Generate PDFs that capture the entire page content, properly paginated and formatted. Long pages are automatically split across multiple PDF pages with intelligent page break handling to avoid cutting text or images mid-element.

Custom dimensions

Control the viewport width and height used for rendering before conversion. Set exact page dimensions to match standard paper sizes (A4, Letter) or custom formats. Adjust margins and scaling to get the precise PDF layout you need.

JavaScript execution

Full Chromium-based JavaScript rendering converts even the most complex SPAs and dynamic web applications to PDF. React, Vue, Angular, and any JavaScript framework is fully supported with complete DOM rendering.

Wait conditions

Wait for specific selectors, network idle, or custom JavaScript conditions before generating the PDF. Ensure charts are rendered, data tables are loaded, and all async content is present in the final document.

Scroll support

Automatically scroll through pages to trigger lazy-loaded content, infinite scroll sections, and dynamically loaded elements before PDF generation. Capture the complete page content, not just what's initially visible.

Proxy support

Access geo-restricted or protected content through residential and datacenter proxies. Bypass anti-bot detection with fingerprint randomization and stealth mode. Generate PDFs from any publicly accessible web page worldwide.

FAQ

Frequently asked questions.

Everything you need to know about our PDF endpoint.

What page sizes are supported for PDF output?
Ujeebu uses Chromium's PDF printing engine which supports all standard page sizes including A4, Letter, Legal, and Tabloid, as well as custom dimensions. You control the rendering viewport width and height, and the PDF engine handles proper pagination. For most use cases, the default settings produce high-quality output without any configuration.
Can I convert pages with JavaScript frameworks to PDF?
Yes. Ujeebu uses a full Chromium browser to render pages before converting to PDF, so all JavaScript frameworks are supported including React, Vue, Angular, Next.js, and Svelte. Single-page applications, client-side rendered content, and interactive elements are all fully rendered before PDF conversion. You can use wait conditions to ensure all async data is loaded.
How do I handle pages that require login?
You can pass custom cookies and headers with your API request to authenticate with the target site. This allows you to convert pages behind login walls, session-based authentication, and cookie-gated content. For more complex authentication flows, you can use the JavaScript execution parameter to run custom login scripts before PDF generation.
What's the maximum page length for PDF generation?
There's no practical limit on page length. Ujeebu handles very long pages by automatically scrolling to trigger lazy-loaded content and then converting the full rendered page to a multi-page PDF. The scroll support feature ensures that infinite scroll pages and dynamically loaded content are captured completely. Very large PDFs may take longer to generate but will complete reliably.
Can I generate PDFs from pages with anti-bot protection?
Yes. Ujeebu includes built-in anti-detection with rotating residential proxies, browser fingerprint randomization, and stealth mode. This allows PDF generation from sites protected by Cloudflare, DataDome, PerimeterX, and other anti-bot systems. The premium proxy option provides enhanced capabilities for heavily protected sites.
Can I top up if I run out of credits?
Yes. You can buy extra credits at any time without changing plans, at your tier's per-credit rate. Top-up credits are valid for 30 days.
Get started with 5,000 free credits.
No credit card required.
Start free

Start generating PDFs today.

Convert any web page to a high-quality PDF with a single API call.

No credit card required.