🌏 CJK & Pronunciation
International text, pronunciation hints for screen readers, Ruby annotations, and language-of-parts.
C# — International Accessibility
// Pronunciation hint (PDF 2.0)
var name = sect.AddChild(StructureType.Span);
name.Phoneme = "ˈniːtʃə";
name.PhoneticAlphabet =
PdfPhoneticAlphabet.Ipa;
page.AddTaggedText(name, "Nietzsche", 170, 670);
// Language of parts
var frSpan = sect.AddChild(StructureType.Span);
frSpan.Language = "fr"; // Override to French
page.AddTaggedText(frSpan,
"bon appétit", 190, 590);
// Ruby annotations (CJK reading aids)
var (ruby, rb, rt) =
sect.AddRuby(includeParentheses: false);
page.AddTaggedText(rb, "Kanji", 72, 480,
new PdfTextOptions { FontSize = 14 });
page.AddTaggedText(rt, "(reading)", 72, 498,
new PdfTextOptions {
FontSize = 8,
Color = new PdfColor(0.5, 0, 0)
});
You should see three sections: "Pronunciation Hints" — a sentence containing "Nietzsche" in bold (IPA phoneme ˈniːtʃə attached in the tag tree); "Language of Parts" — a line mixing English and italic "bon appétit" (tagged with lang="fr"); "Ruby Annotations (CJK)" — the word "Kanji" with "(reading)" in small red text appearing above it as a ruby annotation.
File: 17_cjk_pronunciation.pdf