THPDFPage.AddPushButton

THPDFPage

 

方法  AcroForm 支持

Adds an AcroForm push button widget to the current page.

 

Delphi 语法:

procedure AddPushButton(const FieldName, Caption: AnsiString; Rectangle: TRect; Flags: THPDFFormFieldFlags = []);

 

说明

启用原生外观生成时,标准 Helvetica caption 支持以合法 UTF-8 文本提供的 218 字符规范可打印 WinAnsi 配置,并在 PDF 字面转义之前用相同字符的 glyph advance 做水平居中;欧元符号、拉丁变音符和已定义的 Windows-1252 标点使用其规范 WinAnsi 字节。宽于 widget 的 caption 保持既有的左缘钳制,而字号、垂直放置、存储的 caption 和 action 元数据保持既有行为

对于扩展的多字节 UTF-8 caption 路径,任何不支持的标量或畸形序列都沿用既有的整标题空外观回退,且不改动存储的 caption;原 ASCII 路径保持不变。通用 Unicode、自动字体回退与复杂 shaping 都在这个有限的标准字体配置之外,包括 PDF 2.0 输出在内的外观生成门槛未变,参见 AutoFormAppearances

该方法创建带 Pushbutton flag 的 /Btn field,并通过 widget appearance characteristics 写入 caption。当按钮需要 submit form、reset form、run JavaScript、open a URI、trigger a named viewer command 或 hide another field 时,请使用 AddPushButtonWithAction;当一次点击需要顺序执行两个 action 时,请使用 AddPushButtonWithNextAction

 

THPDFButtonAction values

   baNone — no /A action
   baSubmitURL — /S /SubmitForm with /FS /URL filespec (PDF 1.2 §12.7.5.2). Param is the destination URL
   baResetForm — /S /ResetForm resets every form field (PDF 1.2 §12.7.5.3)
   baJavaScript — /S /JavaScript /JS (Param) (PDF 1.3 §12.6.4.16)
   baURI — /S /URI /URI (Param) (PDF 1.1 §12.6.4.7). Opens the URL in a browser
   baNamed (HotPDF v2.119.18) — /S /Named /N <Param> (PDF 1.1 §12.6.4.11). Param is the spec name token: NextPage / PrevPage / FirstPage / LastPage (the four standard navigation commands all PDF readers honour). Acrobat extensions like Print and SaveAs are also accepted by compatible viewers
   baHide (HotPDF v2.119.18) — /S /Hide /T (Param) /H true (PDF 1.2 §12.6.4.10). Param is the name of the form field or annotation to hide when the button is clicked

 

Compliance

PDF/A(任何级别)依 ISO 19005-1 §6.6.1 / ISO 19005-2 §6.5.1 / ISO 19005-3 §6.5.1 拒绝 baJavaScript 和 baResetForm。PDF/X(任何级别)额外拒绝 baSubmitURL。baNamed 和 baHide 在 PDF/A 与 PDF/X 下都被规范允许

 

另请参阅: AcroForm 支持, AddPushButtonWithNextAction, LastAnnotation