@ThomasMBK,
You can get the index according to the name of the sheet. Please refer to the following codes:
Workbook workbook = new Workbook("Book1.xlsx");
WorksheetCollection sheets = workbook.Worksheets;
//If you want to export the contents of the following three sheets
string[] sheetNames = {"Sheet1", "Sheet3", "Sheet5"};
int[] sheetIndexes = new int[3];
int index = 0;
foreach(string sheetName in sheetNames)
{
sheetIndexes[index++] = sheets[sheetName].Index;
}
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
//set sheet indexes to sheet set.
pdfSaveOptions.SheetSet = new SheetSet(sheetIndexes);
workbook.Save("output.pdf", pdfSaveOptions);