What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Set the virtual display size in xvfb-run, not with DPI. Pass Xvfb a screen definition in the form WIDTHxHEIGHTxDEPTH:
xvfb-run --server-args="-screen 0 1920x1080x24" wkhtmltopdf --use-xserver input.html output.pdf
xvfb-run --server-args="-screen 0 1920x1080x24" wkhtmltoimage --width 1920 --height 1080 --disable-smart-width input.html output.png
The Xvfb geometry controls the virtual X display. wkhtmltoimage then applies its own image viewport settings, while wkhtmltopdf uses the X display when its build requires one.
How the resolution settings fit together
There are several independent layers, which is why changing one flag often appears to do nothing.
| Layer | Setting | What it controls |
|---|---|---|
| Xvfb virtual display | --server-args="-screen 0 WIDTHxHEIGHTxDEPTH" |
The virtual screen width, height and color depth. |
| wkhtmltopdf | --use-xserver |
Tells builds that need X to use the X server supplied by xvfb-run. |
| wkhtmltoimage | --width, --height |
The image renderer’s screen-width and screen-height guides. |
| wkhtmltoimage | --disable-smart-width |
Keeps the requested width strict instead of allowing smart-width adjustment. |
| wkhtmltopdf | --dpi |
Output DPI-related behavior; it does not change X11 screen geometry. |
| Library/API callers | screenWidth, smartWidth |
Image settings corresponding to renderer viewport behavior, separate from Xvfb geometry. |
Think of Xvfb as the desktop-sized canvas and wkhtmltoimage as the program deciding how much of that canvas to use. A larger virtual display does not, by itself, force every renderer output to have the same pixel dimensions.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Set the screen resolution for wkhtmltopdf
Use this pattern when generating a PDF from an HTML file or URL:
xvfb-run --server-args="-screen 0 1920x1080x24" wkhtmltopdf --use-xserver input.html output.pdf
- Choose the geometry. Replace
1920x1080x24with the width, height and depth your layout needs. The final value,24, is the color depth; it is not a second height or a DPI value. - Pass it through
--server-args. The option belongs toxvfb-run. Its quoted value is forwarded to Xvfb. - Keep wkhtmltopdf options after the Xvfb wrapper. Put
--use-xserverand the input/output arguments on the wkhtmltopdf command. - Verify the resulting PDF. If the page still wraps unexpectedly, inspect the PDF’s page-size and layout options separately; changing X11 geometry is not a substitute for PDF page configuration.
For a URL, replace input.html with the URL, for example:
xvfb-run --server-args="-screen 0 1366x768x24" wkhtmltopdf --use-xserver https://example.com report.pdf
The exact need for --use-xserver depends on the wkhtmltopdf build. Include it when that build requires an X server; it makes the dependency explicit and works with the X display created by xvfb-run.
Set the screen resolution for wkhtmltoimage
wkhtmltoimage has renderer-level width and height controls, so set both the Xvfb display and the image viewport when you need predictable output:
xvfb-run --server-args="-screen 0 1920x1080x24" wkhtmltoimage --width 1920 --height 1080 --disable-smart-width input.html output.png
Here, Xvfb creates a 1920 by 1080 display at 24-bit depth. wkhtmltoimage receives the same width and height as its screen guide, and --disable-smart-width prevents smart-width behavior from widening the requested image.
Capture a fixed-width image
If the required contract is an exact width, keep --width and --disable-smart-width together:
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
xvfb-run --server-args="-screen 0 1200x900x24" wkhtmltoimage --width 1200 --height 900 --disable-smart-width https://example.com page.png
Use a virtual height that is at least as large as the viewport you expect the page to occupy. For a full-page capture, the renderer’s page behavior determines how the document extends beyond the initial viewport; the Xvfb width still needs to accommodate the intended layout.
Why an image may still look like 800 by 600
That result usually means only one layer was changed. Check all three values:
- The
-screen 0 WIDTHxHEIGHTxDEPTHargument passed to Xvfb. - The wkhtmltoimage
--widthand--heightvalues. - Whether smart-width behavior was disabled when strict width was required.
Changing --dpi will not resize the X11 display. On X11-based systems, wkhtmltopdf documentation states that its DPI option has no effect on X11 geometry.
Understand the -screen 0 WIDTHxHEIGHTxDEPTH syntax
The Xvfb manual defines -screen screennum WxHxD. In the common form -screen 0 1920x1080x24:
0is the screen number.1920is the screen width in pixels.1080is the screen height in pixels.24is the color depth.
Do not write spaces inside the geometry token. The complete server argument is normally quoted so the shell passes it as one value:
--server-args="-screen 0 1920x1080x24"
xvfb-run starts Xvfb, runs the wrapped command against that display, and handles the temporary display setup. The resolution is therefore selected before wkhtmltopdf or wkhtmltoimage starts.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Distribution defaults and reproducible builds
The default Xvfb geometry is package-specific. Debian testing documents a default of 1280x1024x24, while older Ubuntu and Debian manual pages document other defaults. A command that omits --server-args can consequently produce different wrapping or image dimensions after a package or distribution change.
For repeatable CI and production output, always specify the geometry explicitly. Record the width, height and depth alongside the wkhtmltopdf or wkhtmltoimage command, and use the same values in local debugging and automation. If you intentionally depend on a distribution default, document the package version and distribution because that default is not universal.
Library and API settings
If you call the renderer through a library instead of the command line, look for the image settings named screenWidth and smartWidth. They control renderer behavior and are separate from the Xvfb screen geometry.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Set
screenWidthto the intended pixel width when the library exposes that setting. - Turn the library’s
smartWidthswitch off when the requested width must remain strict. - Still configure Xvfb with
-screen 0 WIDTHxHEIGHTxDEPTHwhen the library depends on an X display.
Matching the values across both layers avoids a narrow virtual screen constraining a wider renderer request, while keeping the distinction clear when diagnosing output-size problems.
Or skip the browser setup
If you need a remote website screenshot rather than a local wkhtmltopdf or wkhtmltoimage process, ScreenshotNeo provides a single HTTP request that returns PNG, JPEG, WebP or PDF. It removes cookie and consent banners, newsletter popups and chat widgets before capture. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
The API accepts the URL and capture controls without requiring you to install Xvfb or configure a browser display. The complete option set includes full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets or a custom viewport, retina scale, PDF paper size/margins/orientation/page ranges, custom CSS and JavaScript, pre-capture clicks, hidden selectors, waits for selectors/delays/network idle, blocked ads/trackers/requests/resource types, custom headers/cookies/user agent/Authorization, timezone and geolocation, transparent backgrounds, image resizing, configurable-TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API and an OpenAPI specification. Existing integrations can also use the parameter names used by other screenshot APIs.
cURL (see the ScreenshotNeo documentation):
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}`);
An MCP server supplies take_screenshot, get_page_info and capture_pdf tools to Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account to get started.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Troubleshooting checklist
The command says it cannot open a display
Confirm that the command is wrapped by xvfb-run and that the Xvfb package is installed. Keep the wkhtml command inside the wrapper; running wkhtmltopdf separately will not inherit the temporary display.
The page is clipped or wraps at the wrong breakpoint
Increase the Xvfb width and set the same intended width with wkhtmltoimage’s --width. If exact width matters, add --disable-smart-width. For wkhtmltopdf, inspect PDF page and margin settings separately because Xvfb geometry does not define PDF paper size.
Changing DPI had no visible effect
That is expected for X11 geometry. Replace the DPI change with an explicit --server-args="-screen 0 WIDTHxHEIGHTxDEPTH" value and, for images, set --width and --height.
Output differs between machines
Compare the installed Xvfb and wkhtml packages and look for an omitted geometry argument. Distribution defaults vary, so make the screen definition explicit in every automated command.
Recommended Free Tools
The requested image width is not respected
Check that the command is using wkhtmltoimage rather than wkhtmltopdf, that --width is present, and that --disable-smart-width follows the renderer options. Also verify that the Xvfb width is not smaller than the requested viewport.
Practical configuration checklist
- Choose width, height and depth deliberately.
- Pass them through
xvfb-run --server-args. - Use
--use-xserverfor wkhtmltopdf builds that require X. - Set wkhtmltoimage
--widthand--heightwhen producing images. - Use
--disable-smart-widthfor a strict image width. - Do not treat
--dpias an Xvfb resolution switch. - Record the explicit geometry so CI and local runs use the same display.
FAQ
Where should --server-args appear when the renderer has many options?
Put it on xvfb-run before the wkhtml command. Renderer-specific flags such as --use-xserver, --width and --disable-smart-width belong after the wrapper command.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Is the depth value another resolution dimension?
No. In WIDTHxHEIGHTxDEPTH, the third value is color depth. Width and height are the two pixel dimensions.
Do I need both Xvfb geometry and renderer dimensions?
For wkhtmltoimage, use both when you need predictable viewport output. Xvfb defines the available virtual display; wkhtmltoimage’s width, height and smart-width settings define how the image renderer uses it.
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 minuteFrequently Asked Questions
Can I use a different screen number than 0?
Yes, Xvfb’s syntax names the screen explicitly, but the standard xvfb-run examples and the commands here use screen 0. Keep the number consistent with the server arguments your wrapper starts.
Does a larger Xvfb display automatically create a larger PDF?
No. Xvfb supplies the virtual X geometry; wkhtmltopdf’s PDF page, margin and layout settings remain separate.
What should I change first when a responsive page selects the wrong breakpoint?
Set an explicit Xvfb width, then align wkhtmltoimage’s width with it and disable smart-width if the image width must be exact.
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.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →

