Browse Source

Added prime to the pdf & png functions

master
boB Rudis 6 years ago
parent
commit
a332c83db1
No known key found for this signature in database GPG Key ID: 2A514A4997464560
  1. 4
      R/chrome-pdf.r
  2. 4
      R/chrome-shot.r
  3. 12
      man/chrome_dump_pdf.Rd
  4. 12
      man/chrome_shot.Rd

4
R/chrome-pdf.r

@ -33,8 +33,8 @@
#' @export
#' @examples
#' chrome_dump_pdf("https://www.r-project.org/")
chrome_dump_pdf <- function(url, path=NULL, overwrite=TRUE, work_dir = NULL,
chrome_bin=Sys.getenv("HEADLESS_CHROME")) {
chrome_dump_pdf <- function(url, path=NULL, overwrite=TRUE, prime=TRUE,
work_dir = NULL, chrome_bin=Sys.getenv("HEADLESS_CHROME")) {
curwd <- getwd()
on.exit(setwd(curwd), add = TRUE)

4
R/chrome-shot.r

@ -36,8 +36,8 @@
#' @export
#' @examples
#' chrome_shot("https://www.r-project.org/logo/Rlogo.svg")
chrome_shot <- function(url, width=NULL, height=NULL, path=NULL, work_dir = NULL,
chrome_bin=Sys.getenv("HEADLESS_CHROME")) {
chrome_shot <- function(url, width=NULL, height=NULL, path=NULL, prime=TRUE,
work_dir = NULL, chrome_bin=Sys.getenv("HEADLESS_CHROME")) {
curwd <- getwd()
on.exit(setwd(curwd), add = TRUE)

12
man/chrome_dump_pdf.Rd

@ -4,8 +4,8 @@
\alias{chrome_dump_pdf}
\title{"Print" to PDF}
\usage{
chrome_dump_pdf(url, path = NULL, overwrite = TRUE, work_dir = NULL,
chrome_bin = Sys.getenv("HEADLESS_CHROME"))
chrome_dump_pdf(url, path = NULL, overwrite = TRUE, prime = TRUE,
work_dir = NULL, chrome_bin = Sys.getenv("HEADLESS_CHROME"))
}
\arguments{
\item{url}{URL to read from}
@ -17,14 +17,14 @@ the end of it.}
\item{overwrite}{overwrite existing file? Default: \code{TRUE}}
\item{work_dir}{See special Section.}
\item{chrome_bin}{the path to Chrome (auto-set from \code{HEADLESS_CHROME} environment variable)}
\item{prime}{if \code{TRUE} preliminary URL retrieval requests will be sent to "prime" the
headless Chrome cache. This seems to be necessary primarily on recent versions of macOS.
If numeric, that number of "prime" requests will be sent ahead of the capture request.
If \code{FALSE} no priming requests will be sent.}
\item{work_dir}{See special Section.}
\item{chrome_bin}{the path to Chrome (auto-set from \code{HEADLESS_CHROME} environment variable)}
}
\value{
output fileame (invisibly)

12
man/chrome_shot.Rd

@ -4,7 +4,7 @@
\alias{chrome_shot}
\title{Capture a screenshot}
\usage{
chrome_shot(url, width = NULL, height = NULL, path = NULL,
chrome_shot(url, width = NULL, height = NULL, path = NULL, prime = TRUE,
work_dir = NULL, chrome_bin = Sys.getenv("HEADLESS_CHROME"))
}
\arguments{
@ -17,16 +17,16 @@ and \code{overwrite} is \code{FALSE}, the fuction will will ensure a uniquely-na
placed in the current working directory by incrementing trailing numbers before
the end of it.}
\item{prime}{if \code{TRUE} preliminary URL retrieval requests will be sent to "prime" the
headless Chrome cache. This seems to be necessary primarily on recent versions of macOS.
If numeric, that number of "prime" requests will be sent ahead of the capture request.
If \code{FALSE} no priming requests will be sent.}
\item{work_dir}{See special Section.}
\item{chrome_bin}{the path to Chrome (auto-set from \code{HEADLESS_CHROME} environment variable)}
\item{overwrite}{overwrite existing file? Default: \code{TRUE}}
\item{prime}{if \code{TRUE} preliminary URL retrieval requests will be sent to "prime" the
headless Chrome cache. This seems to be necessary primarily on recent versions of macOS.
If numeric, that number of "prime" requests will be sent ahead of the capture request.
If \code{FALSE} no priming requests will be sent.}
}
\value{
\code{magick}

Loading…
Cancel
Save