Skip to content

Language Tagging in PDFs — Complete Guide

DodaTech Updated 2026-06-28 5 min read

In this tutorial, you will learn about Language Tagging in PDFs. We cover key concepts, practical examples, and best practices to help you master this topic.

Language tagging in PDF Accessibility means declaring the document's primary language in the metadata and marking any section where the language changes, so that screen readers apply the correct pronunciation rules, character sets, and voice profiles.

What You'll Learn

You will learn how to set the default document language in Acrobat, how to mark inline language changes for multilingual content, how to verify language properties, and how screen readers use language information for speech synthesis.

Why It Matters

Screen readers use language metadata to select the correct voice and pronunciation engine. If a PDF contains French phrases but is tagged as English, the screen reader pronounces French words using English phonetics, producing gibberish.

Real-World Use

An international organization publishes a bilingual report with English main content and Spanish quotes. The document language is set to en-US. Spanish phrases like "muchas gracias" are pronounced with English rules ("muh-chas gra-see-us"). After marking each Spanish span with the lang="es" attribute, the screen reader switches to Spanish pronunciation for those sections.

Language Hierarchy

flowchart TD
  A["Document Catalog lang=en"] --> B["Page 1 lang=en"]
  B --> C["Paragraph lang=en"]
  C --> D["Inline Spanish: lang=es"]
  B --> E["Inline French: lang=fr"]
  A --> F["Page 2 lang=en"]
  F --> G["Table with lang=en"]
  A --> H["Page 3 lang=de"]
  H --> I["German content"]

Setting Document Language

In Acrobat Pro

  1. File > Properties > Description tab.
  2. In the Language field, select or type the language code (e.g., en-US, fr-FR, es-ES).
  3. Click OK.

Programmatically

# Set document language using pdfplumber
import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    # Check current language
    current_lang = pdf.metadata.get("language")
    print(f"Current language: {current_lang}")
// Acrobat JavaScript to set document language
this.info.Language = "en-US";
console.println("Language set to " + this.info.Language);

Marking Language Changes

When a section of content switches to a different language, you must tag that content with the correct language attribute:

  1. In the Tags panel, find the content element (P, Span, etc.) that contains the foreign language text.
  2. Right-click > Properties > Tag tab.
  3. In the Language field, enter the language code (e.g., fr for French).
  4. Click Close.

For inline phrases within a paragraph, wrap the foreign text in a <Span> tag with the language attribute:

Tag tree:
<P> The meeting ended with a resounding
  <Span lang="fr">"Merci à tous"</Span>
  from the CEO.
</P>

Language Code Format

Use BCP 47 language tags:

Language Code Example
English (US) en-US "Hello"
English (UK) en-GB "Colour"
Spanish es "Gracias"
French fr "Merci"
German de "Danke"
Chinese (Simplified) zh-CN "谢谢"
Arabic ar "شكرا"
Hindi hi "धन्यवाद"

Common Mistakes

  1. Language set to "None" or "Unspecified" — Screen readers may default to guessing, which produces wrong pronunciation for many documents.

  2. Only setting page content language but missing inline changes — A single foreign word in an English paragraph needs its own language tag on a <Span>.

  3. Using three-letter codes — PDF/UA expects BCP 47 codes (en, not eng). Some older tools generate three-letter codes that screen readers may not recognize.

  4. Forgetting to set language in the document catalog — Setting language on individual tags without setting the document default means screen readers may not know the primary language.

  5. Inconsistent language codes — Using en in one place and en-US elsewhere is technically fine but inconsistent. Pick one pattern for the document.

Practice and Challenge

  1. Where is the document-level language set in Acrobat Pro?
  2. What BCP 47 language code should you use for French as spoken in Canada?
  3. How do you mark a single Spanish word within an English paragraph?
  4. What happens when a screen reader encounters content with no language tag?
  5. How do you verify the language attribute in the tag tree?

Challenge: Create a 2-page PDF with English content that includes at least three foreign language phrases (e.g., a French quote, a Spanish term, and a German company name). Set the document language to English, then mark each foreign phrase with the correct language tag. Verify with a screen reader that each phrase is pronounced correctly.

FAQ

Does language tagging affect text-to-speech in PDF readers?

Yes. Adobe Reader's Read Out Loud feature respects language tags. A multilingual document with correct language tags switches voice profiles automatically.

What if my PDF uses multiple languages on the same page?

Tag each content block or inline span with the appropriate language attribute. Screen readers switch between voices as they encounter different language tags.

Can I set language for a whole page differently from the document?

Yes. Each page can have a language attribute that overrides the document default for that page. Useful for appendix pages in a different language.

Does language tagging affect search indexing?

Yes. Language tags help search engines understand which language your content is in. Incorrect language tagging can hurt multilingual SEO.

What about code snippets in a different language?

Code snippets (JavaScript, Python) in an English document can be tagged with lang='en' unless the code itself contains natural-language comments in another language.

Mini Project

Take a 3-page PDF document that includes at least 5 foreign language phrases (use Wikipedia articles or translate parts of a document). Correctly tag the document language and each foreign phrase. Export the tag tree and verify that each language change is marked. Test with a screen reader.

What's Next

Continue to Color Contrast in PDFs to learn how to ensure sufficient color contrast in PDF documents, then proceed to PDF Tools — Acrobat, pa11y-pdf.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro