ScreenshotNeo

BlogHow-to

How to Use URL2PNG to Capture Hindi Web Pages Correctly

Capture Hindi pages with URL2PNG by checking the page’s Devanagari font, locale, viewport, and readiness before diagnosing the image.

By the ScreenshotNeo team4 October 20269 min read

To capture a Hindi page correctly with URL2PNG, first confirm the page contains the intended Hindi content and uses a font with Devanagari glyph coverage. Then build and sign the URL2PNG v6 request using the exact query string you will send, choose a suitable viewport, and wait for the page and its fonts to be ready. Use accept_languages only when the site selects content from the request language; it does not install a font or fix missing glyphs.

This guide follows URL2PNG’s documented v6 controls. Its general web-font support is not a Hindi-specific rendering guarantee, so inspect the resulting image rather than treating a successful response as proof that Hindi rendered correctly. URL2PNG Quickstart · Google Fonts setup guide · Google Fonts technical notes.

1. Check the page and font before capturing

A screenshot service renders what the page presents. Hindi text can appear as boxes, blank space, fallback text, or incorrect content if the expected characters are absent, the selected font lacks the needed Devanagari glyphs, a remote font cannot load, or capture happens before that font is ready. These are diagnostic possibilities; they are not findings about a specific URL.

  1. Open the target page in a browser and verify that the content itself is Hindi.
  2. Inspect the page’s CSS font-family and confirm the chosen font covers Devanagari. Include a generic fallback family.
  3. If the page uses a remote font, verify that its stylesheet and font file can load in the browser environment. Google Fonts describes linking its stylesheet and applying the family in CSS; its technical notes explain that browsers may display fallback text or blank space while a font loads.
  4. Check whether the text is inserted dynamically. A font-ready signal alone does not guarantee that application content has appeared.

Keep three questions separate: did the site deliver the right Hindi content, does an available font cover it, and did capture wait long enough? A language header addresses only locale negotiation.

2. Build a signed URL2PNG v6 request

URL2PNG v6 uses an API key and a token derived from the full query string plus your secret. Generate the token using URL2PNG’s documented signing procedure. Sign the exact query string that will be sent: changing the target URL or any option changes the signed string. Keep the secret on a server you control; do not put it in browser code or a public page.

The signing details and legacy examples can vary by protocol version. Use the current v6 instructions from the official Quickstart instead of copying an older client example. The following Python example shows the safe request-building structure; fill in the token with the result of URL2PNG’s documented v6 signing procedure.

import requests

api_key = "YOUR_API_KEY"
target_url = "https://example.com/hi/"
# Generate this from the exact v6 query string using URL2PNG's documented
# signing procedure. Keep the secret used for signing out of this script
# if the script runs in a public or client-side environment.
token = "TOKEN_FROM_V6_SIGNING"

params = {
    "url": target_url,
    "viewport": "1480x1037",
    "fullpage": "true",
    "accept_languages": "hi,en;q=0.8",
    "unique": "1"
}

# Add the v6 API key and token according to the current Quickstart.
params["key"] = api_key
params["token"] = token
response = requests.get("https://v6.url2png.com/", params=params, timeout=120)
response.raise_for_status()
content_type = response.headers.get("content-type", "")
if "image" not in content_type:
    raise RuntimeError(f"Expected an image response, got {content_type!r}")
with open("hindi-page.png", "wb") as output:
    output.write(response.content)

Confirm the current endpoint, required parameter names, and token construction in URL2PNG’s v6 documentation before using this illustrative structure. The dossier describes the signing model and controls but does not provide enough detail to safely invent a complete signing implementation or claim that a particular request was tested.

3. Choose viewport, language, and readiness controls

Control What it does When to use it
viewport Sets capture dimensions as widthxheight; documented default is 1480x1037. Choose dimensions that show the target layout and text at a readable scale. Inspect for clipping or unexpected scaling.
fullpage=true Attempts to capture the entire document canvas; the documented default is false, which captures the viewport. Use it when you need content below the initial viewport. Check long pages for clipping or layout changes.
accept_languages Overrides the default Accept-Language header, documented as en-US,en;q=0.8. Set a Hindi preference when the site uses this request header to select localized content. It does not supply Devanagari glyphs.
delay Waits a fixed number of seconds after document readiness and asset loading. Use when late content or font availability needs additional time and no page-controlled signal is available.
say_cheese=true Waits for an element with the ID url2png-cheese. Use when you can arrange for the target page to add that element once its content is ready.
custom_css_url Applies a CSS file to the target page. Use a stylesheet you control for capture-specific layout adjustments or a font-family fallback. It cannot make a missing font file available by itself.
unique and ttl Control cache freshness; the guide documents a 30-day default TTL. Use the documented cache controls when checking whether a returned image may be stale. Re-sign the request after changing options.

URL2PNG also describes custom JavaScript control. Use the current documentation for its exact syntax and execution timing; do not assume an older protocol example applies unchanged to v6. A longer delay or readiness trigger can help with timing, but cannot repair incorrect markup, a failed font request, or absent glyph coverage.

