coldfusion - CF WKHTMLTOPDF 将页面大小设置为信封

标签 coldfusion wkhtmltopdf coldfusion-2018

我在 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">

最佳答案

我写了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.

关于coldfusion - CF WKHTMLTOPDF 将页面大小设置为信封,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59054461/

相关文章:

forms - ColdFusion 自动选择选项

angularjs - Wkhtmltopdf 用 angularjs 修补了 QT 问题

coldfusion - 使用cffile重命名文件时如何获取文件扩展名

arrays - 我如何反转数组

python - 在 python 中迭代循环时,HTML 表格式不一致?

coldfusion - 使用|| OR 在 Coldfusion if 语句中使用 isDefined

coldfusion - 在使用 '[bracket]' 和 '. dot' 表示法的查询中找不到访问属性的区别

从版本 11 升级到 ColdFusion 2018 后出现 ORM 问题

mysql - 如何加速复杂的 MYSQL 查询?

ruby-on-rails - 邪恶_pdf : Is it possible to have the header only show on the first page & the footer only on the last?