conditional cfdocument?


i have page displays basic text information inside interface of website. offer printable version text. thought having link <a href="#cgi.script_name#?print=true">printable version</a>

and tried putting following code around text:
<cfif #isdefined("url.print")#>
<cfdocument format="pdf" orientation="portrait">
</cfif>
text output goes here
<cfif #isdefined("url.print")#>
</cfdocument>
</cfif>

but doesn't seem work - says </cfdocument> tag requires matching start tag.

i know this:
<cfif #isdefined("url.print")#>
<cfdocument format="pdf" orientation="portrait">
text output goes here
</cfdocument>
<cfelse>
text output goes here
</cfif>

but need type text twice - lot of text thats not practical.
is there other way this?

also 1 other question cfdocument. seems whenever use cfdocument output text pdf this, text in pdf considerably larger text when output web page. why that? how can make text in pdf same size if displayed page?

that doesn't seem work - says </cfdocument> tag requires matching start tag.
in first code, coldfusion aware of cfdocument tag moment finishes first cfif block. automatically expects find corresponding end tag. if tag must have end tag, coldfusion must able parse (start tag, end tag) pair unconditionally.

is there other way this?
i find second code solution. requires tiny adaptation,

<cfif isdefined("url.print")>
<cfdocument format="pdf" orientation="portrait">
<cfinclude template="thetext.cfm">
</cfdocument>
<cfelse>
<cfinclude template="thetext.cfm">
</cfif>

how can make text in pdf same size if displayed page?
use stylesheets



More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support