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

Start by marking the Arabic text as right-to-left with dir="rtl", then verify that it looks correct in the browser before capturing it. For mixed Arabic and Latin text, isolate the left-to-right fragment with <bdi dir="ltr"> when needed. Also check that the Arabic-capable font has loaded and that your installed html2canvas version handles CSS direction as expected. These steps address common causes, but no single CSS rule guarantees every mixed-script capture will be correct.

Why Arabic can look different in an html2canvas capture

html2canvas does not simply save the browser’s displayed pixels. It rebuilds a representation of the page from the DOM and CSS, then draws that representation. Its FAQ warns: “Every CSS property must be manually implemented to render correctly, so html2canvas will never have full CSS support.” That limitation can matter when the source page looks right but the generated image does not.

Arabic rendering is not one problem with one cause. Check three separate things: whether Arabic letters join and shape correctly, whether the overall text run flows in the right direction, and whether punctuation, numbers, or Latin fragments appear in the intended order. A capture can get one of these right and another wrong.

Mark Arabic direction in the HTML

Use direction markup on the Arabic content itself. The language and direction attributes communicate different information: lang="ar" identifies the language, while dir="rtl" sets the text direction. Do not rely on the language declaration to imply direction.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
MIKUSO Arabic English Keyboard,Wired Keyboard Not Fading Bilingual Letters
  • Arabic English Letters:This USB wired keyboard adopts advanced laser engraving technology, which will not fade when typing for a long time, allowing you to clearly see letters and symbols, bidding farewell to the trouble of character wear and tear causing unclear reading
  • Waterproof and anti slip: The keyboard is waterproof, comfortable to the touch, Reduce finger pressure.with a wire length of 1.6 meters and anti slip silicone pad on the back, making the keyboard work efficiently,The space bar has a crisp sound, not silent
  • Arabic QWERTY English 104 key keyboard layout with numeric keypad,Has all Arabic letters including commonly missed ones (see pics), suitable for offices and work. There are uppercase lock indicator lights and numeric lock indicator lights in the upper right corner of the keyboard
  • Efficient office work: The wired keyboard has 12 multimedia shortcut key combinations for instant access to music, volume, computer, email, and more.The space bar has a normal tapping sound, not a quiet keyboard
  • Plug and play: wired USB interface, no need to download programs, saving the trouble of replacing batteries or charging, suitable for Windows, Android, smart TV and Mac (Note:Mac systems may not be compatible with multimedia buttons)
<p lang="ar" dir="rtl">مرحبا بالعالم</p>

Apply the direction at the narrowest element that represents the Arabic text. If a whole paragraph or interface region is Arabic, mark that region. This is clearer and more robust than trying to correct the captured image after the fact.

Keep the characters in logical order

Store and write Arabic text in its normal logical character order. Do not reverse the string as a general workaround. Reversing characters can break joining, punctuation, numbers, selection, and the relationship between the displayed text and the underlying text.

Handle embedded Latin text and numbers

Arabic pages commonly contain left-to-right material such as a product name, URL, email address, version number, or code. Unicode bidirectional behavior depends on surrounding context, so direction: rtl alone does not settle every punctuation or ordering case.

Rank #2
M MC Saite MCSaite Wired Arabic/English Computer Keyboard, Full-Size Keyboard, 104-keys, USB Plug-and-Play, Foldable Stands, Compatible with PC, Laptop
  • Standard USB Arabic Keyboard - Offers 104 keys, including navigational controls, full functions and a 10-key keypad.
  • Ample Wire Length Connection - Keyboard's 5-ft. wired connection gives you plenty of room to setup your keyboard where you want it.
  • Comfortable switch - Provides you with improved typing speed and accuracy. Over 15 million keystroke tests, keyboard is durability.
  • High Quality ABS Production - Use strong grade and strong, environmental protection materials, the keyboard bottom has anti-slip mat, will not move, convenient your work.
  • USB PLUG AND PLAY, no additional driver needed.Compatible with Windows 7, Vista, XP, 2000 and 98.

When an embedded fragment should read left-to-right, isolate it explicitly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<p lang="ar" dir="rtl">
  تفضل بزيارة <bdi dir="ltr">example.com</bdi> للمزيد.
</p>

<bdi> isolates the fragment from the surrounding bidirectional text. Use it for a specific Latin run whose placement or punctuation is ambiguous, rather than wrapping unrelated content indiscriminately. Check the rendered result with the actual surrounding words and punctuation; bidirectional ordering is contextual.

