Opens the PDF file of which the full path is given in Pdf in a PDF viewer.
Arguments
full path to PDF file
- dbg
if
TRUE
(default) the command used to open the PDF file is shown
Examples
# Set path to PDF file and open PDF device
tmpPdf <- tempfile("ex_hsFinishPdf", fileext = ".pdf")
preparePdf(tmpPdf)
#> [1] "/var/folders/h1/8hndypj13nsbj5pn4xsnv1tm0000gn/T//Rtmp0pKi4m/ex_hsFinishPdffa33994253.pdf"
# Plot something
plot(x <- seq(-pi,pi,pi/100), sin(x), type = "l")
# Finish PDF file.
grDevices::dev.off()
#> agg_png
#> 2
if (FALSE) {
# Open PDF file in viewer.
hsShowPdf(tmpPdf)
}