import java.io.File; import com.adeptia.exceltopdf.ExceltoPDFConvertor; try { String SourceFilePath = (String) context .get("Service.GetExcel.filePath"); String SourceFileName = (String) context .get("Service.GetExcel.fileName"); String ExcelFilePath = SourceFilePath + File.separatorChar + SourceFileName; String PDFFilePath = SourceFilePath + File.separatorChar + SourceFileName + ".pdf"; new ExceltoPDFConvertor(ExcelFilePath,PDFFilePath) .performConversion(); } catch (Exception e) { e.printStackTrace(); throw e; }