identify_form_fields {staplr}R Documentation

Identify text form fields

Description

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.

Usage

identify_form_fields(
  input_filepath = NULL,
  output_filepath = NULL,
  overwrite = TRUE,
  convert_field_names = FALSE,
  encoding_warning = TRUE
)

Arguments

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.

overwrite

If a file exists in output_filepath, should it be overwritten.

convert_field_names

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.

encoding_warning

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.

Value

TRUE if the operation was succesfful. FALSE if the operation fails.

Examples

output <- tempfile(fileext = '.pdf')
pdfFile = system.file('simpleForm.pdf',package = 'staplr')
identify_form_fields(pdfFile, output)

[Package staplr version 3.2.2 Index]