[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

Any way to stop specific parts of a page from displaying when included in a <cfdocument> tag for print?

I'm setting up a bunch of printable pages from my original cfml pages.  I am just wrapping a cfinclude in the cfdocument tag.  There are a few things on the cfinclude document that I do not want displayed at print time.  Is there anyway I can exclude these peices from displaying at printout?
0
MFredin
Asked:
MFredin
1 Solution
 
Scott BennettCommented:
You could set a variable before the include in template that generates the document and then check for the existance of that variable to determine if it should be included in the output.

your page with the cfdocument tag woul look something like:
<cfset request.isPrintOut = 1>
<cfdocument format="pdf">
<cfinclude template="myIncludedTemplate.cfm"
</cfdocument>


myIncludedTemplate.cfm would be like:

<cfif (not isDefined("request.isPrintOut")) or (request.isPrintOut neq 1)>
      stuff I don't want printed out goes here
</cfif>
0
 
MFredinAuthor Commented:
That works.

Thanks!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now