CFDocument ignoring background color when in loop

2019-09-09 08:30发布

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条回答
甜甜的少女心
2楼-- · 2019-09-09 08:45

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

查看更多
登录 后发表回答