참조 된 글꼴이있는 PDF가 있으며 포함 된 글꼴이 포함 된 PDF를 출력하려면 Ghost4J를 사용하고 싶습니다.Ghost4J/Ghostscript - 글꼴을 PDF에 포함하려고 할 때 오류 100 발생
ERROR: Cannot initialize Ghostscript interpreter. Error code is -100
인수가 제대로 작동 명령 줄에서 실행 :
public void execute() {
Ghostscript gs = Ghostscript.getInstance();
String[] cmdStr={
"-dNOPAUSE","-dBATCH","-dCompatibilityLevel=1.4",
"-dPDFSETTINGS=/prepress","-dSAFER","-dNOPLATFONTS",
"-sDEVICE=display","-sPAPERSIZE=letter",
"-I","C:\\WINNT\\Fonts\\;C:\\Program Files\\gs\\gs9.05\\lib\\;C:\\Program Files\\gs\\gs9.05\\bin\\;",
"-dSubsetFonts=true","-dEmbedAllFonts=true",
"-sFONTPATH=C:\\WINNT\\Fonts", "-sOutputFile=",
outputPath,"-c",".setpdfwrite", "-f",inputPath
};
try {
gs.initialize(cmdStr);
gs.exit();
} catch (GhostscriptException e) {
System.out.println("ERROR: " + e.getMessage());
e.printStackTrace();
}
나는 다음과 같은 오류가있는 PDF를 실행
.gswin32c.exe -dNOPAUSE -dBATCH -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dSafer -NOPLATFONTS -sDEVICE=pdfwrite -sPAPERSIZE=letter -dSubsetFonts=true -dEmbedAllFonts=true -sFONTPATH=C:\\WINNT\\Fonts -sOutputFile=c:\out.pdf -f c:\test.pdf
후속 :
- 고스트 스크립트는 C에 쓸 수있는 권한이 :.
- 내가 outputPath를 제외하고 모든 스위치를 제거했다 "-f"inputPath 나는 여전히 inputPath 후 CMDSTR의 끝에서 오류를
노트를
- 콜백을 받고 있습니다.
내가 Ghost4J에 대해 아무것도 모르겠지만 .... 이러한 매개 변수'-ps2pdf'합니다. 또한, 코드 예제의 cmdStr에서 Windows에서 작동하는'gswin32c.exe' (유닉스에서 작동하는'gs' 만)를 찾지 못했습니다 ... –
Ghost4J는 C++ 용 Ghostscript 암호. http://ghost4j.sourceforge.net/ – eabraham
너무 많이 추측했습니다 ...하지만 Java 코드에서 Ghostscript를 호출하는 방법이 맞습니까? –