psInput = this.getPDFDocument().getPsServer().makePsInput(file);
} catch (final IOException e) {
throw new GraphicException("Cannot open EPS file.");
}
final PsServer psServer = this.getPDFDocument().getPsServer();
PsSystemDict systemDict = null;
try {
systemDict = psServer.getPdfSystemDict();
final PsInterpreter interpreter = psServer.makeInterpreter(psInput, systemDict);
interpreter.process();
} catch (final PsInterpreterException e1) {
getLogger().error(e1.getMessage());
throw new GraphicException("Cannot parse EPS file.");
} catch (final PsException e1) {
getLogger().error(e1.getMessage());
throw new GraphicException("Cannot parse EPS file.");
}
final byte[] pdfBytes = systemDict.getOutput();
return pdfBytes;
}