简体   繁体   中英

R: grImport - Ghostscript error - status 1

I'm trying to use grImport insert an eps format logo into maps I'm making using R. I'm running on OsX Mavericks, R 2.15 and GhostImport 9.07.

My code looks like this:

    Library(grImport)
    PostScriptTrace("~/Documents/My Projects/Project A/Images/Logo Large.eps")

Gives me this error:

    GPL Ghostscript 9.07: Unrecoverable error, exit code 1
    Error in PostScriptTrace("~/Documents/My Projects/Project A/Images/Logo Large.eps") : 
    status 1 in running command 'gs -q -dBATCH -dNOPAUSE -sDEVICE=pswrite 
    -sOutputFile=/dev/null -sstdout=Logo Large.eps.xml captureLogo Large.eps'

Can anyone shed any light on this ? I have no clue whats going on here Thanks

Edit: Ok I have got it working using advice from flodel below - bu it is only importing my eps file in black and white and missing some internal details. Anyone know what the problem is now?

By the look of your file name ( Logo Large.eps ) I assume you're a bioinformatician trying to get a "web logo" vector image into R. Most likely this vector image contains a lot of text which by chance could contain a font which is not in your fonts directory.

To get around this problem the easiest way you have to convert the text in your post script file to outlines using ghost script. Just run the following line on the command line (NOT in R):

gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=nochar_Logo_Large.eps -q -dbatch -dNOPAUSE -dQUIET Logo_Large.eps -c quit

After that you can use this new file in R:

PostScriptTrace("nochar_Logo_Large.eps", "nochar_Logo_Large.xml")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM