CFDocument ignoring background color when in loop

只谈情不闲聊 提交于 2020-01-06 20:00:22

问题


I'm running a loop to build multiple PDFs. The background colors of pdf 2+ created in the loop just plain disappear. Doesn't matter if the background color is defined in CSS, as an HTML style, using hex code or just a color name.

This is not an issue if I were to create 2 pdfs in a row without a loop.

Any idea what gives?


回答1:


This is a bug, it only effects cfdocument saved in memory, it does not effect cfdocuments that are displayed directly to the browser. If you have to save your document in memory, the workaround is pretty simple; use an include or cfc.

myDocument.cfm

<cfdocument name = "myDoc">
 ...
 ...
</cfdocument>

myLoop.cfm

<cfloop ...>
  <cfinclude template= "myDocument.cfm">
</cfloop>

I mention this bug and workaround here: cfdocument prevent page breaks mid-row



来源:https://stackoverflow.com/questions/13617295/cfdocument-ignoring-background-color-when-in-loop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!