View source: R/addSigFieldLM.R
| addSigFieldLM | R Documentation |
Insert empty digital-signature form fields (AcroForm /Sig fields) into a PDF
so it can be signed in Adobe Acrobat Reader (the free reader) with one click: open
the PDF, click a field, and sign with a Digital ID. The field is added with a
pure base-R PDF incremental update, with no external tools or packages, so it works
wherever R does. It is designed for the simple PDFs produced by IQLM
and OQLM.
Acrobat Reader can also sign a PDF that has no field at all (“All tools” > “Use a certificate” > “Digitally sign”, then drag a rectangle). This function only makes the workflow click-to-sign by pre-placing labelled fields.
addSigFieldLM(pdf, out = pdf, page = 1L,
fieldNames = c("Performed_by", "Reviewed_by"), rects = NULL)
pdf |
path to the input PDF. |
out |
path to write the result; defaults to overwriting |
page |
1-based page number to place the field(s) on (the signature page is
page 1 of |
fieldNames |
character vector of field names; one signature field is added per name. The names appear in Acrobat's Signature panel. |
rects |
optional list of numeric length-4 rectangles |
The function appends an incremental-update section that adds an /AcroForm to
the document catalog (with /SigFlags 3), one /Widget signature
annotation per field, and the field references to the page's /Annots. The
original content is left untouched. The resulting fields are unsigned; the actual
cryptographic signature is applied by Acrobat Reader using the signer's Digital ID.
Only classic cross-reference-table PDFs are supported (those written by R's
pdf device); the function stops on cross-reference-stream
PDFs.
Invisibly, the output path. A PDF with signature fields is written as a side effect.
Kyun-Seop Bae <k@acr.kr>
IQLM, OQLM, signPDFLM
#IQLM("sasLM-IQ-Report.pdf", performedBy = "Kyun-Seop Bae")
#addSigFieldLM("sasLM-IQ-Report.pdf") # adds Performed_by / Reviewed_by fields
## or in one step:
#IQLM("sasLM-IQ-Report.pdf", performedBy = "Kyun-Seop Bae", sigField = TRUE)
## then open in Acrobat Reader and click each field to sign with your Digital ID.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.