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.

Pass a URL as the baseUrl argument when your HTML string contains relative images, stylesheets, scripts, or web fonts. EvoPdf resolves each relative reference against that URL before rendering. For example, images/chart.png resolves against https://www.example.com/reports/. If every resource already has an absolute URL, you can omit baseUrl. The URL only supplies resolution context; the EvoPdf conversion machine must still be able to reach the resulting resource and satisfy its authentication requirements.

What baseUrl does in an HTML-to-image conversion

An HTML string has no document address of its own. A reference such as <img src="images/logo.png"> is therefore incomplete until EvoPdf knows which directory should be treated as the document’s location. The HTML-to-image overloads that accept a base URL provide that missing context for relative images, CSS, JavaScript, and web-font URLs.

Use a base URL that matches the page or directory implied by your markup:

string html = @"<html>
<head>
  <link rel='stylesheet' href='css/report.css'>
</head>
<body>
  <img src='images/chart.png' alt='Sales chart'>
</body>
</html>";

byte[] image = converter.ConvertHtml(html, "https://www.example.com/reports/");

In this example, EvoPdf requests https://www.example.com/reports/css/report.css and https://www.example.com/reports/images/chart.png. The exact overload name and output settings depend on the EvoPdf edition and package version installed; use the HTML-string image overload documented for that installation.

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

When you do not need it

Fully qualified references already contain their own origin and path:

<img src="https://cdn.example.com/images/chart.png">
<link rel="stylesheet" href="https://cdn.example.com/css/report.css">

Those references do not require a base URL. A base URL also cannot repair a misspelled path, a blocked host, a 401 response, or an asset that is generated only after JavaScript runs.

Choose the correct base URL

Match the directory semantics

Relative URLs are resolved according to normal URL rules. A trailing slash matters: https://example.com/reports/ treats images/a.png as a child of reports, while a URL ending in a file-like segment can produce a different result. If your HTML was copied from a page, use that page’s effective directory as the base and verify the final URLs in a log.

Remote resources

The URL must be reachable from the server or worker process performing conversion, not merely from your desktop browser. Localhost bindings, private networks, firewalls, DNS rules, and corporate proxies can make an otherwise valid URL inaccessible to EvoPdf.

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

Local resources

Do not pass a raw Windows path as a URL. Use a file URL. EvoPdf’s troubleshooting material shows the form file:///C:imagesimage.jpg. Ensure the conversion account has read permission and that every relative reference resolves within an accessible local location.

Complete C# pattern

The following example keeps the HTML self-contained except for relative assets and passes the base URL to the HTML-string conversion method:

using System;
using System.IO;
using EvoPdf;

class Program
{
    static void Main()
    {
        var converter = new HtmlToImageConverter();
        converter.NavigationTimeout = 60;

        string html = @"
<!doctype html>
<html>
<head>
  <meta charset='utf-8'>
  <link rel='stylesheet' href='css/report.css'>
</head>
<body>
  <h1>Quarterly report</h1>
  <img src='images/chart.png' alt='Quarterly chart'>
</body>
</html>";

        byte[] png = converter.ConvertHtml(html, "https://www.example.com/reports/");
        File.WriteAllBytes("report.png", png);
    }
}

Use the corresponding file, stream, memory-buffer, or tiled HTML-string overload if your edition exposes a different output workflow. The important part is that the overload receives the base URL alongside the HTML string.

Diagnose missing images and CSS in order

  1. Find relative references. Search the HTML and linked stylesheets for paths beginning with ./, ../, or a bare folder name such as images/ and css/.
  2. Pass the intended base. Set baseUrl to the page or directory from which those paths were designed to resolve. Do not guess from the location of your C# source file.
  3. Calculate the final URL. For images/chart.png and https://example.com/reports/, the expected URL is https://example.com/reports/images/chart.png. Log it or test it explicitly.
  4. Test from the conversion host. Use the same machine, container, service account, proxy, and DNS environment as EvoPdf. A URL that works in your browser may be unavailable there.
  5. Check status and permissions. Confirm that the resource returns the expected content rather than a login page, redirect loop, 403, or 404. Verify filesystem permissions for local files.
  6. Supply authentication. Protected resources may require HTTP headers or cookies. Configure EvoPdf’s request-header and cookie facilities for the installed edition, and make sure credentials are also sent when dependent images or CSS are fetched.
  7. Wait for asynchronous content. If JavaScript inserts an image after navigation, use an appropriate conversion delay or trigger conversion manually after the page is ready. A delay does not fix an incorrect URL or an inaccessible host.

