Web2PDF avatar

Web2PDF

Pricing

from $10.00 / 1,000 results

Go to Apify Store
Web2PDF

Web2PDF

Convert any web page into a polished, high-quality PDF. This actor takes one or more URLs, renders them (including JavaScript-heavy pages), and exports them into clean, printable PDFs with consistent layout and typography.

Pricing

from $10.00 / 1,000 results

Rating

0.0

(0)

Developer

Jamshaid Arif

Jamshaid Arif

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Share

🌐 Web to PDF β€” Apify Actor

Convert any web page into a polished, high-quality PDF.

This actor takes one or more URLs, renders them (including JavaScript-heavy pages), and exports them into clean, printable PDFs with consistent layout and typography.


✨ Features

  • 🧾 Clean PDF Layout

    • A4 format
    • Cover page (title + domain)
    • Page numbers and running headers
  • 🧠 Smart Content Handling

    • Detects structured pages (e.g. conversations, articles)
    • Preserves headings, paragraphs, tables, and code blocks
  • 🌍 Works with Any Website

    • Supports static HTML and modern JS-heavy (SPA) websites
  • πŸ–₯️ Headless Browser Rendering

    • Uses Playwright (Chromium) for accurate page rendering
    • Automatically enabled for dynamic websites
    • Can be forced via input option
  • πŸ”€ Self-contained Typography

    • Fonts included in build:
      • Inter
      • Source Serif 4
      • JetBrains Mono
    • KaTeX support for math rendering
    • Fully offline and deterministic output

πŸ“₯ Input

FieldTypeRequiredDefaultDescription
urlsarrayβœ… Yesβ€”List of URLs to convert
forceBrowserboolean❌ NofalseForce rendering with headless browser
filenameTemplatestring❌ No{title}Output filename template

Example Input

{
"urls": [
{ "url": "https://example.com" },
{ "url": "https://en.wikipedia.org/wiki/PDF" }
],
"forceBrowser": false,
"filenameTemplate": "{title}_{domain}"
}

πŸ“€ Output

Each generated PDF is:

  • Stored in the default key-value store
  • Logged in the default dataset

Example Output

{
"url": "https://example.com",
"title": "Example Domain",
"kind": "web",
"key": "Example_Domain.pdf",
"sizeKb": 412,
"pdfUrl": "https://api.apify.com/v2/key-value-stores/<store-id>/records/Example_Domain.pdf"
}

🧩 Filename Template

You can customize output file names using:

  • {title} β†’ Page title
  • {domain} β†’ Website domain

Example

"{title}_{domain}"

Output:

Example_Domain_example.com.pdf

βš™οΈ How It Works

  1. Loads each URL
  2. Detects if JavaScript rendering is needed
  3. Renders page using Chromium (if required)
  4. Extracts structured content
  5. Applies clean PDF layout
  6. Generates and stores PDF

πŸš€ Use Cases

  • Save articles for offline reading
  • Archive web pages
  • Convert documentation into PDFs
  • Generate printable reports
  • Export structured web content