function CreateAttachment(const Name: WString; const Data: TBytes; const MimeType: WString = ''): Integer
在文档级别添加一个新的嵌入文件(附件)。
返回附件索引;可使用 AttachmentName/AttachmentType 枚举。
对当前页面的所有编辑都会缓冲在 PDFium 的内存表示中。调用 UpdatePage 可刷新渲染缓存,调用 SaveToFile 可持久化更改。
Pdf1.Active 必须为 True,并且必须选中页面。
begin
if Pdf1.Active then
begin
Pdf1.MoveTo(100, 100);
Pdf1.LineTo(200, 150);
Pdf1.LineTo(200, 200);
Pdf1.ClosePath;
Pdf1.AddPath(clRed, 1.5, clYellow, fmWinding);
Pdf1.UpdatePage;
end;
end;