property CharacterFontWeight[Index: Integer]: Integer; // read only
对所用字体的 OS/2 usWeightClass 值进行只读索引访问(100 = Thin,400 = Regular,700 = Bold,900 = Black)。当前页面的有效范围是 0 .. CharacterCount - 1;传入超出范围的索引会抛出 EPdfError
字符按其逻辑阅读顺序返回 — 即 PDFium 解析内容流的顺序 — 而不一定是视觉顺序(从右到左的脚本可能显得颠倒)
| Index | 当前页面中基于 0 的字符索引(0 .. CharacterCount - 1) |
Active 为 False 或没有打开页面时,CharacterCount 会重置为 0CharacterGenerated)
var
I: Integer;
begin
for I := 0 to Pdf1.CharacterCount - 1 do
if Pdf1.CharacterFontWeight[I] >= 700 then ShowMessage('bold');
end;