Free tools Windows power users keep installed
One-click scans. No signup required.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
The most browser-faithful PHP approach is Spatie Browsershot: it drives Puppeteer and headless Chrome, accepts either a URL or an HTML string, and writes the rendered result as a PDF. Use Browsershot::url(...)->savePdf(...) for a reachable page, or Browsershot::html(...)->savePdf(...) for markup your application already generated.
Choose the rendering path before writing code
“Convert a web page” can mean two different operations: render a live page as a browser would, or parse HTML before producing a document. The distinction matters because JavaScript, modern CSS, fonts, images and authenticated resources require a browser-capable renderer.
| Need | Suitable direction | Important qualification |
|---|---|---|
| Render a URL or supplied HTML with browser behavior | Browsershot with Puppeteer and headless Chrome | It is a browser automation stack; your deployment must provide a compatible runtime. The documentation does not establish a universal “best” renderer. |
| Use a PHP extension based on QtWebKit | PHP’s wkhtmltox | Its rendering engine is QtWebKit. Verify that its behavior and deployment package meet your page’s CSS and JavaScript requirements. |
| Clean or inspect markup before rendering | DOMDocument (or PHP 8.4’s HTML5-oriented DOM classes) |
Parsing is preprocessing, not PDF rendering. DOMDocument::loadHTML() follows HTML 4 parsing behavior rather than a browser’s HTML5 algorithm. |
Compare candidates on browser-side rendering needs, CSS and JavaScript fidelity, runtime dependencies, page-layout controls and the trust boundary around source URLs and HTML. No source here supplies a performance ranking or complete compatibility matrix.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Convert a URL with Browsershot
For a public page that Chrome can reach, pass the URL directly and save the PDF to a writable path:
#1 Best Overall
<?php
use Spatie\Browsershot\Browsershot;
Browsershot::url('https://example.com')
->savePdf('example.pdf');
This is the smallest complete conversion. Browsershot delegates the rendering to Puppeteer and headless Chrome, so the output follows a browser-style rendering path rather than PHP’s string parser.
Render HTML assembled by PHP
When the application already has the document source, avoid a second network request:
<?php
use Spatie\Browsershot\Browsershot;
$html = '<!doctype html>
<html>
<head><meta charset="utf-8"></head>
<body><h1>Invoice</h1></body>
</html>';
Browsershot::html($html)
->savePdf('invoice.pdf');
Use html() when your PHP code controls the complete markup. Ensure relative assets resolve correctly (for example, use absolute URLs or a document base that your rendering environment can reach).
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteControl PDF layout
The Browsershot PDF documentation covers controls for the paper format or custom dimensions, margins, headers and footers, background printing, orientation, scale and page ranges. Apply only the options your version exposes, and keep layout decisions close to the export code so they are reviewable.
Typical decisions to make
- Paper and orientation: choose a standard paper format or dimensions, then select portrait or landscape for wide tables.
- Margins: reserve space for printer-safe content and any header or footer.
- Backgrounds: enable background printing when colors or background images carry meaning.
- Scale: adjust scale cautiously; excessive shrinking can make text unreadable.
- Page ranges: export selected pages when a larger document contains a relevant section.
- Headers and footers: keep repeating metadata separate from the page body so it does not alter your content flow unexpectedly.
Read the PDF creation documentation for the exact method names and option syntax for your installed Browsershot version.
Rank #2
Validate inputs and protect the renderer
Spatie’s security guidance says to pass only trusted URLs and HTML. Treat both arguments as an input-validation boundary:
- Allow-list destinations when a user can choose a URL; do not let arbitrary users make your server request internal services.
- Sanitize or generate HTML on the server instead of accepting untrusted markup unchanged.
- Separate tenants’ cookies, authorization headers and temporary files.
- Set resource and job limits appropriate to your infrastructure, and delete generated files according to your retention policy.
- Log the requested destination and outcome without recording secrets embedded in query strings or markup.
The cited documentation does not provide a complete SSRF, sandboxing or multi-tenant security design. Define those controls for your own deployment rather than treating the warning as a complete checklist.
When wkhtmltox is a better fit
The PHP manual describes wkhtmltox as an LGPLv3 library based on QtWebKit for HTML-to-PDF and image rendering. Its PDF object constructor accepts a URL or path as the page source (see the constructor reference).
Choose this route when the extension and QtWebKit behavior are already supported in your target environment. Do not assume that a QtWebKit renderer will match current Chrome behavior on every CSS- or JavaScript-heavy site; verify the pages that matter to your application. The supplied references do not establish release status, security support, performance or broad browser compatibility.
Why DOMDocument alone does not create a PDF
DOMDocument::loadHTML() parses a string into a DOM tree. It can help you remove nodes, rewrite links or extract data before rendering, but it does not lay out a page or emit a PDF. The PHP manual also notes that this method uses HTML 4 parsing rules, which differ from HTML5 browser parsing; PHP 8.4 adds Dom\HTMLDocument methods for HTML5-conforming parsing. If you preprocess markup, render the resulting HTML with Browsershot or another PDF-capable engine afterward.
Practical export workflow
- Define the source: use
url()for a reachable page, orhtml()for application-generated markup. - Make assets deterministic: use reachable stylesheets, images and fonts; avoid relying on a developer workstation’s local files.
- Apply layout settings: paper, margins, orientation, backgrounds, scale and page ranges should match the document’s purpose.
- Validate and authorize: allow-list URLs and generate or sanitize HTML under your control.
- Write to controlled storage: use a unique output name and a directory writable by the PHP worker but not publicly browsable unless intended.
- Check the result: verify the file exists, has a nonzero size and opens as a PDF before returning it to a user.
Troubleshooting common failures
The PDF is empty or a page is missing
Confirm that the URL is reachable from the machine running Chrome, not merely from your laptop. Check redirects, authentication, blocked resources and client-side rendering. For HTML input, verify that the string contains the expected document and that referenced assets are reachable.
Styles, images or fonts are absent
Inspect every relative URL and make it resolvable in the rendering environment. A page that depends on private cookies or headers must be rendered with the appropriate trusted context; never copy arbitrary user credentials into a conversion request.
Modern layout differs from the browser preview
Determine which engine produced each result. Browsershot uses Puppeteer and headless Chrome, whereas wkhtmltox uses QtWebKit. Differences in CSS and JavaScript support are expected; test the actual templates and select the engine that satisfies them.
The PHP process cannot write the file
Use an absolute destination in a directory writable by the PHP worker, check filesystem permissions and confirm that the parent directory exists. Return a controlled application error instead of exposing an internal path.
Untrusted input creates a security issue
Stop accepting arbitrary destinations or markup. Enforce an allow-list, sanitize generated content, isolate rendering credentials and review outbound-network and file-system permissions around the browser process.
Rank #4
Performance, reliability and cost considerations
Browser rendering has more moving parts than string parsing: PHP, Puppeteer, Chrome, page assets and the destination server can all affect a job. The cited documentation does not quantify memory use, throughput, startup time or compatibility, so benchmark your own templates and deployment rather than relying on a generic figure.
- Reuse a controlled rendering setup where your process manager permits it, while isolating jobs that handle different tenants or credentials.
- Keep templates and assets lean; every external resource is another possible timeout or failure.
- Record whether failures occur during navigation, asset loading or file writing so retries address the real cause.
- Use deterministic test pages for layout regression checks and inspect PDFs visually when changing CSS.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP or PDF; the PDF path is useful when your PHP application needs a hosted browser capture instead of maintaining Puppeteer and Chrome.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
For PDF output, request the PDF format using the documented parameter names. The complete API reference is at https://screenshotneo.com/docs/. Equivalent calls from PHP’s surrounding toolchain can use the same HTTPS endpoint:
<?php
$url = 'https://api.screenshotneo.com/v1/shot';
$query = http_build_query([
'access_key' => 'YOUR_API_KEY',
'url' => 'https://stripe.com',
]);
$pdf = file_get_contents($url . '?' . $query);
file_put_contents('shot.pdf', $pdf);
ScreenshotNeo accepts options for full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and arbitrary viewports, retina scale, PDF paper size, margins, landscape and page ranges, custom CSS and JavaScript, click and wait actions, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage reporting and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Its clean-shot workflow accepts consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
The Free plan includes 1,000 shots per month without a card. Paid plans are Starter $5 for 3,000 shots, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000; yearly billing provides two months free, and every feature is on every plan. Create a free ScreenshotNeo account to start.
FAQ
Can Browsershot convert an HTML string as well as a URL?
Yes. Use Browsershot::html($html)->savePdf(...) for markup supplied by your PHP application.
Does DOMDocument render JavaScript?
No. It parses HTML. Use a browser-oriented renderer when scripts and browser layout are required.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Which option should I choose for a JavaScript-heavy page?
Start with a browser-based path such as Browsershot and headless Chrome, then test the exact page and deployment. The available references do not support a universal compatibility ranking.
Frequently Asked Questions
Can Browsershot convert an HTML string as well as a URL?
Yes. Use Browsershot::html($html)->savePdf(...) for markup supplied by your PHP application.
Does DOMDocument render JavaScript?
No. It parses HTML. Use a browser-oriented renderer when scripts and browser layout are required.
Which option should I choose for a JavaScript-heavy page?
Start with a browser-based path such as Browsershot and headless Chrome, then test the exact page and deployment. The available references do not support a universal compatibility ranking.
Quick Recap
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.

