0

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?

invertedSpear
  • 10,864
  • 5
  • 39
  • 77
  • 2
    Kinda hard to answer without seeing the relevant code. – Dan Bracuk Nov 29 '12 at 01:38
  • 2
    Might be related to this bug [#3202782](https://bugbase.adobe.com/index.cfm?event=bug&id=3202782) – Leigh Nov 29 '12 at 02:52
  • does Leigh's link work for anyone? I always get a 'redirect loop' error whenever I try to access Adobe's bugbase – Matt Busche Nov 29 '12 at 03:27
  • Works here, Matt. (Though I have had a redirect loop thing in the past with some Adobe blogs; maybe disable JS?) – Peter Boughton Nov 29 '12 at 04:00
  • Thanks Peter, looks like the issue is gone with the latest chrome dev release. – Matt Busche Nov 29 '12 at 04:12
  • @DanBracuk - Relevant code would be a simple use of cfdocument in a loop. The bug in Leigh's link has an example. But considering there is no fix for it, I doubt any answers will be forthcoming. – invertedSpear Nov 29 '12 at 16:38
  • @Leigh - Thanks, Will try the include workaround mentioned in the bug. BTW - love that adobe closed the bug with a status of "deferred" I wish I could completely ignore major bugs like this in my work. – invertedSpear Nov 29 '12 at 16:40

1 Answers1

4

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

Community
  • 1
  • 1
genericHCU
  • 4,394
  • 2
  • 22
  • 34
  • I'm writing to disk instead of saving to memory, but same result. Using the cfinclude does still make it work. So at least there is a good workaround. – invertedSpear Nov 29 '12 at 17:31
  • Bleh, I was just about to delete this as it more or less just confirms the comments but since I didn't try using the cfdocumentitem tag I can't speak toward that solution that but I'm glad it helped. – genericHCU Nov 29 '12 at 17:35
  • Better to have it as an answer. Then it is easier to spot for the next guy running into this problem. – Leigh Nov 29 '12 at 21:40
  • Thanks, this solved my problem (I don't think I would have figured it out otherwise). – jj2 Aug 18 '15 at 05:21