New in 2022. When converting Excel worksheet to PDF or to images (Tiff, jpg, etc), jOfficeConvert will use by default the paper size and orientation defined in Excel spreadsheet for the output PDF page size and orientation. It is possible to overwrite the 2 page properties using the ExcelConvertOptions. Here is some sample Java code […]
Articles Tagged: convert excel to pdf
Write each Excel worksheet to a separate PDF
This Java sample uses Qoppa’s PDF conversion library jOfficeConvert to convert each worksheet of a Microsoft Excel workbook to a PDF document, using the worksheet name as the PDF file name. // Load the document ExcelDocument ed = new ExcelDocument("C:\\test\\input.xlsx", new ExcelConvertOptions()); List<String> workSheetNames = ed.getWorkSheetNames(); for (String name : workSheetNames) { List<String> namesList […]
Converting an Excel Worksheet to PDF
This Java sample uses Qoppa’s PDF conversion library jOfficeConvert to convert the first worksheet from a Microsoft Excel workbook to PDF. // Load the document ExcelDocument ed = new ExcelDocument("C:\\test\\input.xlsx", new ExcelConvertOptions()); List<String> worksheetNames = ed.getWorkSheetNames(); // Get the name of the first worksheet String sheet1Name = worksheetNames.get(0); // Tell the ExcelDocument […]
Sample Java code to convert Excel to PDF using jOfficeConvert
To convert an excel spreadsheet to PDF using Qoppa’s library jOfficeConvert, it takes only 2 lines of code: // Load the document ExcelDocument excelDoc = new ExcelDocument("input.xlsx", new ExcelConvertOptions()); // Save the document as a PDF file excelDoc.saveAsPDF("output.pdf");// Load the document ExcelDocument excelDoc = new ExcelDocument("input.xlsx", new ExcelConvertOptions()); // Save the document as a […]