基本信息
我们同样使用 python-docx 这个依赖库来对 Word 文档进行读取
首先我们来读取文档的基本信息
它们分别是:章节、页边距、页眉页脚边距、页面宽高、页面方向等
在获取文档基础信息之前...def get_page_margin(section):
"""
获取某个页面的页边距(EMU)
:param section:
:return:
"""..., section.bottom_margin
return left, top, right, bottom
# 2、页边距信息
first_section = msg_sections[0..., ",页脚边距:", footer_distance)
4 - 页面宽度和高度
页面宽度:page_width
页面高度:page_height
def get_page_size(section..., page_height = get_page_size(first_section)
print('页面宽度:', page_width, ",页面高度:", page_height)
5 - 页面方向