{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/bookdown/issues/540","repository_url":"https://api.github.com/repos/rstudio/bookdown","labels_url":"https://api.github.com/repos/rstudio/bookdown/issues/540/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/bookdown/issues/540/comments","events_url":"https://api.github.com/repos/rstudio/bookdown/issues/540/events","html_url":"https://github.com/rstudio/bookdown/issues/540","id":300431312,"number":540,"title":"Generating PDFs during a Shiny Server session","user":{"login":"BK365","id":7494501,"avatar_url":"https://avatars0.githubusercontent.com/u/7494501?v=4","gravatar_id":"","url":"https://api.github.com/users/BK365","html_url":"https://github.com/BK365","followers_url":"https://api.github.com/users/BK365/followers","following_url":"https://api.github.com/users/BK365/following{/other_user}","gists_url":"https://api.github.com/users/BK365/gists{/gist_id}","starred_url":"https://api.github.com/users/BK365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BK365/subscriptions","organizations_url":"https://api.github.com/users/BK365/orgs","repos_url":"https://api.github.com/users/BK365/repos","events_url":"https://api.github.com/users/BK365/events{/privacy}","received_events_url":"https://api.github.com/users/BK365/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-26T23:07:09Z","updated_at":"2018-02-27T04:18:49Z","closed_at":null,"author_association":"NONE","body":"I have a dashboard app on a shiny server where the user can select an individual and then generate a PDF containing their fiscal year information via bookdown.  This works perfectly fine locally, but on the server it fails.\r\n\r\nCan anyone diagnose why it wouldn't work, or suggest a different way that would work?\r\n\r\n>Session info \r\n setting  value                       \r\n version  R version 3.4.2 (2017-09-28)\r\n system   x86_64, darwin15.6.0        \r\n ui       RStudio (1.1.383)           \r\n language (EN)                        \r\n collate  en_US.UTF-8                 \r\n tz       America/New_York            \r\n date     2018-02-26                  \r\n\r\n>Packages \r\n package   * version date       source        \r\n backports   1.1.1   2017-09-25 CRAN (R 3.4.2)\r\n base64enc   0.1-3   2015-07-28 CRAN (R 3.4.0)\r\n bitops      1.0-6   2013-08-17 CRAN (R 3.4.0)\r\n bookdown  * 0.5     2017-08-20 CRAN (R 3.4.1)\r\n caTools     1.17.1  2014-09-10 CRAN (R 3.4.0)\r\n digest      0.6.12  2017-01-27 CRAN (R 3.4.0)\r\n evaluate    0.10.1  2017-06-24 CRAN (R 3.4.1)\r\n graphics  * 3.4.2   2017-10-04 local         \r\n grDevices * 3.4.2   2017-10-04 local         \r\n highr       0.6     2016-05-09 CRAN (R 3.4.0)\r\n htmltools   0.3.6   2017-04-28 CRAN (R 3.4.0)\r\n jsonlite    1.5     2017-06-01 CRAN (R 3.4.0)\r\n knitr     * 1.17    2017-08-10 CRAN (R 3.4.1)\r\n magrittr    1.5     2014-11-22 CRAN (R 3.4.0)\r\n markdown    0.8     2017-04-20 CRAN (R 3.4.0)\r\n methods   * 3.4.2   2017-10-04 local         \r\n mime        0.5     2016-07-07 CRAN (R 3.4.0)\r\n Rcpp        0.12.13 2017-09-28 CRAN (R 3.4.2)\r\n rmarkdown   1.6     2017-06-15 CRAN (R 3.4.0)\r\n rprojroot   1.2     2017-01-16 CRAN (R 3.4.0)\r\n stats     * 3.4.2   2017-10-04 local         \r\n stringi     1.1.5   2017-04-07 CRAN (R 3.4.0)\r\n stringr     1.2.0   2017-02-18 CRAN (R 3.4.0)\r\n tools       3.4.2   2017-10-04 local         \r\n utils     * 3.4.2   2017-10-04 local         \r\n yaml        2.1.14  2016-11-12 CRAN (R 3.4.0)\r\n\r\n> rmarkdown::pandoc_version()\r\n[1] ‘1.19.2.1’\r\n\r\n> system('pdflatex --version')\r\npdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)\r\nkpathsea version 6.2.3\r\nCopyright 2017 Han The Thanh (pdfTeX) et al.\r\nThere is NO warranty.  Redistribution of this software is\r\ncovered by the terms of both the pdfTeX copyright and\r\nthe Lesser GNU General Public License.\r\nFor more information about these matters, see the file\r\nnamed COPYING and the pdfTeX source.\r\nPrimary author of pdfTeX: Han The Thanh (pdfTeX) et al.\r\nCompiled with libpng 1.6.29; using libpng 1.6.29\r\nCompiled with zlib 1.2.11; using zlib 1.2.11\r\nCompiled with xpdf version 3.04\r\n\r\n```{r}\r\noutput$downloadreport <- downloadHandler(\r\n\r\n      filename = function() {\r\n     paste(toString(input$PI), \" Report\", \".pdf\", sep=\"\")\r\n   },\r\n      content = function(file) {\r\n        fname <- paste(file,\"pdf\",sep=\".\")\r\n       \r\n        bookdownreport <- \"index.Rmd\"\r\n          \r\n        # Set up parameters to pass to Rmd document\r\n        params <- list(CurrentAwards  = selectedDataAwards(), MPIAwards = selectedDataAwardsMPI(), PPGAwards = selectedDataAwardsPPG(), UnpaidAwards = selectedDataAwardsUnpaid(), PI=toString(input$PI), CoiAwards = selectedDataAwardsCoi(), SalRec = selectedDataSal(), Teaching = selectedDataTeach(), ProposalsPI = selectedDataProp(), ProposalsCoi= selectedDataPropCoi(), PI.demographics = selectedDemographics())\r\n        \r\n bookdown::render_book(bookdownreport,output_format=\"pdf_document\",output_file=fname,params=params,envir = new.env(parent = globalenv()))\r\n     \r\n        file.copy(fname,file)\r\n        if (file.exists(file.path(\"_main.Rmd\"))) file.remove(file.path(\"_main.Rmd\"))\r\n      }\r\n      \r\n    )\r\ndownloadLink(\"downloadreport\", label=\"Generate PI Report (PDF)\")\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/bookdown/issues/comments/368742371","html_url":"https://github.com/rstudio/bookdown/issues/540#issuecomment-368742371","issue_url":"https://api.github.com/repos/rstudio/bookdown/issues/540","id":368742371,"user":{"login":"yihui","id":163582,"avatar_url":"https://avatars2.githubusercontent.com/u/163582?v=4","gravatar_id":"","url":"https://api.github.com/users/yihui","html_url":"https://github.com/yihui","followers_url":"https://api.github.com/users/yihui/followers","following_url":"https://api.github.com/users/yihui/following{/other_user}","gists_url":"https://api.github.com/users/yihui/gists{/gist_id}","starred_url":"https://api.github.com/users/yihui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yihui/subscriptions","organizations_url":"https://api.github.com/users/yihui/orgs","repos_url":"https://api.github.com/users/yihui/repos","events_url":"https://api.github.com/users/yihui/events{/privacy}","received_events_url":"https://api.github.com/users/yihui/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T04:18:49Z","updated_at":"2018-02-27T04:18:49Z","author_association":"MEMBER","body":"It is hard to tell without the log."}}
{"actor":{"display_login":"yihui"}}