// Create a new workbook Workbook workbook = new Workbook(); //Load template file from resource InputStream templateFile = this.getResourceStream("xlsx/Template_fw4-USTaxForm.xlsx"); workbook.open(templateFile); //Invoke to process the template workbook.processTemplate(); // Save to a pdf file workbook.save("USTaxForm_fw4.pdf");