| 1 |
\name{ps.end} |
| 2 |
\alias{ps.end} |
| 3 |
\alias{pdf.end} |
| 4 |
\title{Close PostScript or Acrobat Graphics Device opened by 'ps.do' / 'pdf.do'} |
| 5 |
\usage{ |
| 6 |
ps.end(call.gv= NULL, command = getOption("eps_view"), |
| 7 |
debug = getOption("verbose")) |
| 8 |
pdf.end(call.viewer= NULL, command = getOption("pdfviewer"), |
| 9 |
debug = getOption("verbose")) |
| 10 |
} |
| 11 |
\arguments{ |
| 12 |
\item{call.gv,call.viewer}{logical, indicating if the postscript or |
| 13 |
acrobat reader (e.g., ghostview or \code{acroread} or the command |
| 14 |
given by \code{command}) should be called. By default, find out if |
| 15 |
the viewer is already runing on this file and only call it if needed.} |
| 16 |
\item{command}{character, giving a system command for PostScript previewing. |
| 17 |
By default, \code{getOption("eps_view")} is set to\cr |
| 18 |
\code{gv -watch -geometry -0+0 -magstep -2 -media BBox -noantialias} |
| 19 |
which assumes \code{gv} (aka \emph{ghostview}) to be in your OS path.} |
| 20 |
\item{debug}{logical; if \code{TRUE} print information during execution.} |
| 21 |
} |
| 22 |
\description{ |
| 23 |
Closes the PostScript or PDF file |
| 24 |
(\code{\link{postscript}},\code{\link{pdf}}), openend by a previous |
| 25 |
\code{\link{ps.do}} (or \code{\link{pdf.latex}}, or \dots) call, using |
| 26 |
\code{\link{dev.off}}, and additionally opens a previewer for that |
| 27 |
file, \emph{unless} the previewer is already up. This almost provides |
| 28 |
an \sQuote{interactive} device (like \code{\link{x11}}) for |
| 29 |
\code{\link{postscript}} or \code{\link{pdf}}. |
| 30 |
} |
| 31 |
\details{ |
| 32 |
Depends on Unix tools, such as \command{ps}. |
| 33 |
} |
| 34 |
\author{Martin Maechler} |
| 35 |
\seealso{\code{\link{postscript}}, \code{\link{postscript}} |
| 36 |
\code{\link{pdf.do}}, \code{\link{ps.do}}, %--> ./ps.latex.Rd |
| 37 |
\dots |
| 38 |
} |
| 39 |
\examples{ |
| 40 |
if(interactive() \dontshow{ || Sys.getenv("USER") == "maechler" } |
| 41 |
) { |
| 42 |
myPS <- tempfile("ex", fileext = ".ps") |
| 43 |
ps.do(myPS) |
| 44 |
data(sunspots) |
| 45 |
plot(sunspots) |
| 46 |
ps.end() |
| 47 |
|
| 48 |
tempfile("ex-sun", fileext = ".pdf") -> myPDF |
| 49 |
pdf.latex(myPDF) |
| 50 |
plot(sunspots) |
| 51 |
pdf.end(call. = FALSE) # basically the same as dev.off() |
| 52 |
} |
| 53 |
ps.latex(tempfile("ex2", fileext = ".eps")) |
| 54 |
plot(sunspots) |
| 55 |
ps.end(call.gv = FALSE) # basically the same as dev.off() |
| 56 |
} |
| 57 |
\keyword{device} |