excel 转换成pdf
import os
from win32com.client import DispatchEx
def get_pdf(excel_path,pdf_path):
"""
excel 生成pdf
:param excel_path: excel 路径
:param pdf_path: pdf的保存路径 自动生成
:return:
"""
xlApp = DispatchEx("Excel.Application")
xlApp.Visible = False
xlApp.DisplayAlerts = 0
books = xlApp.Workbooks.Open(excel_path,False)
books.ExportAsFixedFormat(0, pdf_path)
books.Close(False)
xlApp.Quit()