October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Screenshot a Webpage with Right-to-Left Text Using Playwright

Learn how to capture right-to-left pages with Playwright, set direction correctly, wait for fonts and content, and choose viewport, full-page, or element screenshots.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the page’s base direction to right-to-left, wait for fonts and application content to finish rendering, then capture the viewport, full page, or a specific element with Playwright. Locale emulation alone does not make a page render right to left.

Set the page direction before capturing

For a page you control, declare its language and base direction on the root element. For example: <html lang="ar" dir="rtl">. Use lang to identify the language and dir to set direction; one does not substitute for the other. MDN notes that “The lang attribute declares the language, but does not imply the base direction.” See MDN’s dir reference.

As an Amazon Associate I earn from qualifying purchases.

Direction affects more than text alignment. It also influences the ordering of mixed-direction text and where punctuation appears. Mark embedded left-to-right text explicitly when necessary, such as <span lang="en" dir="ltr">Playwright</span> inside an RTL paragraph. For text whose direction is unknown, dir="auto" chooses a base direction from the first strongly directional character; it is a heuristic, not language detection.

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

If the target page is not yours, it needs to set direction correctly already, or you must deliberately modify it before the capture. Prefer semantic HTML direction attributes over CSS direction where possible. Playwright’s locale emulation changes locale-related browser behavior, not the target document’s dir attribute; see Playwright’s emulation documentation.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • 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

Capture an RTL page with Playwright

This Node.js example navigates to a page, waits for network activity to settle and web fonts to resolve, then saves a full-page PNG. Replace the URL with your target page.

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();

try {
  await page.goto('https://example.com', { waitUntil: 'networkidle' });
  await page.evaluate(() => document.fonts.ready);
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

Install Playwright in your project before running the script, and ensure the browser binaries it uses are installed. The Playwright screenshots guide covers capture workflows; check the Page API reference for options and defaults for your installed Playwright version.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • 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

Wait for the right readiness condition

networkidle is a useful example, not a universal choice. Applications with persistent network activity may never reach that state. If the page loads data asynchronously, wait for an application-specific signal such as a result element becoming visible, or use an appropriate fixed delay only when the page has no better readiness indicator. Waiting for fonts does not wait for application data or image content.

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.

document.fonts.ready resolves when the document’s font set has resolved and layout is complete. This helps avoid capturing fallback fonts before web fonts render. See the CSS Font Loading API documentation.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • 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.

Choose what to capture

Use a viewport screenshot for the currently visible browser area, fullPage for the scrollable document, or a locator screenshot for one element. The screenshot() method saves to the specified path and also returns an image buffer.

  • Viewport: await page.screenshot({ path: 'viewport.png' });
  • Full page: await page.screenshot({ path: 'full.png', fullPage: true });
  • One element: await page.locator('main').screenshot({ path: 'main.png' });
  • In memory: const buffer = await page.screenshot();

PNG is the default screenshot type. A path extension can select a supported image format; consult the Page API reference for the installed version’s options.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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

Check RTL rendering and keep comparisons consistent

Inspect the resulting image when correctness matters. In Arabic or Hebrew, check glyph shaping, mixed-script punctuation, clipping, and whether the intended font loaded. A screenshot records the rendered page; it cannot correct a page whose direction is wrong.

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

For visual regression tests, Playwright Test’s expect(page).toHaveScreenshot() waits for two consecutive screenshots to match before comparing against a baseline. Rendering can vary with operating system, browser version, settings, hardware, power conditions, and headless mode. Keep those conditions controlled when maintaining baselines. See Playwright’s visual comparisons guide and the PageAssertions API.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common capture problems

  • Arabic or Hebrew appears left-to-right: Check that the target document sets dir="rtl" on its root element. A Playwright locale setting or lang attribute does not set base direction.
  • Embedded English text or punctuation looks misplaced: Add explicit dir="ltr" to the inline left-to-right content, and inspect the surrounding RTL text’s markup.
  • The screenshot uses the wrong font: Wait for document.fonts.ready after navigation, then verify that the expected font actually loaded.
  • Content is missing or still loading: Wait for a page-specific element or application readiness signal. A completed font load does not guarantee that asynchronous data or images are ready.
  • The script hangs at networkidle: The page may keep network connections active. Choose a readiness condition suited to the application instead of waiting indefinitely for network inactivity.
  • A visual test differs across runs or machines: Compare in a controlled browser and host environment, since rendering can vary across systems and configurations.

Or skip the browser setup

ScreenshotNeo offers a screenshot API and MCP server. One GET request can return an image or PDF; its clean-shot steps accept consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture. Those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides screenshot tools for AI agents.

To capture a page, use the supplied API call and replace the target URL. See the ScreenshotNeo documentation for setup and options.

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

The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

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

Frequently Asked Questions

Does Playwright’s locale setting make a page right to left?

No. Locale emulation and the document’s base direction are separate; the page needs an appropriate dir attribute or an intentional change before capture.

Can I save the screenshot without writing it to a file?

Yes. page.screenshot() returns an image buffer when called without a path.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.