CF_WKHTMLTOPDF 将页面大小设置为信封

CF_WKHTMLTOPDF setting page size to Envelope

我在 ColdFusion 18 中使用 WKHTMLTOPDF 并尝试将页面大小设置为 "Envelope DL"。我找到了全局设置 size.PageSize 所以在下面的代码中我添加了 pagesize = "Envelope DL" 但这并没有改变它。有没有人有任何其他想法或者可以告诉我我缺少什么?

如有任何帮助,我们将不胜感激!

<CF_WKHTMLTOPDF
    PageURL = "http://www.com/temppdf/test.htm"
    filename = "D://temppdf/test.pdf"
    orientation = "portrait"
    DisableSmartShrinking="yes"
    margintop = "0.25"
    marginleft = "0.25"
    marginright = "0.25"
    marginbottom = "0.25"
    TimeOut = "180"
    AddFooterPageNum="yes">

<cfheader name="content-disposition" value="inline; filename=""CS_#Dateformat(NOW(),'MMDDYYYY')#.pdf""">
<cfcontent type="application/pdf" file="D://temppdf/test.pdf" deletefile="Yes">

根据位于 here it then refers you to list of usable --page-size options which can be found here 的 wkhtmltopdf 手册。

"DL Envelope" 的页面尺寸为 110mm x 220mm。因此,您需要提供给 wkhtmltopdf 的页面大小选项是 --page-size DLE.

我写了ColdFusion WKHTMLTOPDF custom tag。如果您查看源代码,注释会指出在何处查找 "pagesize" 参数。

这是允许的纸张尺寸。 (我的信封用了 "Comm10E"):

http://doc.qt.io/qt-4.8/qprinter.html#PaperSize-enum

QPrinter::A0    5   841 x 1189 mm
QPrinter::A1    6   594 x 841 mm
QPrinter::A2    7   420 x 594 mm
QPrinter::A3    8   297 x 420 mm
QPrinter::A4    0   210 x 297 mm, 8.26 x 11.69 inches
QPrinter::A5    9   148 x 210 mm
QPrinter::A6    10  105 x 148 mm
QPrinter::A7    11  74 x 105 mm
QPrinter::A8    12  52 x 74 mm
QPrinter::A9    13  37 x 52 mm
QPrinter::B0    14  1000 x 1414 mm
QPrinter::B1    15  707 x 1000 mm
QPrinter::B2    17  500 x 707 mm
QPrinter::B3    18  353 x 500 mm
QPrinter::B4    19  250 x 353 mm
QPrinter::B5    1   176 x 250 mm, 6.93 x 9.84 inches
QPrinter::B6    20  125 x 176 mm
QPrinter::B7    21  88 x 125 mm
QPrinter::B8    22  62 x 88 mm
QPrinter::B9    23  33 x 62 mm
QPrinter::B10   16  31 x 44 mm
QPrinter::C5E   24  163 x 229 mm
QPrinter::Comm10E   25  105 x 241 mm, U.S. Common 10 Envelope
QPrinter::DLE   26  110 x 220 mm
QPrinter::Executive 4   7.5 x 10 inches, 190.5 x 254 mm
QPrinter::Folio 27  210 x 330 mm
QPrinter::Ledger    28  431.8 x 279.4 mm
QPrinter::Legal 3   8.5 x 14 inches, 215.9 x 355.6 mm
QPrinter::Letter    2   8.5 x 11 inches, 215.9 x 279.4 mm
QPrinter::Tabloid   29  279.4 x 431.8 mm
QPrinter::Custom    30  Unknown, or a user defined size.