Check the font and the browser before capturing

  1. Load the page in the target browser. Inspect the Arabic before invoking html2canvas. If it is already misaligned, fix the page’s markup, direction, or font loading first.
  2. Confirm the intended font is applied. Make sure an Arabic-capable font is available and has finished loading before capture. No particular font is a universal requirement; the right choice depends on your design and deployment.
  3. Wait for fonts when capturing programmatically. In a browser that supports the Font Loading API, awaiting document.fonts.ready before capture can help ensure the page has finished loading fonts.
  4. Capture a small test case. Compare an Arabic-only line with a second line containing Arabic, Latin text, punctuation, and digits. Small examples make it easier to identify the symptom.

Use a minimal browser capture to diagnose the result

First make sure the target element is directionally marked in the HTML. Then capture it and inspect the output separately from the live page. This small example assumes html2canvas is installed in a project with a browser bundler and that the target element exists in the document:

Rank #3
M MC Saite Arabic and English 78 Keys Wired Mini Keyboard - with Keyboard Cover USB Computer keypad for Laptop MAC Windows 10/8 / 7 / Vista/XP
  • Portable 78-Key Computer Wired Keyboard, signal transmission is stable, and the line length is 1.3 meters (equal to 51 inches). Size:28x12x1.8cm
  • Comfortable switch - Provides you with improved typing speed and accuracy. Over 15 million keystroke tests, keyboard is durability.
  • High Quality ABS Production - Use strong grade and strong, environmental protection materials, the keyboard bottom has anti-slip mat, will not move, convenient your work.
  • FN Shortcuts - Easy access to media controls such as playback, pause, next and previous tracking, increase volume, etc. The Number Function keys Hide under the letter, saving your space, and more convenient and fast.
  • Simple Plug and PLay for Windows - Compatible with desktops and laptops with Windows 10, Windows 8, 7, Vista, XP, Chrome OS.
import html2canvas from "html2canvas";

async function saveArabicCapture() {
  await document.fonts.ready;

  const target = document.querySelector("#arabic-content");
  if (!target) {
    throw new Error("Could not find #arabic-content");
  }

  const canvas = await html2canvas(target);
  const link = document.createElement("a");
  link.download = "arabic-capture.png";
  link.href = canvas.toDataURL("image/png");
  link.click();
}

saveArabicCapture();

For example, the element might contain <div id="arabic-content" lang="ar" dir="rtl">مرحبا بالعالم</div>. Run this in the page after the target content exists. If your app uses a different module setup, adapt the import to that setup; the important diagnostic is to capture the same DOM that you just checked in the browser.

Check your installed html2canvas version

The inspected current upstream canvas renderer copies parsed CSS direction to CanvasRenderingContext2D.direction before drawing text. That is evidence about that source snapshot, not a guarantee about every published release or every application’s dependency. Check the version your project actually resolves and, if direction handling is in question, inspect the matching release or source rather than assuming current upstream behavior applies.

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

The Canvas 2D API has a direction property with ltr, rtl, and inherit values. MDN reports broad browser availability since May 2022; that is a browser-availability date, not a success rate for Arabic rendering. Since html2canvas’s current renderer sets the property from CSS direction, manually editing a canvas context is not a general first fix. Investigate a particular version or use case before adding version-specific code.

Rank #4
JPYXKM Wireless Arabic Keyboard, Minority Language Ultra Thin Lightweight Silent Bluetooth Keyboards for Laptop/PC/Tablet/Desktop/Smart TV (Arabic)
  • 【ENHANCE YOUR WORKSPACE】Whether you are working from home or taking online courses, our keyboard will give you slim size, comfortable and ergonomic feel. Purpose built for Windows/Apple/Androids Systems, it features a 78-key layout, 6 multimedia keys, 10 languages, 13 shortcut keys, and visually stunning aluminum body.
  • 【STRONG WIRELESS CONNECTION】Connect With Bluetooth 3.0, the cordless keyboard establishes a stable connection from up to 32ft away via Bluetooth. This eliminates excess cables and clutter, providing a clean workspace.
  • 【A SOPHISTICATED TYPING EXPERIENCE】Each keycap on our low profile wireless USB keyboard is designed with a concave shape and scissor flexor technology. This allows for smooth and responsive keystrokes. Also, for wrist comfort, an angled kickstand is integrated.
  • 【SIMPLE SETUP】This slim keyboard is completely connect and play. Simply connect Bluetooth with your computer and begin. Also, two AAA batteries provides up to 2-3 months of run time. (not include batteries).
  • 【ADD LANGUAGES LAYOUT ON PC】-Open the start menu and select "Control Panel". -Select "Change keyboards or other input methods" under the Clock, Language, and Region section. -In the new window, click on the button that says "Change keyboards...". -Another window will open and show all currently installed keyboards. -Click "Add..." -International should now show on the list of keyboards installed. Click "Apply" and then "OK".

