Hi all,
I'm running into an issue where my downloadHandler runs fine for both html and pdf outputs on my local server, and the html output works fine on my RStudio Connect Shiny app. But the PDF produces an error.
For reference here is my output, the params are unimportant I think but outputs include latex-friendly tables and ggplot based plots.
output$report <-
downloadHandler(
"results_from_shiny.pdf",
content =
function(file)
{
rmarkdown::render(
input = "report.Rmd",
output_file = "report.pdf",
params = list(DepthPlot = DepthPlot(),
RatePlot = RatePlot(),
CCFTbl = CCF(),
CCFPie = CCFPiePlot(),
AvgDepthRate = AvgDepthRate()),
envir = new.env(parent = globalenv())
)
readBin(con = "report.pdf",
what = "raw",
n = file.info("report.pdf")[, "size"]) %>%
writeBin(con = file)
}
)
Here are the error messages I receive in the log:

And here is what the download shows in Google Chrome:

How can I circumnavigate this latex issue and allow users to download PDF reports?
Might be worth mentioning that the Shiny app itself works perfectly fine on Connect.
Thanks for any help or insight you can provide!