property CharacterMapError[Index: Integer]: Boolean; // read only
| Index | Geçerli sayfada 0 tabanlı karakter dizini, 0 ile CharacterCount - 1. |
CharacterMapError returns True PDFium belirtilen dizindeki karakteri bir Unicode code point’e eşlerken hata verdiğinde oluşur. Bu durum
True, the value returned by Character[Index]
is unreliable and often falls back to a replacement character (#$FFFD) or
to a passthrough of the underlying glyph identifier.
Bu bayrak en sık, karşılık gelen ToUnicode CMap olmadan font subset’leri gömen ya da tüm glyph set’i kapsamayan bir CMap kullanan printer drivers ve conversion tools tarafından üretilen PDF’lerde yükselir. Gömülü OCR text içeren taranmış PDF’ler ve custom encoding vectors kullanan PDF’ler tipik map error kaynaklarıdır
Callers that need to round-trip text from a PDF should filter or annotate
CharacterMapError hits before treating them as searchable content. A
cluster of consecutive map errors usually indicates an entire string run that should
be re-extracted through OCR rather than via the text layer.
True ve geçerli sayfa ayrıştırılmışsa; aksi halde şunu döndürür False.
var
I, BadCount: Integer;
begin
BadCount := 0;
for I := 0 to Pdf.CharacterCount - 1 do
if Pdf.CharacterMapError[I] then
begin
Memo1.Lines.Add(Format('Map error at %d (charcode $%x)',
[I, Pdf.Charcode[I]]));
Inc(BadCount);
end;
Caption := Format('%d untranslatable characters on page', [BadCount]);
end;