Troubleshoot the specific symptom

What you see What to check Next step
The browser page is already wrong HTML direction, placement of dir="rtl", and whether the intended font is applied Correct the source page first; html2canvas cannot repair text that is already rendered incorrectly.
The browser is correct, but Arabic letters do not join or shape correctly in the capture The Arabic font and the installed html2canvas version’s rendering behavior Reduce the page to one Arabic line and compare its capture in the actual browser and dependency version.
Arabic reads in the right direction, but a URL or Latin phrase moves unexpectedly Mixed-direction boundaries and surrounding punctuation Try isolating the LTR fragment with <bdi dir="ltr">, then inspect the full sentence.
Digits or punctuation appear on the unexpected side The characters immediately around the digits or punctuation, not just the paragraph’s base direction Test the smallest affected phrase in context. Do not assume one direction rule fixes every bidirectional ordering case.
The result varies between machines or runs Whether the same font is available and loaded at capture time, and whether the browser and library versions match Make font readiness and the capture environment explicit, then compare a reproducible minimal example.
An image or other page content is missing Whether the source asset loaded and whether browser cross-origin restrictions affect image or canvas access Resolve the asset or security issue independently of the Arabic text; html2canvas documents browser compatibility and cross-origin limits.

Be cautious with legacy reshape-and-reverse snippets

A historical html2canvas issue records reports of Arabic font rendering and punctuation-direction problems. It shows that developers have encountered these symptoms; it does not establish that a particular workaround is universal or current. Avoid snippets that reshape and reverse text unless you have validated their effect on joining, punctuation, digits, logical text order, and any interaction that relies on the original string.

If the browser display is correct but the capture remains wrong, strip the example down to one Arabic-only line and one mixed-script line. Record the browser and installed html2canvas version, then compare the behavior against that version’s implementation and issue tracker. This separates a direction-markup problem from a limitation or regression in the capture path.

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

Or skip the browser setup

If you need a screenshot of an already-hosted Arabic page rather than a canvas produced inside your app, ScreenshotNeo offers a website screenshot API. It captures a URL as an image or PDF; it is not a drop-in replacement when your requirement is specifically to render a selected DOM node with html2canvas. Use a URL for the page you want to capture in place of the example below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
3PCS Arabic Keyboard Stickers for Laptop, MacBook Air/Pro, Desktop PC Computer, Replacement Keyboard Stickers, Orange Arabic Lettering with Non Transparent Black Background
  • COMPATIBILITY: The Arabic-English stickers which are designed for Apple Macbook, HP, Acer, Lenovo and Dell Laptops and other computers, desktops keyboards.
  • RENEW YOUR WORN-OUT KEYBOARD: It's a great way to update your keyboard worn-out letter keys with a different fresh new look,and Matte process with better touch feeling.
  • EASY TO APPLY AND REMOVE: Blend well with your keyboard, you can easily convert your keyboard keys to another language and no residue leaves on your keyboard when you remove it.
  • SAVES MONEY AND KEEP NEW LOOK: No need to buy another expensive multilingual keyboard ever again. And it will will help to protect your keyboard from small scratches and keep it clean and nice!
  • PACKAGE INCLUDES: 3pcs of keyboard replacement stickers, you can change it when it wear or fade at any time.

cURL:

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

Python:

import requests

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

Node.js:

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

See the ScreenshotNeo API documentation for request options. Its pre-capture cleanup can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients.

The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 screenshots. See ScreenshotNeo for plan details. Sign up for free and get 1,000 screenshots a month with no card.

Practical reliability and cost notes

  • For html2canvas, treat the source page and the captured canvas as separate outputs to verify. A correct live page does not prove the library’s reconstructed rendering will match it.
  • Keep a small Arabic-only and mixed-direction fixture in your own browser test process when upgrading html2canvas or changing fonts. Compare the same browser and dependency versions to avoid conflating environment changes with markup changes.
  • For any capture path, cross-origin image restrictions and page load failures are distinct from text direction. Diagnose those separately rather than changing bidi markup to solve a missing asset.
  • For URL-based API capture, inspect the response’s verdict and billing headers as well as the output. ScreenshotNeo identifies whether a page was clean and whether the request was billed.

Frequently Asked Questions

Does setting `lang=”ar”` make an element right-to-left?

No. `lang` identifies the language; set `dir=”rtl”` to specify direction.

Should I reverse Arabic text before calling html2canvas?

No. Keep characters in logical order; manual reversal can damage shaping, punctuation, digits, and the underlying text.

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

Is ScreenshotNeo a replacement for capturing a DOM element with html2canvas?

Not when the requirement is a selected in-page DOM node. ScreenshotNeo captures a hosted page by URL.

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.