Convert a particulae sheet into PDF

47 Views Asked by At

I am using JODConverter to convert an .xlsx file into a .pdf by following this sample code :

File inputFile = new File("document.xlsx");
File outputFile = new File("document.pdf");

// Create an office manager using the default configuration.
// The default port is 2002. Note that when an office manager
// is installed, it will be the one used by default when
// a converter is created.
final LocalOfficeManager officeManager = LocalOfficeManager.install(); 
try {

    // Start an office process and connect to the started instance (on port 2002).
    officeManager.start();

    // Convert
    JodConverter
             .convert(inputFile)
             .to(outputFile)
             .execute();
} finally {
    // Stop the office process
    OfficeUtils.stopQuietly(officeManager);
}

but I don't know how to convert a particular sheet / workbook ? I am looking something like getSheet(x) or getSheetName(x), but no success yet.

Any help ?

0

There are 0 best solutions below