PDFium Component Docs

Language 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
Natural language identifier declared in the document catalog.

구문

property Language: WString; // read / write

설명

Language는 document catalog의 /Lang entry를 읽고 씁니다 (PDF 1.7 spec section 14.9.2). 문자열은 RFC 3066 / BCP 47 language tag syntax를 따르며 — en, en-US, zh-Hans, ja-JP 등입니다. Screen reader와 accessibility tool(PDF/UA, JAWS, NVDA)은 tagged text를 소리 내어 읽을 때 이 tag를 사용해 올바른 pronunciation engine을 선택합니다

ActiveFalse이거나 document가 /Lang를 선언하지 않으면 빈 string을 반환합니다. 새 값을 지정하면 catalog는 즉시 갱신되지만 변경 사항은 다음 SaveToFile / SaveToStream 호출에서만 유지됩니다. 개별 text structure element의 span 수준 language override(구조 요소 dictionary의 /Lang entry를 통해 설정)는 이 property로 노출되지 않습니다

Language는 text content에 사용된 encoding과 무관합니다 — PDFium은 language와 관계없이 character data를 항상 UTF-16으로 디코딩합니다. 이 tag는 순수한 metadata이며, 주로 tagged / PDF-UA accessible document과 추출된 text를 language-specific tokenizer로 라우팅하는 indexing engine에 의미가 있습니다

비고

예제

if Pdf1.Language = '' then
begin
  Pdf1.Language := 'en-US';
  Pdf1.SaveToFile('tagged.pdf');
end
else
  Label1.Caption := 'Document language: ' + Pdf1.Language;

참고 항목

IsTagged, MetaText, Title, StructureElements