ghostconvert {latexpdf}R Documentation

Call Ghostscript.

Description

Call Ghostscript, converting by default from PDF to PNG.

Usage

ghostconvert(
  x,
  y = file.path(gdir, out),
  gdir = dirname(x),
  out = sub("\\.[^.]+$", paste0(if (multipage) multifix else NULL, ".", suffix),
    basename(x)),
  gs_cmd = "",
  device = "pngalpha",
  multipage = FALSE,
  multifix = "-%03d",
  suffix = "png",
  antialias = 4,
  resolution = 300,
  replace = TRUE,
  other = "",
  ...
)

Arguments

x

path for file to be converted

y

path for output file

gdir

directory for png output

out

filename for output file

gs_cmd

passed to find_gs_cmd; perhaps 'gs' or 'gswin32c' or 'mgs' (from Miktex)

device

output device type

multipage

whether to convert multiple pages

multifix

a filename suffix when converting multiple pages

suffix

file extension for output

antialias

font antialiasing

resolution

raster image resolution

replace

whether to delete x if successful

other

other arguments to ghostscript

...

ignored

Value

the name of the file created

Examples

## Not run: 
pdf <- as.pdf(head(Theoph),dir = tempdir())
png <- ghostconvert(pdf, gs_cmd = 'mgs')
browseURL(png)

## End(Not run)

[Package latexpdf version 0.1.8 Index]