Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 python xhtml2pdf 模块和 pisa 类来创建 PDF。现在 PDF 为垂直 A4 格式,如何将其更改为 PDF 为横向布局?
import xhtml2pdf.pisa as pisa result = StringIO() pdf = pisa.CreatePDF( StringIO("This is my PDF"), result)
使用以下 CSS:
@page { size: letter landscape; margin: 2cm; }