Processing…
Processing your file…
Please wait, this may take a moment

How to Use URL-to-PDF and HTML-to-PDF

PDFXINET Team 2026-10-17 url to pdf, html to pdf, weasyprint, gtk3, windows, setup

Save Any Web Page as a PDF

There are plenty of moments when you need a permanent, printable copy of a web page — a news article, a recipe, a flight itinerary, an online invoice. PDFXINET's HTML-to-PDF tool converts any URL or raw HTML into a downloadable PDF in seconds.

Common Uses

  • Archiving web pages before they change or disappear
  • Generating invoices and receipts from web-based billing systems
  • Printing web articles in a clean, readable format
  • Creating offline copies of online documentation
  • Producing PDF reports from internal web dashboards

How to Convert a URL to PDF

  1. Go to Tools → URL → PDF from the top menu.
  2. Click the URL tab and paste the full address (must start with http:// or https://).
  3. Click Convert to PDF.
  4. Download your PDF or copy the share link.

Using Raw HTML Instead

Switch to the HTML tab and paste your HTML markup directly. This is ideal for generating PDFs from templates — invoices, letters, and branded documents — without needing a hosted page.

Rendering Quality: Two Modes

PDFXINET uses WeasyPrint for CSS-faithful rendering when available on the server. WeasyPrint reproduces fonts, colours, layout, and images accurately — the PDF looks very close to what you see in a browser.

If WeasyPrint's system libraries are not available, the tool automatically falls back to a plain-text extraction renderer. You still get a usable PDF containing all the visible text, but without visual styling.

Self-Hosted: What Do You Need to Install?

WeasyPrint itself is already included in requirements.txt and installs with pip install -r requirements.txt. It also requires GTK3 system libraries on the host operating system:

  • Windows — Download and run the one-click GTK3 installer:
    github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer
    After installing, restart your terminal and then restart the Flask server.
  • Ubuntu / Debian / Docker — run:
    sudo apt install libpango-1.0-0 libpangocairo-1.0-0 libcairo2 libgdk-pixbuf-2.0-0 shared-mime-info fonts-liberation
    (Already included in the project Dockerfile — Docker deployments work automatically.)
  • macOS — run:
    brew install pango cairo gdk-pixbuf libffi

Once the libraries are installed, verify WeasyPrint is working:

python -c "from weasyprint import HTML; HTML(string='<h1>Test</h1>').write_pdf('test.pdf'); print('OK')"

Tips for Clean Output

  • Pages behind a login wall cannot be captured — use the HTML tab and paste the source instead.
  • Pages that rely heavily on JavaScript for rendering may show incomplete content, since the tool fetches raw HTML rather than running a full browser engine.
  • For best results on complex pages, paste the HTML directly rather than using a URL.
  • The generated PDF inherits the page's CSS print styles if any are defined.
Share: Twitter LinkedIn