ApplyContentFilterChainExt

内容流

描述

对一个页面的每个内容层运行有序的指令级过滤链

语法

Delphi

Function ApplyContentFilterChainExt(TargetPage: Integer; Const Filters: TPDFContentFilterChain): Integer;

返回值

0没有任何内容层被写回
N被链接受并写回的已解析层数量

失败行为

当未选择文档、TargetPage 超出基于 1 的页面范围、Filters 为 nil 或为空,或所有层为空、解析失败或被回调拒绝时,返回 0。如果后续某个层被跳过,已写回的层仍保持修改状态

备注

每个非空内容层都会被解析为 TPDFContentProgram。回调按注册顺序运行,并可以在原位修改该程序。传递给回调的层名称为 L1、L2 等。回调返回 cfrStop 会停止该层剩余的回调,阻止该层被写回,然后继续处理下一层。Filters 的所有权仍归调用者所有

示例

Filters:= PDF.NewContentFilterChain;
try
  Filters.Add(FirstFilter, nil);
  Filters.Add(SecondFilter, UserData);
  ChangedLayers:= PDF.ApplyContentFilterChainExt(1, Filters);
finally
  Filters.Free;
end;

另请参阅

NewContentFilterChain、ApplyContentFilterChain、SetContentStreamFromString