CF_WKHTMLTOPDF将页面大小设置为信封

我在ColdFusion 18中使用WKHTMLTOPDF,并且试图将页面大小设置为“信封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">
nancy69669 回答:CF_WKHTMLTOPDF将页面大小设置为信封

根据位于here的wkhtmltopdf手册,它向您提供了here可用的--page-size选项列表。

“ DL信封”的页面尺寸为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.
本文链接:https://www.f2er.com/3027833.html

大家都在问