ghostconvert: Call Ghostscript.

View source: R/ghostconvert.R

ghostconvertR Documentation

Call Ghostscript.

Description

THIS CODE WAS TAKEN FROM latexpdf CRAN URL: https://CRAN.R-project.org/package=latexpdf File: R/png.R Version: 0.1.6 Published: 2018-10-26 Author: Tim Bergsma Maintainer: Tim Bergsma (bergsmat at gmail.com) License: GPL-3

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

Details

Call Ghostscript, converting by default from PDF to PNG.

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)

R-package/styledTables documentation built on Feb. 6, 2024, 2:21 a.m.