Headers, cookies, timeouts, and resource downloading

Setting or condition What it affects How to use it
NavigationTimeout How long navigation can wait The documented default is 60 seconds; increase it only when a reachable page genuinely needs more time.
HttpRequestHeaders Headers on requests Use for authorization or other server-required request metadata.
PersistentHttpRequestHeaders Whether custom headers continue to resource requests Enable or configure it when images and CSS need the same headers as the document.
HttpRequestCookies Session and authentication cookies Supply cookies through EvoPdf’s cookie mechanism; support guidance identifies this as the preferred approach.
DownloadAllResources Attempts to download all resources Investigate it when appropriate, but expect slower conversion and do not treat it as a substitute for URL and access checks.
Conversion delay or manual trigger Content built after initial navigation Use after URL resolution and authentication are confirmed.

Property names and defaults can vary between EvoPdf editions. Check the API reference that matches the assemblies deployed with your application rather than copying settings from a different package.

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

Relative, absolute, remote, local, and protected assets

Asset situation Base URL needed? Additional requirement
Relative URL to a public remote asset Yes Conversion host must reach the resolved URL.
Absolute public URL No Host must still reach the URL.
Local file referenced relatively Yes, using a file URL context Use file:/// form and grant read access.
Protected remote asset Usually, if the path is relative Forward the required cookies, headers, or authentication.
JavaScript-generated asset Possibly Allow execution and wait for the generated content.

Common failures and fixes

Images and CSS are both missing

This usually means relative URLs have no resolution context or the base points at the wrong directory. Add the correct base URL, calculate one final URL, and request it from the conversion machine.

The base URL is correct, but the asset is still blank

Check network reachability, DNS, firewall rules, TLS interception, HTTP status, and authentication. Inspect the response body: an HTML sign-in page is not a usable stylesheet or image.

It works locally but fails in production

The production converter may run in a container or account without access to your workstation, VPN, mapped drive, or localhost service. Publish the asset where that host can reach it, or use an accessible file URL and permissions.

CSS loads but fonts do not

Web-font URLs are resources too. Resolve their relative paths against the same appropriate base, then verify that font requests receive required headers or cookies and that the converter can reach the font host.

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

Content appears only after a delay

Confirm the final asset URL first. Then configure ConversionDelay or a manual conversion trigger long enough for the page’s asynchronous work. Increasing the timeout alone does not guarantee that conversion waits for a late DOM update.

Local path errors

Replace a raw path such as C:imageslogo.png with the documented file-URL form, for example file:///C:imageslogo.png, and test under the identity that runs EvoPdf.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance and reliability considerations

  • Use absolute URLs when you control the HTML and want to remove ambiguity; use baseUrl when preserving portable relative markup is more practical.
  • Keep the base URL stable and close to the actual asset directory to avoid redirects and unnecessary network work.
  • Download or host critical assets where the conversion service has predictable latency and permissions.
  • Set a timeout appropriate to the page, but investigate slow DNS, blocked requests, and oversized resources before simply raising it.
  • For large pages, consider the edition’s resource-download and tiled-output capabilities, recognizing that downloading all resources can increase conversion time.
  • Log the HTML, base URL, resolved resource URLs, response status, and conversion settings for reproducible incident diagnosis; never log secrets.

Or skip the browser setup

If your actual goal is a clean screenshot of a live URL rather than rendering an HTML string inside EvoPdf, ScreenshotNeo provides a one-request API. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf.

cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

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

Node.js:

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

See the ScreenshotNeo API documentation for output and options. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account to try it.

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

FAQ

Does baseUrl download files into my application?

No. It tells EvoPdf how to resolve relative references during conversion; the converter still fetches each resource and must be able to access it.

Can I use a raw Windows directory as baseUrl?

Use a properly formed file:/// URL instead of a raw filesystem path, then verify permissions under the conversion account.

Why is a PDF support example relevant to image conversion?

The documented PDF example demonstrates the same HTML-string base-URL concept. Apply the analogous overload for your installed HTML-to-image API and output format.

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.

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.