【发布时间】:2022-07-04 23:02:47
【问题描述】:
我已经使用 cfdocument 生成了 pdf。使用 cfpdf=\"addHeader\" 添加标题。此页眉在纸上打印时不打印或在打印预览中显示。 这是代码
<cfsavecontent variable=\"pdfHeaderText\">
Daily Consumer Report
</cfsavecontent>
<cfdocument name=\"PDFVariable\" format=\"PDF\" orientation=\"portrait\" marginbottom=\"1\" marginleft=\"0.5\" marginright=\"0.5\" margintop=\"1\" overwrite=\"true\" >
<cfdocumentsection name=\"Title\">
<cfinclude template=\"MyReportData.cfm\">
</cfdocumentsection>
</cfdocument>
<cfpdf action=\"addHeader\" name=\"pdfwithHeader\" source=\"PDFVariable\" align=\"left\"
text=\"#pdfHeaderText#\" overwrite = \"yes\">
</cfpdf>
<cfheader name=\"Content-Disposition\" value=\"attachment; filename=DailyReport.pdf\" />
<cfcontent type=\"application/pdf\" file=\"#Variables.DESTINATION_DIR#/#PDFfilename#\" deletefile=\"yes\" />
任何帮助将非常感激。谢谢你。
-
你试过
cfdocumentitem吗? -
为什么不像 Dan 所说的那样使用 cfdocument 项目?难道你的来源也不需要变量周围的#?
-
是的丹,我试过 cfdocumentitem。使用 type=\"header\" 生成 PDF。生成带有简单标题的简单 pdf 需要 2 个多小时。没有标题,它可以更快地正常工作。所以我使用了 <cfpdf action=\"addHeader\"。它通常更快地生成 pdf,但它不会在纸上打印标题。
-
2小时??你在产生什么?哈哈
标签: printing coldfusion header cfdocument cfpdf