4. Inspect the capture and isolate the cause

  1. Compare the capture with the page open in a browser at the same target URL and a comparable viewport.
  2. If the image has the wrong language, check whether the site chooses locale from the URL, cookies, or Accept-Language. Change one localization input at a time.
  3. If Hindi appears as boxes or fallback glyphs, inspect the page’s computed font and font-file request. Confirm glyph coverage and successful font loading.
  4. If text is blank or incomplete, check whether it appears only after application code runs. Use the page-controlled say_cheese signal where available, or an appropriate documented delay.
  5. If the layout is cut off, adjust the viewport or use fullpage=true, then inspect the whole returned image.
  6. If repeated requests appear identical after a page change, check the cache controls. Use unique or adjust ttl according to the guide, and ensure the changed options are included in the newly signed query.

For diagnosis, vary one factor at a time: font availability, readiness, language negotiation, viewport/full-page setting, and cache freshness. This is a troubleshooting method based on the documented controls, not a claim that a particular configuration has been tested.

5. cURL and Node.js request patterns

The request must include a token generated for the exact v6 query using URL2PNG’s documented signing procedure. These examples show where the URL and capture options belong; populate the key and token as required by the current Quickstart. Do not expose the signing secret in distributed client code.

curl -G "https://v6.url2png.com/" \
  --data-urlencode "url=https://example.com/hi/" \
  --data-urlencode "viewport=1480x1037" \
  --data-urlencode "fullpage=true" \
  --data-urlencode "accept_languages=hi,en;q=0.8" \
  --data-urlencode "key=YOUR_API_KEY" \
  --data-urlencode "token=TOKEN_FROM_V6_SIGNING" \
  --output hindi-page.png
const params = new URLSearchParams({
  url: 'https://example.com/hi/',
  viewport: '1480x1037',
  fullpage: 'true',
  accept_languages: 'hi,en;q=0.8',
  key: process.env.URL2PNG_API_KEY,
  token: process.env.URL2PNG_V6_TOKEN
});

const response = await fetch(`https://v6.url2png.com/?${params}`);
if (!response.ok) {
  throw new Error(`URL2PNG request failed: ${response.status} ${response.statusText}`);
}
const contentType = response.headers.get('content-type') ?? '';
if (!contentType.includes('image')) {
  throw new Error(`Expected an image response, got ${contentType}`);
}
const image = new Uint8Array(await response.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('hindi-page.png', image));

These are request patterns, not standalone token generators. Verify endpoint and signing requirements in the live v6 guide. The supplied research does not establish a URL2PNG signing formula suitable for copying here.

6. Troubleshooting common Hindi capture problems

Symptom Likely cause to check Fix
Hindi characters show as empty boxes The rendered font may lack Devanagari glyphs, or the intended web font may have failed to load. Check the page’s CSS and font request. Select a font with Devanagari coverage and keep a suitable fallback.
Text is blank, then appears later in a browser The screenshot may be taken before the web font becomes usable. Confirm font loading in the page, then use a readiness signal or documented delay. A delay cannot fix a font that never loads.
The screenshot shows English instead of Hindi The website may select content using a URL, cookie, account preference, or language header. Verify the page’s locale behavior and use accept_languages if it negotiates from that header. This does not change font coverage.
Hindi content is missing but the rest of the page appears Content may be injected after document readiness, or the target page may not contain the expected text. Inspect the source page. Wait on a page-controlled element with say_cheese or add a suitable fixed delay.
The page is cropped The capture uses the viewport-only default or dimensions do not fit the layout. Set a suitable viewport; enable fullpage=true for the entire document canvas and inspect the result.
A changed page returns an old-looking image The cached result may be reused. Review unique and ttl, then sign and send the changed query string.
The request is rejected after changing an option The token may no longer match the full query string. Regenerate the token from the exact query string sent, following the v6 signing guide.

7. Performance, reliability, and cost considerations

  • Use the smallest practical viewport. Capture only the dimensions needed for the deliverable; use full-page mode when the whole document is required. Large pages can take longer to render and produce larger image files.
  • Wait for a condition when possible. A page-controlled readiness marker avoids choosing an arbitrary long delay, when you control the page. A fixed delay is simple but adds waiting even when the page is ready sooner.
  • Separate cache validation from rendering changes. Freshness settings can help distinguish a stale result from a new render, but cache controls do not fix page rendering.
  • Handle output as an image. Check HTTP success and the response content type before saving bytes. Keep the API key and signing secret on the server side.
  • Plan cost from URL2PNG’s current plan and billing documentation. The research dossier does not give URL2PNG prices, quotas, latency, or reliability figures, so none are asserted here.

8. Or skip the browser setup

ScreenshotNeo can return a screenshot with one GET request. It accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step 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 gives AI agents tools for screenshots, page information, and PDF capture.

See the ScreenshotNeo API documentation for the request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/hi/ -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/hi/"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/hi/' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.

9. Frequently asked questions

Does setting accept_languages=hi guarantee Hindi text?

No. It can influence locale negotiation when a site uses the Accept-Language header. The page still needs the right Hindi content and a font with Devanagari coverage.

Does URL2PNG guarantee Devanagari shaping?

The cited URL2PNG material describes web-font rendering generally, not a Hindi-specific test or guarantee. Verify the actual output for your target page.

Should I always use full-page capture?

No. Use it when you need the entire document canvas. For a specific viewport or above-the-fold view, choose dimensions for that layout and leave full-page capture off.

Can a longer delay fix missing Hindi glyphs?

No. It can give late content or a loading font more time, but it cannot add glyph coverage or repair a failed font request.