property CharacterGenerated[Index: Integer]: Boolean; // read only
| Index | 현재 page의 0 기반 character index입니다. 범위는 0 .. CharacterCount - 1입니다 |
CharacterGenerated는 지정한 인덱스의 character가 원본 content stream에 있던 것이 아니라 PDFium 내부에서 생성된 것일 때 True를 반환합니다. 대표적인 예는 ligature 분해(fi ligature glyph를 f + i로 나눔), 시각적으로 분리된 인접 text run 사이에 PDFium이 넣는 trailing space, 각 시각적 line 끝에 삽입되는 line-break character입니다
생성된 character는 page content stream에 별도 그리기가 없으므로 bounding box를 이웃 glyph에서 유도합니다. pixel-accurate hit-testing이 필요하면 주의해서 다루세요; 해당 CharacterRectangle은 너비나 높이가 0인 영역으로 접힐 수 있습니다
정확한 verbatim extraction(디지털 서명, text의 hash, page content stream과의 ASCII 일치 비교) 같은 작업에서는 먼저 생성된 character를 걸러내세요. 일반적인 text search와 clipboard copy에서는 이 flag가 순전히 정보용입니다. PDFium은 사용자가 기대하는 대로 이미 character를 삽입해 둡니다
True 사례입니다. 생성된 character가 항상 보이지 않는 glyph라고 가정하지 마세요
// content stream에 있는 character만 포함하는 verbatim string을 만듭니다
var
I: Integer;
S: WString;
begin
S := '';
for I := 0 to Pdf.CharacterCount - 1 do
if not Pdf.CharacterGenerated[I] then
S := S + Pdf.Character[I];
Memo1.Text := S;
end;