I'm using Apache Poi in java to copy an excel sheet to the same workbook This way :
FileInputStream file = new FileInputStream(new File("exemple.xlsx"));
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet_copy = workbook.cloneSheet(0);
int num = workbook.getSheetIndex(sheet_copy);
workbook.setSheetName(num, "copy_file");
FileOutputStream outputStream = new FileOutputStream("exemple.xlsx");
workbook.write(outputStream);
the file "sheet_copy" is created as well , but it doesn't have the same scale as the first one , The first one has 59% and the second one 100% when i try to save it as pdf it's too much big, how to solve that in code ? i mean that sheet_copy gets the same format as the original one , i don't want to do it manually .