This function allows you to download PDF files of data collection instruments. The download may be with or without collected data, and may return a single record, multiple records, or all records.
exportPdf(
rcon,
dir,
filename = "redcap_forms_download",
record = NULL,
events = NULL,
instruments = NULL,
all_records = FALSE,
...
)# S3 method for redcapApiConnection
exportPdf(
rcon,
dir,
filename = "redcap_forms_download",
record = NULL,
events = NULL,
instruments = NULL,
all_records = FALSE,
...,
error_handling = getOption("redcap_error_handling"),
config = list(),
api_param = list()
)
Creates a PDF file that is saved to the directory specified by the user.
A REDCap connection object as generated by redcapConnection
.
The directory into which the file should be saved.
character(1)
. The base of the file name. If
record = NULL
, it will be appended with "_blank.pdf"
. If
record
has a value, it will be appended with "_record_[record id].pdf"
The record id for which forms should be downloaded. May only
have length 1. May be either character
or numeric
.
The events for which forms should be downloaded
The instruments for which forms should be downloaded
Logical. If TRUE
forms for all records are downloaded.
When TRUE
, this overrides the records
argument.
Arguments to be passed to other methods.
An option for how to handle errors returned by the API.
see redcap_error
list
Additional configuration parameters to pass to
POST
. These are appended to any parameters in
rcon$config
.
list
Additional API parameters to pass into the
body of the API call. This provides users to execute calls with options
that may not otherwise be supported by redcapAPI
.
This function allows you to export a PDF file for any of the following: 1) a single data collection instrument (blank), 2) all instruments (blank), 3) a single instrument (with data from a single record), 4) all instruments (with data from a single record), or 5) all instruments (with data from ALL records). This is the exact same PDF file that is downloadable from a project's data entry form in the web interface, and additionally, the user's privileges with regard to data exports will be applied here just like they are when downloading the PDF in the web interface (e.g., if they have de-identified data export rights, then it will remove data from certain fields in the PDF). If the user has "No Access" data export rights, they will not be able to use this method, and an error will be returned.
6.5.0+
None
Benjamin Nutter
This function mimics the behavior of "Download PDF of Instruments" button on the REDCap user interface.