我可以在cfscript中使用cfdocument吗?

时间:2018-05-10 16:18:15

标签: coldfusion coldfusion-10 cfml

我尝试在cfscript中使用cfdocument,但它返回Invalid CFML construct。在将代码更改为标记之前,我想知道是否可以在cfscript中使用cfdocument。

以下是我的例子:

cfdocument(name="Agreement", format="PDF", pagetype="custom", pageheight="5", pagewidth="6.5", margintop="0", marginbottom="0", marginright="0", marginleft="0){
                cfdocumentSection(){ writeOutput(#local.Agreement#) }
            }

1 个答案:

答案 0 :(得分:0)

是的,我们无法在Coldfusion的cfscript中使用cfdocument。但是我们可以在lucee中使用。

我添加了示例代码,

cfdocument(
    format            = "PDF"
    filename          = "test.pdf"
    backgroundvisible = "yes"
    fontembed         = "yes"
    marginbottom      = "100"
    marginleft        = "100"
    marginright       = "100"
    margintop         = "100"
    orientation       = "100"
    pagetype          = "100"
    pageheight        = "100"
    pagewidth         = "100"
) {
    cfdocumentitem( type = "header" ) {
        //Header section
    }

    cfdocumentsection() {
        // body section
    }

    cfdocumentitem( type = "footer" ) {
        //footer section
    }
}