property CharacterFontWeight[CharIndex: Integer]: Integer; // 只读
对所用字体的 OS/2 usWeightClass 值的只读索引访问(100 = Thin,400 = Regular,700 = Bold,900 = Black)。当前页的有效范围为 0 .. CharacterCount - 1;传入超出范围的索引会引发 EPdfError。
字符按其逻辑阅读顺序返回 — 也就是 PDFium 解析内容流的顺序 — 不一定是视觉顺序(从右向左的脚本可能显示为反向)。
所有坐标都使用 PDF 用户空间点,原点位于左下角。叠加到 VCL 画布时,可使用 PdfView1.PointsToScreen 或你自己的坐标转换。
| CharIndex | 当前页中从 0 开始的字符索引(0 .. CharacterCount - 1)。 |
Active 为 False 或没有打开页面时,CharacterCount 会重置为 0。CharacterGenerated)。
var
I: Integer;
begin
for I := 0 to Pdf1.CharacterCount - 1 do
if Pdf1.CharacterFontWeight[I] >= 700 then ShowMessage('bold');
end;