Helps identification of text forum fields by creating a file that is filled with field names. Some pdf editors show field names when you mouse over the fields as well.
identify_form_fields(
input_filepath = NULL,
output_filepath = NULL,
overwrite = TRUE,
convert_field_names = FALSE,
encoding_warning = TRUE
)
TRUE if the operation was succesfful. FALSE if the operation fails.
the path of the input PDF file. The default is set to NULL. IF NULL, it prompt the user to select the folder interactively.
the path of the output PDF file. The default is set to NULL. IF NULL, it prompt the user to select the folder interactively.
If a file exists in output_filepath
, should it be overwritten.
By default pdftk
will encode certain characters
of the field names in plain text UTF-8 so if using a non-latin alphabet, your
field names might be illegible. Setting this to TRUE will turn the UFT-8 code into
characters. However this process it not guaranteed to be perfect as pdftk does
not differentiate between encoded text and regular text using escape characters.
If you have field names that intentionally include components that look like encoded characters
this will attempt to fix them. Use this option only when necessary. If TRUE,
remember to set it to TRUE when using set_fields
as well.
If field names include strings that look like plain text UTF-8
codes, the function will return a warning by default, suggesting setting convert_field_names
to codeTRUE.
If encoding_warning
is FALSE
, these warnings will be silenced.
output <- tempfile(fileext = '.pdf')
pdfFile = system.file('simpleForm.pdf',package = 'staplr')
identify_form_fields(pdfFile, output)
Run the code above in your browser using DataLab