我尝试用pythondocx创建Word文档。创建的文件的字母尺寸为8.5 x 11英寸。但在德国,标准格式是A4 8.27 x 11.69英寸。在from docx import Document
from docx.shared import Inches
document = Document()
document.add_heading('Document Title', 0)
document.settings
p = document.add_paragraph('A plain paragraph having some ')
p.add_run('bold').bold = True
p.add_run(' and some ')
p.add_run('italic.').italic = True
document.add_heading('Heading, level 1', level=1)
document.add_paragraph('Intense quote', style='IntenseQuote')
document.add_paragraph(
'first item in unordered list', style='ListBullet'
)
document.add_paragraph(
'first item in ordered list', style='ListNumber'
)
table = document.add_table(rows=1, cols=3)
hdr_cells = table.rows[0].cells
hdr_cells[0].text = 'Qty'
hdr_cells[1].text = 'Id'
hdr_cells[2].text = 'Desc'
document.add_page_break()
document.save('demo.docx')
我在文档中找不到关于这个主题的任何信息。在