R에서 ghostcript를 호출하여 pdf 파일을 자르려고하지만 작동하지 못합니다. ghostscript 코드가 명령 프롬프트에서 사용될 때 잘 작동합니다. R를 사용하지 않는 이유는 직접 Ghostscrip 내가 R.R에서 ghostcript 사용하기
내에서 루프에서 생성되는 많은 PDF 파일을 처리해야한다는 것입니다코드는 다음과 같습니다
argument<-c("C:\\gs9.06\\bin\\gswin32.exe -sDEVICE=pdfwrite -o C:\\cropped.pdf -c [/CropBox [0.3 12.5 116.2 169] /PAGES pdfmark -f C:\\uncropped.pdf")
system2(command="C:\\WINDOWS\\system32\\cmd.exe", args=argument)
R은 반환
'ropBox' is not recognized as an internal or external command,
operable program or batch file.
Warning message:
running command '"C:\WINDOWS\system32\cmd.exe" "C:\\gs9.06\\bin\\gswin32.exe -sDEVICE=pdfwrite -o J:\\Mapinfo\\cropped.pdf -c [/CropBox [0.3 12.5 116.2 169] /PAGES pdfmark -f J:\\Mapinfo\\testing.pdf"' had status 1
을
R이 "/"기호를 좋아하지 않는 것 같지만이 문제를 해결하는 방법을 모르겠습니다. 제안 사항이 있으십니까?
- 빈센트
하지만 왜 'gswin32' 프로그램을'system2' 호출 (콘솔 버전은'GSWIN32C.EXE')으로 실행하고'args ='에 그 프로그램에 인수를 넘겨주지 않습니까? 나는 왜'cmd'가 필요한지 잘 모르겠습니다. – thelatemail