Recently I have been tasked with creating a program that will be able to auto-fill a form using data from an Excel spreadsheet. I have chosen to do this in R, since I know it the best, and used the package officer
to do so. The program works, is able to do this task quickly and at the end generates a .docx file with a personalized name. However, the person I am creating this program for would like to have these filled forms be saved as a .pdf file, with the personalized name still intact. Granted, there is an option to save them as .pdf in Word, but:
- this will slow down the process significantly with the volume of forms that will be generated.
- I am not interested in keeping the .docx files; I just want the PDFs.
What are possible solutions to this kind of issue? I know there exists one that requires installation of LibreOffice, but I would like to avoid it, since I don't want to have to download a whole other office productivity software suite just to convert a bunch of files from one format to another. I would much rather prefer for a solution to be done just within R, maybe with implementation of some other R package.
Here is how the process of saving filled forms looks right now:
setwd("*/Formularze") #changing the working directory to where I want to save the filled forms
print(formularz,
target = glue::glue("Formularz - {inputs$name}.docx")) #saving the filled form with a unique name,
#formularz is an object generated by
#read_docx()
setwd("*") #returning to previous directory