1. Make sure HTMLDOC.exe works fine with the static htm file.
     Create the htm on the harddisk.
     Use HTMLDOC.exe application to generate the pdf.
     Open the generated pdf with Adobe Reader.
     If Acrobat can't open the file or HTMLDOC crashes then check the
static htm file.
2. Validate the static HTML code. You can use ColdFusion(Tools, Validate
Document from the top menu) to validate the code. I found that <TR></TR>
sequence crashes HTMLDOC.exe version  1.8. You might find other cases where
HTMLDOC is not going to be able to create the pdf file. So, you need 100%
valid HTML. The browsers are very forgiving....HTMLDOC is not.
3. Check the HTMLDOC documentation for the supported HTML tags.
4. Good luck.


Jan Perlmutter
Cold Fusion Developer





Kevin Willyerd <[EMAIL PROTECTED]> on 12/15/2000 09:33:55 AM

Please respond to [EMAIL PROTECTED]

To:   CF-Talk <[EMAIL PROTECTED]>
cc:    (bcc: Jan Perlmutter/BISYS_BPS)
Subject:  html2pdf inconsistancies




I am trying to use the html2pdf tag. Sometimes it works (generating
the pdf
file) other times it doesn't. I thought that maybe the file was not
getting
written in time to be read so I tried a couple of loops to check.
(They are
commented out in the code below). The behavior did not change. Has
anyone
had any luck with getting this tag to run consistently?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
     <title>Pdf Display</title>
</head>
<body>
<!--- <cfset filename='test'> --->
 <cfset
filename='File'&#session.cfToken#&#month(now())#&#day(now())#&#hour(now())#
&
#minute(now())#&#second(now())#>
<cfoutput>#filename#</cfoutput>
<!--- Generate static file from cfm template --->
<cfhttp url="http://64.219.64.36/webmonkey/itineraryresults.cfm"
     method="POST"
     resolveurl="false"
     timeout="60"
     throwonerror="Yes">
<cfhttpparam type="FORMFIELD" name="day" value="2,3,9,10">
<cfhttpparam type="FORMFIELD" name="genrelist" value="1,2,3,4,5">
<cfhttpparam type="FORMFIELD" name="d2" value="0,0,0,0">
</cfhttp>
<!--- Write page to file --->
<cfoutput>
<CFLOCK name="#Session.cftoken#" TIMEOUT="30" >
<cffile action="WRITE"
     file="c:\inetpub\wwwroot\webmonkey\print\files\#filename#.html"
     output="#cfhttp.filecontent#"
     nameconflict="OVERWRITE"
     attributes="Normal">
</cflock>
</cfoutput>
<!--- Send file to screen --->
<cfoutput>#cfhttp.filecontent#</cfoutput>
<!--- Make sure file is written --->
 <!--- <cfoutput>
<cfloop condition="#file.FileWasSaved#">
<cfset x=1>
</cfloop>
</cfoutput>  --->
 <!---  <cfloop index="w" from="1" to="10000">
<cfset w=w+1>
</cfloop>  --->
<!--- Create pdf file --->
<!--- <cflock  name="#Session.cftoken#" TIMEOUT="30">
<cfoutput>
<cfx_html2PDF htmldoc="c:\htmldoc\htmldoc.exe"
INPUTFILE="c:\inetpub\wwwroot\webmonkey\print\files\#filename#.html"
OUTPUTFILE="c:\inetpub\wwwroot\webmonkey\print\files\#filename#.pdf"
OPTIONS="--webpage -f">
</cfoutput>
</cflock>  --->
<!---
<!--- Delete static html file --->
<CFLOCK name="#Session.cftoken#" TIMEOUT="30">
<cfoutput>
<cffile action="Delete"
     file="c:\inetpub\wwwroot\webmonkey\print\files\#filename#.html">
</cfoutput>
</cflock>
<!--- Add print Button --->
<cfoutput>
To print click<a href="files/#filename#.pdf">HERE</a>!
</cfoutput> --->
</body>
</html>
Kevin Willyerd
Cold Fusion Developer
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to