我正在使用wkhtmltopdf(将HTML转换为PDF的工具) 并通过PHP shell_exec
运行它。
在运行命令wkhtmltopdf --help
时,其中一个选项是“size”,其帮助文本为
设置纸张大小:A4、Letter等。
我想知道是否有人有此可执行文件支持的纸张大小列表?
我正在使用wkhtmltopdf(将HTML转换为PDF的工具) 并通过PHP shell_exec
运行它。
在运行命令wkhtmltopdf --help
时,其中一个选项是“size”,其帮助文本为
设置纸张大小:A4、Letter等。
我想知道是否有人有此可执行文件支持的纸张大小列表?
如果您查看项目存储库中的pdfsettings.cc源代码,您会发现这个列表,对我来说看起来像是已接受的命名纸张大小列表。
res["A0"] = QPrinter::A0;
res["A1"] = QPrinter::A1;
res["A2"] = QPrinter::A2;
res["A3"] = QPrinter::A3;
res["A4"] = QPrinter::A4;
res["A5"] = QPrinter::A5;
res["A6"] = QPrinter::A6;
res["A7"] = QPrinter::A7;
res["A8"] = QPrinter::A8;
res["A9"] = QPrinter::A9;
res["B0"] = QPrinter::B0;
res["B1"] = QPrinter::B1;
res["B10"] = QPrinter::B10;
res["B2"] = QPrinter::B2;
res["B3"] = QPrinter::B3;
res["B4"] = QPrinter::B4;
res["B5"] = QPrinter::B5;
res["B6"] = QPrinter::B6;
res["B7"] = QPrinter::B7;
res["B8"] = QPrinter::B8;
res["B9"] = QPrinter::B9;
res["C5E"] = QPrinter::C5E;
res["Comm10E"] = QPrinter::Comm10E;
res["DLE"] = QPrinter::DLE;
res["Executive"] = QPrinter::Executive;
res["Folio"] = QPrinter::Folio;
res["Ledger"] = QPrinter::Ledger;
res["Legal"] = QPrinter::Legal;
res["Letter"] = QPrinter::Letter;
res["Tabloid"] = QPrinter::Tabloid;
我尝试过以下几种,它们对我有效:
A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,C5E,Comm10E,DLE,Executive,Folio,Ledger,Legal,Letter,Tabloid,Custom
--page-width size
和--page-height size
参数。