我已经使用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" />任何帮助都将不胜感激。谢谢。
发布于 2022-07-04 15:02:47
<cfdocument name="PDFVariable" format="PDF" orientation="portrait" marginbottom="1" marginleft="0.5" marginright="0.5" margintop="1" overwrite="true" >
<cfdocumentitem type="header">
<cfinclude template="HEADERDATA.cfm">
</cfdocumentitem>
<cfdocumentitem type="footer">
<cfinclude template="FOOTERDATA.cfm">
</cfdocumentitem>
--------
YOU COULD ALSO JUST PULL IN A .CFM TEMPLATE WITH COLDFUSION/HTML/CSS
<cfinclude template="HEADERDATA.cfm">
--------
<cfdocumentsection name="Title">
<cfinclude template="MyReportData.cfm">
</cfdocumentsection>
</cfdocument>https://stackoverflow.com/questions/72664293
复制相似问题