What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For unattended conversion, launch Chrome or another Chromium-based browser from PowerShell with --headless and --print-to-pdf. Add --no-pdf-header-footer to remove browser-generated headers and footers, and use --timeout or --virtual-time-budget when JavaScript changes the page after navigation. For a one-off file, Edge’s Print dialog is simpler; for a .NET application, WebView2 can print directly to a file or stream.

The dependable PowerShell method: headless Chrome

A live web page must be rendered by a browser before it can become a faithful PDF. Downloading HTML with Invoke-WebRequest only retrieves markup; it does not run the page’s JavaScript, apply the browser’s layout engine, load web fonts, or resolve client-side content.

Chrome’s headless command-line interface provides the most direct unattended workflow. The --print-to-pdf flag saves the target page as a PDF, while --no-pdf-header-footer suppresses the browser-added URL, title, date, and page-number decoration.

Runnable PowerShell script

$url = 'https://example.com'
$out = Join-Path $PWD 'page.pdf'
$chrome = 'C:Program FilesGoogleChromeApplicationchrome.exe'

$args = @(
    '--headless',
    '--print-to-pdf=' + $out,
    '--no-pdf-header-footer',
    '--timeout=5000',
    $url
)

$p = Start-Process -FilePath $chrome -ArgumentList $args -Wait -PassThru

if ($p.ExitCode -ne 0 -or -not (Test-Path -LiteralPath $out)) {
    throw 'PDF generation failed'
}

Write-Host "Created $out"

Change $url and $out for your page and destination. The script waits for Chrome to exit, then checks both the process exit code and the existence of the output file. That check is important in scheduled jobs: a process can terminate without producing the expected artifact.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
  • Convert your PDF files into Word, Excel & Co. the easy way
  • Convert scanned documents thanks to our new 2022 OCR technology
  • Adjustable conversion settings
  • No subscription! Lifetime license!
  • Compatible with Windows 11, 10, 8.1, 7 - Internet connection required

Chrome path and argument details

  • Adjust $chrome if Chrome is installed elsewhere. A Chromium, Chrome for Testing, or another Chromium-based executable can use the same general flags, but executable behavior and installed paths vary.
  • --print-to-pdf=<path> writes the PDF to the specified path. Quote or otherwise safely pass paths containing spaces.
  • --no-pdf-header-footer removes browser-generated decoration only. It does not disable headers, footers, margins, or other pagination rules created by the page’s CSS or print settings.
  • Use a separate output path for each job. If several jobs share a destination, the last process can overwrite an earlier PDF.
  • For concurrent jobs, prefer a temporary user-data directory so processes do not contend for the same browser profile. Create an isolated directory per process and remove it when the job finishes.

Waiting for JavaScript and delayed content

Many pages start with a shell and populate articles, charts, or tables after timers, API calls, or hydration. A PDF taken immediately after navigation can therefore be blank or incomplete.

Increase the navigation timeout

$args = @(
    '--headless',
    '--print-to-pdf=' + $out,
    '--no-pdf-header-footer',
    '--timeout=15000',
    $url
)

Increase the value when the page needs more time to load. This is a time allowance, not a guarantee that an application has finished rendering: a page can remain visually incomplete even after the timeout expires.

Give virtual time to timer-driven pages

$args = @(
    '--headless',
    '--print-to-pdf=' + $out,
    '--no-pdf-header-footer',
    '--timeout=15000',
    '--virtual-time-budget=10000',
    $url
)

--virtual-time-budget lets page timers and related script work advance for the specified number of milliseconds before printing. It is useful for content revealed by delayed JavaScript. Neither switch can bypass an authentication wall, a bot challenge, a permanently failed API request, or a page that requires a user action your command never performs.

When a fixed delay is not enough

  • Confirm the URL works in an ordinary browser session on the same machine.
  • Check that the data endpoint is reachable and that required cookies or authorization are present.
  • Use a longer timeout or virtual-time budget only after verifying that the page eventually renders; adding delay to a failing request does not fix the request.
  • If the page requires clicks, login, or custom DOM orchestration, use a browser-automation framework or an application-hosted WebView2 instance rather than relying on a single command-line print.

