Skip to content

修改 excel2pdf 方法, 使之支持指定工作表或整个工作簿.#2

Open
wyl219 wants to merge 3 commits into
CoderWanFeng:mainfrom
wyl219:main
Open

修改 excel2pdf 方法, 使之支持指定工作表或整个工作簿.#2
wyl219 wants to merge 3 commits into
CoderWanFeng:mainfrom
wyl219:main

Conversation

@wyl219
Copy link
Copy Markdown

@wyl219 wyl219 commented Nov 5, 2023

原项目有一个bug,excel转pdf只会处理第一个工作簿.
将 excel2pdf 中使用的 sheet.to_pdf() 修改为 book.to_pdf(),详见官方文档 https://docs.xlwings.org/en/latest/api/book.html#xlwings.Book.to_pdf
python-office 项目中也做了相应修改.

@wyl219
Copy link
Copy Markdown
Author

wyl219 commented Nov 5, 2023

include 与 exclude两个参数不能同时使用, xlwings中已经做了报错处理.

两个配套的函数:
get_sheet_index:根据从1开始的工作表序号或工作表名,从核查并获取sheet的索引号(从0开始)或工作表名
centimeters2points:用于行高和页边距等的厘米转磅
@wyl219
Copy link
Copy Markdown
Author

wyl219 commented Nov 6, 2023

新增一个修改工作表页面设置的方法及两个配套的函数

两个配套的函数:
get_sheet_index:根据从1开始的工作表序号或工作表名,从核查并获取sheet的索引号(从0开始)或工作表名
centimeters2points:用于行高和页边距等的厘米转磅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants