Hi Team,
We are trying to create a PDF using an excel. This excel contains table data which varies daily. when we have 93 to 97 rows in excel the pdf is getting created but not opening.
Below is the code we are using to create the PDF.
def autoSizeColumns(worksheet:Worksheet) {
val a:Int = worksheet.getCells.getMaxDataColumn()
for(colNum <- 1 to a){
worksheet.getCells.setColumnWidth(colNum,worksheet.getCells.getColumnWidth(colNum) + 5)}
}
val workbook = new Workbook("/dbfs/mnt/input/SCB.xlsx")
val pdfSaveOptions = new PdfSaveOptions
val worksheet:Worksheet = workbook.getWorksheets.get(0)
worksheet.autoFitColumns
worksheet.autoFitRows
autoSizeColumns(worksheet)
pdfSaveOptions.setAllColumnsInOnePagePerSheet(true)
pdfSaveOptions.setCalculateFormula(true)
workbook.save(s"/dbfs/mnt/output/a.pdf", pdfSaveOptions)
Please let us know the solution for this.