Removing headers, footers, margins, and backgrounds

Browser-generated headers and footers

Put --no-pdf-header-footer in the argument list. Without it, Chromium can add its own title, URL, date, and page numbers. This flag controls that browser decoration; it does not erase a header or footer that is part of the website itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Page CSS still controls pagination

The target page can define @page margins, page breaks, printable colors, and fixed-position elements. A site may also deliberately render a masthead or footer in its document body. If those elements remain, inspect the page’s print stylesheet or inject a print-specific stylesheet with a browser-automation tool. The command-line flag alone cannot rewrite the site’s CSS.

Rank #2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

Background graphics

Whether background colors and images appear depends on the browser’s print behavior and the page’s print settings. If a background is essential, verify the resulting PDF rather than assuming screen appearance will match paper output. Edge’s print dialog exposes a background-graphics option for manual jobs.

Choosing the right PowerShell workflow

Approach Automation Rendering engine JavaScript and authentication Output and control
Headless Chrome/Chromium Unattended scripts and scheduled jobs Chromium Runs page JavaScript; authenticated pages require a usable browser profile, cookies, or other supported setup PDF file; command-line timing and header/footer controls
Microsoft Edge Print Manual, one-off conversion Chromium-based Edge Uses your interactive session, so signing in and reviewing the page is straightforward Print dialog; background graphics, system dialog, and selected-content options may be available
WebView2 PrintToPdf/PrintToPdfStream Application code WebView2 (Chromium) Suitable when your .NET application already hosts the page and controls its session Asynchronous file or in-memory stream, configured through print settings
wkhtmltopdf Unattended command line Qt WebKit Compatibility varies for modern CSS, JavaScript, fonts, authentication, and web components PDF file; separate engine with different layout behavior

Manual conversion with Microsoft Edge

  1. Open the URL in Edge and wait until the content you need is visible.
  2. Choose Settings and more > Print, or press Ctrl+P.
  3. Select the destination and print settings, including paper size, orientation, margins, and (when offered) background graphics.
  4. Save the PDF and open it to verify pagination, links, images, and any content loaded by JavaScript.

This route is appropriate when a person must inspect the page, complete a sign-in, or choose print options interactively. It is not a substitute for a repeatable unattended job.

Printing from a .NET application with WebView2

If your PowerShell task is part of a .NET application that already embeds WebView2, use its asynchronous PrintToPdf or PrintToPdfStream API. The former silently prints the current top-level document to a PDF file; the latter returns a stream for further processing. A print-settings object lets the application configure supported print properties.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WebView2 avoids spawning a separate browser process and can reuse the application’s navigation, cookies, and authentication state. It is therefore a better fit for a desktop or service application than for a short PowerShell script. You still need to wait until navigation and application rendering are complete before invoking print.

Using wkhtmltopdf from PowerShell

wkhtmltopdf is an open-source LGPL command-line renderer based on Qt WebKit. PowerShell can invoke it like any executable, but its engine is not Chromium. Test every target class of page before standardizing on it: modern CSS, JavaScript timing, web fonts, authentication, and custom elements can produce different output or fail to render.

Rank #3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • 1 Year License for 1 Windows & 2 Mobile (Android and/or iOS) devices.
$wkhtml = 'C:Program Fileswkhtmltopdfbinwkhtmltopdf.exe'
$url = 'https://example.com'
out = Join-Path $PWD 'page.pdf'

& $wkhtml $url $out
if ($LASTEXITCODE -ne 0 -or -not (Test-Path -LiteralPath $out)) {
    throw 'wkhtmltopdf failed'
}

Choose this engine only when its compatibility and deployment footprint match your pages. For sites built around current Chromium behavior, headless Chrome is the more direct baseline.

Operational checklist for reliable PDF jobs

  • Use absolute, unique output paths and verify the file after the process exits.
  • Quote URLs and paths that contain spaces or shell-significant characters.
  • Set a timeout appropriate to the slowest expected page, then validate the PDF’s content rather than trusting timing alone.
  • Use an isolated temporary browser profile for concurrent or unattended runs.
  • Keep credentials out of command-line arguments and logs where possible; command lines can be visible to process-inspection tools.
  • Test pages that require login, consent, geolocation, custom headers, or client-side API calls under the same account and network conditions as production.
  • Inspect page breaks, missing fonts, clipped tables, blank sections, and unexpected browser decoration.
  • Retain the process exit code and a useful error message so a scheduler can distinguish a successful PDF from a failed job.

