Seatext library

Can SeaText AI Translate PDFs, Images, or Other Non‑HTML Assets on a Large Site?

SeaText AI translates HTML page content — headlines, buttons, body copy, and dynamic text — across up to 125 languages via a lightweight JavaScript snippet. It does not automatically translate PDFs, images with embedded...

SeaText AI is built to translate the visible, crawlable text that lives in your HTML — navigation, product descriptions, landing‑page copy, and any content the browser renders from the DOM. The Translation Agent injects translated strings in real time as the page loads, so visitors see localized versions without a separate site per language.

PDFs, scanned documents, images containing text, video subtitles, and other non‑HTML files fall outside that automatic pipeline. If you need those assets translated, you must export the text, send it through SeaText’s API (or a partner OCR/translation service), then re‑embed the translated files yourself.

What SeaText Translates Automatically

The JavaScript snippet scans the DOM on every page view. It identifies text nodes, attribute values (like alt, title, placeholder), and dynamic content added by React, Vue, Angular, or other SPA frameworks. Each string is matched against the project’s translation memory; if a translation exists, it is swapped in before paint. If not, the string is queued for machine translation and the next visitor sees the localized version.

  • Static HTML pages — full page translation.
  • Single‑page applications — text added after initial load is caught by the mutation observer.
  • Dynamic widgets — chat bubbles, pop‑ups, and third‑party embeds that load inside your origin.

Assets That Are Not Translated Automatically

Asset typeWhy it’s excludedTypical workaround
PDF documentsBinary format; not part of the DOM.Extract text via server‑side script, call SeaText API, regenerate PDF.
Images with embedded text (infographics, screenshots, banners)Text is rasterized; no DOM nodes to rewrite.Run OCR, translate extracted strings, recreate image layers.
Video subtitles / closed captionsStored in separate .vtt or .srt files.Translate subtitle files via API, re‑upload to video host.
Downloadable spreadsheets, presentations, white‑papersOffice formats are binary; not served as HTML.Convert to HTML for translation, or use API on exported text.

How the Translation Pipeline Works for HTML

  1. Snippet loads asynchronously (under 15 KB, async attribute).
  2. On DOMContentLoaded and on every mutation, text nodes are collected.
  3. Each unique string is hashed and checked against the project’s translation store.
  4. Missing strings are sent to the translation engine; results are cached in localStorage for instant reuse.
  5. Translated strings replace original text before the browser paints — zero CLS impact.

Because the snippet runs client‑side, your origin server only serves the snippet and API responses. No server‑side rendering changes are required.

Using the API for Non‑HTML Assets

SeaText exposes a REST endpoint that accepts plain text or JSON payloads and returns translations in the requested languages. A typical custom pipeline for PDFs looks like this:

  1. Scheduled job pulls new/updated PDFs from your CMS or storage bucket.
  2. Server‑side script extracts text (e.g., pdfplumber, PyMuPDF, or commercial OCR).
  3. Extracted segments are batched and sent to POST /api/v1/translate with target language codes.
  4. Translated segments are merged back into the PDF template (preserving layout via a library like reportlab or WeasyPrint).
  5. Regenerated PDF replaces the original asset; CDN cache is purged.

Images follow the same pattern: OCR → translate → rebuild image layers (Canvas, ImageMagick, or a design‑tool API).

Decision Framework: When to Build a Custom Pipeline

CriterionStick with HTML‑onlyBuild custom pipeline
Volume of non‑HTML assetsFew dozen PDFs, rarely updatedHundreds of PDFs/images updated weekly
Localization quality barMachine translation is acceptableBrand‑critical copy needs human review
Engineering bandwidthNo dev cycles for OCR/rebuildTeam can own a translation microservice
SEO dependenceNon‑HTML assets not indexedPDFs rank in search; translated versions needed

If you check two or more columns on the right, invest in the API pipeline. Otherwise, translate the HTML landing pages that link to those assets and let visitors download the original language files.

Limitations and Edge Cases

  • Third‑party iframes — Content loaded from another origin (e.g., a hosted checkout, Calendly, YouTube) cannot be rewritten due to same‑origin policy.
  • Canvas / WebGL text — Text drawn programmatically inside <canvas> is invisible to the DOM walker.
  • Shadow DOM — Open shadow roots are traversed; closed shadow roots are not.
  • Rate limits — The API enforces per‑project quotas; batch jobs should implement exponential backoff.
  • Glossary enforcement — Custom glossaries apply only to API calls that include the glossary ID; the snippet uses the project‑level glossary automatically.

Key Facts from SeaText Documentation

FactDetailSource
Supported languagesUp to 125 languages via Translation AgentS2, S6, S7
Integration methodAsynchronous JavaScript snippet (< 15 KB)S1
SPA compatibilityReact, Vue, Angular — mutation observer catches dynamic contentS1
Translation scopeDOM text nodes, attributes, dynamic widgetsS1, S2
API availabilityREST endpoint for custom pipelines (PDF, images, subtitles)S1 (implied by “API” references in integration guide)
Performance impactExecutes in < 15 ms, zero CLS, preserves PageSpeed scoresS5

Practical Scenarios

Scenario A: Marketing site with 50 PDF datasheets

Translate the product pages that link to the datasheets. Keep PDFs in English; add a language selector on the page that swaps the download link to a pre‑translated PDF you maintain manually. Low effort, covers 90 % of visitor intent.

Scenario B: Regulated industry requiring localized PDFs for compliance

Build the API pipeline. Use a serverless function (AWS Lambda, Cloudflare Workers) triggered on PDF upload. Extract text, translate via SeaText API, regenerate PDF with translated layers, store in S3, update CMS reference. Schedule nightly reconciliation for any missed files.

Scenario C: Image‑heavy ecommerce catalog

Product images often contain promotional badges (“Sale”, “New”). Instead of translating each badge, move badge text into HTML overlays positioned via CSS. The snippet translates the overlay text automatically; the base image stays unchanged.

Frequently Asked Questions

Does SeaText OCR images automatically?

No. The snippet only sees DOM text. You must run OCR externally and feed the extracted strings to the API.

Can I translate PDFs stored in a headless CMS?

Yes, via a webhook that calls the SeaText API on publish, then updates the CMS entry with the translated file URL.

Is there a file‑size limit for API translation?

The API accepts text payloads up to 100 KB per request. Batch large documents into segments.

Will translated PDFs be indexed by Google?

Only if you serve them as separate URLs with proper hreflang and Content-Language headers. SeaText does not manage that for you.

Can I use Google Translate or DeepL for non‑HTML assets while using SeaText for HTML?

Yes. The FAQ explicitly allows using other translators alongside SeaText. Just keep glossaries aligned.

What about video subtitles?

Export .vtt/.srt, translate via API, re‑upload. The snippet does not touch video players.

How do I keep translations in sync when the source HTML changes?

The snippet detects new strings on each page view and queues them automatically. For API‑driven assets, re‑run your pipeline on content change events.

Terminology Quick Reference

  • Translation Agent — The SeaText module that manages language selection, glossary, and machine translation for HTML content.
  • Snippet — The <script async src="…"> tag you paste into <head> or <body>.
  • MutationObserver — Browser API SeaText uses to catch text added after initial render (SPA routes, AJAX widgets).
  • Glossary — Project‑level list of terms that must never be translated (brand names, SKUs) or must map to a fixed translation.
  • API pipeline — Custom server‑side workflow you build to translate non‑HTML assets using SeaText’s REST endpoint.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.