If the toolkit Pdftk is available in the
system, it will be called to fill a pdf form with given a list of fields.
List of fields can be acquired by get_fields
function.
See the reference for detailed usage of pdftk
.
set_fields( input_filepath = NULL, output_filepath = NULL, fields, overwrite = TRUE, convert_field_names = FALSE )
input_filepath | the path of the input PDF file. The default is set to NULL. IF NULL, it prompt the user to select the folder interactively. |
---|---|
output_filepath | the path of the output PDF file. The default is set to NULL. IF NULL, it prompt the user to select the folder interactively. |
fields | Fields returned from |
overwrite | If a file exists in |
convert_field_names | If you set convert_field_names when using |
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
Ogan Mancarci
if (FALSE) { pdfFile = system.file('testForm.pdf',package = 'staplr') fields = get_fields(pdfFile) fields$TextField1$value = 'this is text' fields$TextField2$value = 'more text' fields$RadioGroup$value = 2 fields$checkBox$value = 'Yes' set_fields(pdfFile,'filledPdf.pdf',fields) }