Common failures and fixes

No PDF is created

Check the executable path, permissions, output directory, and whether another process is locking or replacing the file. Test with a simple public URL, then inspect the exit code and file check in the script.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The PDF is blank or missing the article

The page may still be rendering, may require JavaScript, or may have failed an API request. Increase --timeout, add a suitable --virtual-time-budget, and confirm the page works interactively. A bot challenge or authentication wall requires session handling or a different automation approach.

The URL, title, date, or page numbers remain

Ensure --no-pdf-header-footer is present. If the visible material is part of the site itself, remove it through the page’s print CSS or DOM automation; the flag affects only browser-generated decoration.

Images or colors are missing

Verify that resources load without authentication errors and that the page does not defer images until scrolling. Check print background settings and inspect the PDF on the same machine used for the job.

Rank #4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
  • EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
  • READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
  • CREATE, COMBINE, SCAN and COMPRESS PDFs.
  • FILL forms & Digitally Sign PDFs. Work with Digital certificates

Output differs from the browser or from another renderer

Different engines and print styles produce different pagination. Keep the renderer consistent, test representative pages, and do not assume wkhtmltopdf and Chromium will match.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup: ScreenshotNeo

ScreenshotNeo is a website screenshot API and MCP server for developers. Its PDF endpoint renders a live URL for you, so a PowerShell process does not need a locally installed browser. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page and billing result with X-Page-Verdict and X-Billed headers.

PowerShell/cURL request

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, add the API’s PDF option to the query string and save with a .pdf extension. The complete option list and response behavior are documented at https://screenshotneo.com/docs/.

Equivalent Python request

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Equivalent Node.js request

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also provides full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF paper size/margins/orientation/page ranges, custom CSS and JavaScript, clicks before capture, selector hiding, selector/delay/network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone and geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture for 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs are accepted to ease migration.

Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. Every feature is included on every plan: Free includes 1,000 shots per month with no card; Starter is $5 for 3,000; Growth $15 for 15,000; Pro $39 for 60,000; Scale $99 for 250,000; and Business $249 for 1,000,000. Yearly billing gives two months free.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo to get 1,000 free screenshots a month with no card.

Best Value
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

Which method should you use?

  • Use headless Chrome when you need a local, repeatable PowerShell script and can manage browser installation, profiles, and authentication.
  • Use Edge Print for a human-controlled one-off conversion.
  • Use WebView2 when a .NET application already owns the browser session and needs a file or in-memory stream.
  • Use wkhtmltopdf only after verifying that its Qt WebKit rendering matches your pages.
  • Use ScreenshotNeo when you want an API or MCP workflow, consent and popup cleanup, explicit billing outcomes, and no local browser setup.

Frequently Asked Questions

Can PowerShell convert a URL without installing a browser?

Not with a renderer-independent built-in command. A live page needs a rendering engine; use an installed browser, WebView2, wkhtmltopdf, or a hosted rendering API such as ScreenshotNeo.

Why does my PDF show an old version of the page?

A cache, service worker, or application data may be serving earlier content. Use a controlled browser profile, verify the page interactively, and configure caching behavior appropriate to your workflow.

Can I print only one element from a page?

The Chrome command-line print flag targets the document. Element-only output generally requires DOM automation or an API that supports a CSS selector, such as ScreenshotNeo’s element capture option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is a PDF generated from HTML guaranteed to be accessible?

No. Rendering a page to PDF does not guarantee correct tags, reading order, alt text, or keyboard semantics. Validate accessibility separately when the document has compliance requirements.

Quick Recap

Bestseller No. 1
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
Convert your PDF files into Word, Excel & Co. the easy way; Convert scanned documents thanks to our new 2022 OCR technology
Bestseller No. 2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.
Bestseller No. 3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$83.88
Bestseller No. 4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 5
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.

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.