wb = o.Workbooks.Open(wb_path)
ws_index_list = [1, 4, 5]
path_to_pdf = 'C:\\user\\desktop\\sample.pdf'
print_area = 'A1:G50'
for index in ws_index_list:
    ws = wb.Worksheets[index - 1]
ws.PageSetup.Zoom = False
ws.PageSetup.FitToPagesTall = 1
ws.PageSetup.FitToPagesWide = 1
ws.PageSetup.PrintArea = print_area
wb.WorkSheets(ws_index_list).Select()
wb.ActiveSheet.ExportAsFixedFormat(0, path_to_pdf)
Print chosen worksheets in excel files to pdf in python