I'm using ColdFusion to generate a PDF and creating a DDX file that will generate the TOC for the file when it's done. I can configure and format a header for the TOC page, but have not been able to find anything anywhere on how to change the font of the actual, generated TOC.
Here's my DDX file code:
<cfsavecontent variable="ddxFile"><?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
<PDF result="Out1">
<PDF source="Title"/>
<TableOfContents>
<Header styleReference="TOCheaderStyle"/>
</TableOfContents>
<PDF source="Doc1"/>
</PDF>
<StyleProfile name="TOCheaderStyle">
<Header>
<Center>
<StyledText>
<p font-weight="bold" font="Arial">Table of Contents</p>
</StyledText>
</Center>
</Header>
</StyleProfile>
</DDX>
</cfsavecontent>
I have been searching for an answer for about a week now with no luck on how to get to actual font setting of the generated table of contents text.
Any help would be greatly appreciated! Thanks!
Here's the code I'm generating thanks to the link provided by SOS:
<cfsavecontent variable="myDDX">
<DDX xmlns="http://ns.adobe.com/DDX/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
<PDF result="Out1">
<TableOfContents includeInTOC="false" bookmarkTitle="Table of Contents">
<TableOfContentsEntryPattern applicableLevel="all" >
<StyledText>
<p font-family="Times New Roman" font-size="12pt">
<_BookmarkTitle/>
<Space/>
<Space/>
<leader leader-pattern="dotted"/>
<Space/>
<Space/>
<_BookmarkPageCitation/>
</p>
</StyledText>
</TableOfContentsEntryPattern>
</TableOfContents>
<PDFGroup>
<PDF source="Doc1" />
<PDF source="Doc2" />
</PDFGroup>
</PDF>
</DDX>
</cfsavecontent>
<cfif IsDDX(#myDDX#)>
<cfset inputStruct = StructNew()>
<cfset inputStruct.Doc1 = "FirstDocument.pdf">
<cfset inputStruct.Doc2 = "SecondDocument.pdf">
<cfset outputStruct = StructNew()>
<cfset outputStruct.Out1 = "CombinedDocument.pdf">
<cfpdf action="processddx" ddxfile="#myddx#" inputfiles="#inputStruct#" outputfiles="#outputStruct#" name="ddxVar">
<cfdump var="#ddxVar#">
<cfelse>
<cfoutput><p>NO, DDX IS NOT OK</p></cfoutput>
</cfif>
I want to use a single home page where I will display an upload form (which is in another file). After uploading (action file result) I want to show the result of upload on the same page.
These are my three files:
index.cfm
<html>
<head>
<title>HomePage</title>
<cfajaximport tags="CFFORM">
</head>
<body>
<cfdiv id="Main" style="width:1000px; height:600px" >
<cfdiv id="Options" style=" width:100%;height:20%" >
Welcome Admin, Update Logout
</cfdiv>
<cfdiv id="Content" style=" width:100%;height:80%">
<h2>Here Goes Form and FileUploading</h2>
</cfdiv>
</cfdiv>
</body>
</html>
FileUpload.cfm
<html>
<head>
<title>Upload A File</title>
</head>
<body >
<cflayout type="vbox" name="layout1">
<cflayoutarea>
<cfform enctype="multipart/form-data" action="FileReceiver.cfm" >
File To Upload:
<cfinput type="file" name="Filename" size="50" >
<br/>
<cfinput type="submit" name="UploadFile" value="UPLOAD THIS FILE">
<br/>
</cfform>
</cflayoutarea>
<cflayoutarea>
<table border="1" >
<tr>
<th >
Directory Information
</th>
</tr>
<tr>
<td>
<cfoutput >
CurrectDirectory Path: #getdirectoryFromPath(expandPath("index.cfm"))#
</cfoutput>
</td>
</tr>
</table>
</cflayoutarea>
</cflayout>
</body>
</html>
FileReceiver.cfm
<cfif isdefined('UploadFile') >
<cfoutput >
<cffile nameconflict="makeunique"
action="upload"
filefield="Form.Filename"
destination="#getdirectoryFromPath(expandPath("index.cfm"))#" >
<!--- or destination="c:\Upload\"--->
File upload was successful!
</cfoutput>
</cfif>
When I click on "update link", the index page shows the FileUpload.cfm page in one of its containers. But when uploading file I always get an error message:
Error retrieving markup for element cf_layoutarea736558924094373 :
Invalid content type: application/x-www-form-urlencoded;
charset=UTF-8. [Enable debugging by adding 'cfdebug' to your URL
parameters to see more information]
Kindly help me do it the right way, as I am unable to figure out the problem.
I guess you are not getting your Form scope values actually.
To upload a file, you have used multipart/form-data which are correct and also default value for method attribute in cfform is POST which also looks ok.
Probably issue is because of CFFileNonMultipartException.
Dump FORM scope before Upload code to check you are getting all form values or not on filereciever.cfm.
You can also try without cfform
<form action="FileReceiver.cfm" method="post" enctype="multipart/form-data">
<input type="file" name="Filename">
<input type="submit" name="UploadFile" value="UPLOAD THIS FILE">
</form>
In what is likely a mistyped cffile tag, you have this:
filefield="Form.Filename"
The documentation for cffile, suggests that you should just just have the name of the form field, without the qualification.
Yes Dharmesh, you can do bit trick here. Get rid of fileReciever.cfm page. Add this code in index.cfm
<cfif structKeyExists(FORM,"filename")>
<cffile action="upload" filefield="Form.Filename" destination="#getdirectoryFromPath(expandPath("index.cfm"))#" result = "fileUploaded">
<cfif isDefined("fileUploaded") AND fileUploaded.FILEWASSAVED EQ "yes">
Success
</cfif>
</cfif>
and submit your form to index.cfm not on fileReceiver.cfm
I am new to ColdFusion and have to make a edit page that will both update and track the changes made to a table; while passing the logged in AD user to the database.
Environment:
DB: SQL 2008 R2
OS: Windows 8
Server: ColdFusion 8
Tables Involved:
Branches (main data)
Audit_Branches (change tracking data)
Files involved:
editBranch.cfm (form)
updateBranch.cfc (updates Branches table)
auditBranchLog.cfc (updates Audit_Branches table)
So far I have built the page, and have added the functionality to update the Branches table. Now, I am trying to track the changes and log the AD user who made them.
I started by using a SQL Trigger to watch for Inserts, Updates, Deletes on the Branches table; but the SQL Server only tracks the current SQL user. Since that user is a application user, all the users have the same name entry. Consequently, I re-engineered the Audit_Branches table to have the data inserted directly via CF and thus I can pass the AD username.
Main Problem:I can get the first of three fields to insert into the Audit_Branches table. If more than one field has a change, only the first one in the Arguments array is run and the others are ignored.
I am using cf-if statements to add to a query that is then being passed via a cf-invoke to the auditBranchLog function.
I have tried nested if, if-else; and and/or statements all to no avail. Please help me figure out the best way to make the updateBranch go through all the ifs one by one or suggest a better way to pass the information along to the auditBranchLog
Much Thanks...
------------------ editBranch code:
<cfquery name="getBranches" datasource=[...]>
SELECT
BRANCHID,
BRANCHDESCRIPTION,
BRANCHFILTER,
ADDRESS1,
[...]
FROM Branches
where BRANCHID = '#URL.BRANCHID#'
</cfquery>
<script>
function updateBranch(){
var branchID = $('#branchID').val() ;
var branchDescription = $('#branchDescription').val() ;
var branchDescription_Old = $('#branchDescription_Old').val() ;
var branchFilter = $('#branchFilter').val();
var branchFilter_Old = $('#branchFilter_Old').val() ;
var address1 = $('#address1').val();
var address1_Old = $('#address1_Old').val();
[...]
$.ajax(
{
// the location of the CFC to run
url: "updateBranch.cfc"
// send a GET HTTP operation
, type: "get"
// send the data to the CFC
, data: {
// the method in the CFC to run
method: "UpdateBranches"
// send the BranchID
, branchID: branchID
, branchDescription: branchDescription
, branchDescription_Old: branchDescription_Old
, branchFilter: branchFilter
, branchFilter_Old: branchFilter_Old
, address1: address1
, address1_Old: address1_Old
[...]
}
// this gets the data returned on success
, success: function doLoad(data) { if (typeof console != "undefined") {
console.log(data);
}; location.href = "BranchList.cfm";
}
} )
}
</script>
</head>
<body>
<cfoutput>
<form class="form-horizontal" action="" method="post">
[...]
<fieldset>
<!-- Form Name -->
<legend>Edit Branch</legend>
<!-- BRANCHID input-->
<div class="form-group">
<label class="col-md-4 control-label" for="branchID">Branch ID</label>
<div class="col-md-4">
<input id="branchID" class="form-control input-md" name="branchID" type="text" placeholder=""
value="#getBranches.BRANCHID#" readonly="yes">
</div>
</div>
<!-- BRANCHDESCRIPTION input-->
<div class="form-group">
<label class="col-md-4 control-label" for="branchDescription">Branch Description</label>
<div class="col-md-4">
<input id="branchDescription" class="form-control input-md" name="branchDescription"
value="#getBranches.BRANCHDESCRIPTION#" type="text" placeholder="">
<input id="branchDescription_Old" name="branchDescription_Old" value="#getBranches.BRANCHDESCRIPTION#"
type="hidden">
</div>
</div>
<!-- BRANCHFILTER input-->
<!--- using CFSelect allows to get the db field back for the current selection --->
<div class="form-group">
<label class="col-md-4 control-label" for="branchFilter">Branch Filter</label>
<div class="col-md-4">
<select id="branchFilter" class="form-control" name="branchFilter" size="1">
<cfif LEN(getBranches.branchFilter) GT 0>
<option value="#getBranches.branchFilter#" selected>#getBranches.branchFilter# (current value)</option>
<option value="#getBranches.branchFilter#">---</option>
</cfif>
<option value="Branch">Branch</option>
<option value="Headquarters">Headquarters</option>
<option value="RDC">RDC</option>
<option value="Automation">Automation</option>
</select>
<input id="branchFilter_Old" name="branchFilter_Old" value="#getBranches.BRANCHFILTER#"
type="hidden">
</div>
</div>
<!-- ADDRESS1 input-->
<div class="form-group">
<label class="col-md-4 control-label" for="address1">Address 1</label>
<div class="col-md-4">
<input id="address1" class="form-control input-md" name="address1" type="text"
value="#getBranches.ADDRESS1#" placeholder="">
<input id="address1_Old" name="address1_Old" value="#getBranches.ADDRESS1#"
type="hidden">
</div>
</div>
[...]
<!-- SUBMIT Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="SUBMIT"></label>
<div class="col-md-4">
<button type = "button" id="SUBMIT" class="btn btn-primary" name="SUBMIT" onClick="updateBranch()">Submit</button>
</div>
</div>
------------------ updateBranch code:
<cfcomponent displayname="Branches" access="remote" hint="Update Branches">
<cffunction name="getUserID" displayname="getUserID" hint="I pass back the user information in a clean format" access="package" output="false">
<cfset var UserID = "">
<cfset UserID = [...] >
<cfreturn UserID>
</cffunction>
<cffunction name="UpdateBranches" access="remote" returntype="string"
hint="Changes the Branch Info" >
<cfargument name="branchID" />
<cfargument name="branchDescription" />
<cfargument name="branchDescription_Old" />
<cfargument name="branchFilter" />
<cfargument name="branchFilter_Old" />
<cfargument name="address1" />
<cfargument name="address1_Old" />
<cfset auditLog = QueryNew("BranchID,FieldName,Old,New,UserID", "VarChar, VarChar, VarChar, VarChar, VarChar")>
<!--- compare old a new and call auditBranchLog.cfc --->
<!---BranchDescription--->
<cfif "#ARGUMENTS.branchDescription#" NEQ "#ARGUMENTS.branchDescription_Old#">
<cfset newrow = QueryAddRow(auditLog)>
<cfset temp = QuerySetCell(auditLog,"BranchID","#ARGUMENTS.branchID#")>
<cfset temp = QuerySetCell(auditLog,"FieldName","BranchDescription")>
<cfset temp = QuerySetCell(auditLog,"Old","#ARGUMENTS.branchDescription_Old#")>
<cfset temp = QuerySetCell(auditLog,"New","#ARGUMENTS.branchDescription#")>
<cfset temp = QuerySetCell(auditLog,"UserID","#getUserID()#")>
</cfif>
<!---BranchFilter--->
<cfif "#ARGUMENTS.branchFilter#" NEQ "#ARGUMENTS.branchFilter_Old#">
<cfset newrow = QueryAddRow(auditLog)>
<cfset temp = QuerySetCell(auditLog,"BranchID","#ARGUMENTS.branchID#")>
<cfset temp = QuerySetCell(auditLog,"FieldName","BranchFilter")>
<cfset temp = QuerySetCell(auditLog,"Old","#ARGUMENTS.branchFilter_Old#")>
<cfset temp = QuerySetCell(auditLog,"New","#ARGUMENTS.branchFilter#")>
<cfset temp = QuerySetCell(auditLog,"UserID","#getUserID()#")>
</cfif>
<!---Address1--->
<cfif "#ARGUMENTS.address1#" NEQ "#ARGUMENTS.address1_Old#">
<cfset newrow = QueryAddRow(auditLog)>
<cfset temp = QuerySetCell(auditLog,"BranchID","#ARGUMENTS.branchID#")>
<cfset temp = QuerySetCell(auditLog,"FieldName","Address1")>
<cfset temp = QuerySetCell(auditLog,"Old","#ARGUMENTS.address1_Old#")>
<cfset temp = QuerySetCell(auditLog,"New","#ARGUMENTS.address1#")>
<cfset temp = QuerySetCell(auditLog,"UserID","#getUserID()#")>
</cfif>
<cfif auditLog.RecordCount NEQ 0>
<cfinvoke component="auditBranchLog" method="auditBranch" auditLog="#auditLog#" >
</cfif>
<cfquery name=[...]
</cfquery>
<cfreturn arguments.branchID />
</cffunction>
</cfcomponent>
------------------ auditBranchLog code:
<cffunction name="auditBranch" displayname="auditBranch" >
<cfargument name="auditLog" type="query" required="true">
<cfquery name="auditBranchQry" datasource=[...]>
USE [...]
INSERT INTO [dbo].[Audit_BRANCHES]
([BranchID]
,[FieldName]
,[Old]
,[New]
,[ChangeDate]
,[UserID])
VALUES
(
<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#auditLog.BranchID#" />
,<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#auditLog.FieldName#" />
,<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#auditLog.Old#" />
,<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#auditLog.New#" />
,getdate()
,<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#auditLog.UserID#" />
)
</cfquery>
<cfset testVar = "true">
<cfreturn testVar>
</cffunction>
</cfcomponent>
UPDATE:
Here is the information from the cfdump, I changed all three values:
<th class="query" colspan="6" onClick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">query</th>
</tr>
<tr bgcolor="eeaaaa" >
<td class="query" style="cursor:pointer;" title="click to collapse" onClick="cfdump_toggleRow_qry(this);"> </td>
<td class="query">BRANCHID</td>
<td class="query">FIELDNAME</td>
<td class="query">NEW</td>
<td class="query">OLD</td>
<td class="query">USERID</td>
</tr>
<tr >
<td style="cursor:pointer;" title="click to collapse" onClick="cfdump_toggleRow_qry(this);" class="query">1</td>
<td valign="top">YYZ </td>
<td valign="top">BranchDescription </td>
<td valign="top">BranchLabel-New </td>
<td valign="top">BranchLabel </td>
<td valign="top">user.name </td>
</tr>
<tr >
<td style="cursor:pointer;" title="click to collapse" onClick="cfdump_toggleRow_qry(this);" class="query">2</td>
<td valign="top">YYZ </td>
<td valign="top">BranchFilter </td>
<td valign="top">Branch </td>
<td valign="top">Headquarters </td>
<td valign="top">user.name </td>
</tr>
<tr >
<td style="cursor:pointer;" title="click to collapse" onClick="cfdump_toggleRow_qry(this);" class="query">3</td>
<td valign="top">YYZ </td>
<td valign="top">Address1 </td>
<td valign="top">Address1-new </td>
<td valign="top">Address1 </td>
<td valign="top">user.name </td>
</tr>
</table>
<wddxPacket version='1.0'><header/><data><string>YYZ</string></data></wddxPacket>
I found out what I was doing wrong from a fellow worker bee here in the office.
I simply needed to wrap the cfquery in the auditBranchLog in cfoutput tags like thus:
<cfoutput query="arguments.auditLog">
<cfquery name="auditBranchQry" datasource="[...]">
[...]
</cfquery>
</cfoutput>
This allowed ColdFusion to loop through the query.
I feel rather sheepish.
Thank you James for your help, it did get me looking outside of the answer I was seeking.
On this code
<!---BranchDescription--->
<cfif "#ARGUMENTS.branchDescription#" NEQ "#ARGUMENTS.branchDescription_Old#">
<cfset newrow = QueryAddRow(auditLog)>
<cfset temp = QuerySetCell(auditLog,"BranchID","#ARGUMENTS.branchID#")>
<cfset temp = QuerySetCell(auditLog,"FieldName","BranchDescription")>
<cfset temp = QuerySetCell(auditLog,"Old","#ARGUMENTS.branchDescription_Old#")>
<cfset temp = QuerySetCell(auditLog,"New","#ARGUMENTS.branchDescription#")>
<cfset temp = QuerySetCell(auditLog,"UserID","#getUserID()#")>
</cfif>
<!---Address1--->
<cfif "#ARGUMENTS.address1#" NEQ "#ARGUMENTS.address1_Old#">
<cfset newrow = QueryAddRow(auditLog)>
<cfset temp = QuerySetCell(auditLog,"BranchID","#ARGUMENTS.branchID#")>
<cfset temp = QuerySetCell(auditLog,"FieldName","Address1")>
<cfset temp = QuerySetCell(auditLog,"Old","#ARGUMENTS.address1_Old#")>
<cfset temp = QuerySetCell(auditLog,"New","#ARGUMENTS.address1#")>
<cfset temp = QuerySetCell(auditLog,"UserID","#getUserID()#")>
</cfif>
<cfif auditLog.RecordCount NEQ 0>
<cfinvoke component="auditBranchLog" method="auditBranch" auditLog="#auditLog#" >
</cfif>
It looks like you are pushing a query in some sort of ORM Style.
It would be useful to consider
<cfdump var="#auditlog#">.
Having one function for each action rather than a single auditBranch
Seeing all those QuerySetCell() makes me think a different approach may be needed.
UPDATE
The following is suggested
<cfdump var="#auditlog#">
<cfif auditLog.RecordCount NEQ 0>
<cfinvoke component="auditBranchLog" method="auditBranch" auditLog="#auditLog#" >
</cfif>
I have a CFML page that allows a user to input quite a bit of info and save it (MS SQL). Then they can create a psuedo report page that's contained in a textarea.
<cfform action="index.cfm?fa=customReportAction" method="post">
<cfif benchInfo.custom_report EQ "" or attributes.submit eq "Generate New Reports">
<cfif attributes.submit eq "Generate New Reports">
This is a new version of the report<br>
</cfif>
<cftextarea name="custom_report" richtext="true" value="#body_temp#" width="1000" height="600">
<cfoutput>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<div align="center" >
<br />
<br />
<div>
<img src="#replace(request.controlurl,'https','http')#images/Logo.png" />
</div>
<br />
<br />
<div style="font-size:20px; font-weight:bold; padding-top:25px;">Benchmark Comparative Study
<br />
Summary</div>
<div style="padding-top:10px; "><h2>
#benchInfo.name#
</h2></div>
lots of code...............
</cfoutput>
</cftextarea>
<br />
<br />
<cfelse>
<cftextarea name="custom_report" richtext="true" value="#benchInfo.custom_report#" width="1000" height="600"></cftextarea><br /><br />
</cfif>
<cfinput type="hidden" name="benchid" value="#attributes.benchid#" />
<cfinput type="submit" value="Submit" name="Submit" />
</cfform>
The submit button takes them to the action page that creates the cfdocument;
<cfparam name="doc_title" default = "#replace(benchInfo.title, " ", "_", "all")#" />
<cfset doc_title = #replace(benchInfo.title, " ", "_", "all")# />
<cfset custom_report2 = "#replace(form.custom_report, "<--- This is a page break --->", "|", "all")#">
<cfinvoke component="cfc.updates" method="updSalBenchCustomReport" sb_id="#attributes.benchID#" custom_report="#custom_report2#" />
<cfset infoReplaceBegin = "<!-- Info -->">
<cfset infoReplaceEnd = "<!-- End Info -->">
<cfdocument format="pdf" filename="#request.Controlpath#salarybenchmarking\reports\#benchid#\#doc_title#_client.pdf" overwrite="yes"
marginbottom=".5">
<cfdocumentitem
type = "footer">
<cfoutput>
<div style="float:left; text-align:left; border-top:1px solid ##910062; width:100%; padding-top:5px; horizontal-align:top;">
<img src="#request.controlurl#images/Logo_small.jpg" />
<span style="padding-left:215px; line-height:12px;">www.Tt.com</span>
<span style="padding-left:225px; font-size:12px;">Page #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</span>
</div>
</cfoutput>
</cfdocumentitem>
<cfoutput>
<cfset counter = 0>
<cfloop list="#custom_report2#" delimiters="|" index="x">
<cfset counter = counter + 1>
<cfif counter eq 1>
<cfset infoBegin = findnocase(infoReplaceBegin,x)>
<cfset infoEnd = findnocase(infoReplaceEnd,x)>
<cfif val(infoBegin) and val(infoEnd) and (val(infoEnd) gt val(infoBegin))>
<cfset stringCount = evaluate((infoend - infobegin)+len(infoReplaceEnd))>
<cfset tempString = mid(x,infoBegin,stringCount)>
<cfset x = replacenocase(x, tempString, '')>
</cfif>
</cfif>
#x#
<!--- Check to see if it's not the last delimiter --->
<cfif counter lt evaluate(listlen(custom_report2,"|")-1)>
<cfdocumentitem type="pagebreak"></cfdocumentitem>
</cfif>
</cfloop>
</cfoutput>
</cfdocument>
<cfset compReplaceBegin = "<!-- Companyname -->">
<cfset compReplaceEnd = "<!-- End Companyname -->">
<cfdocument format="pdf" filename="#request.Controlpath#salarybenchmarking\reports\#benchid#\#doc_title#_participant.pdf" overwrite="yes" marginbottom="0">
<cfoutput>
<cfloop list="#custom_report2#" delimiters="|" index="x">
<cfset compBegin = findnocase(compReplaceBegin,x)>
<cfset compEnd = findnocase(compReplaceEnd,x)>
<cfif val(compBegin) and val(compEnd) and (val(compEnd) gt val(compBegin))>
<cfset stringCount = evaluate((compend - compbegin)+len(compReplaceEnd))>
<cfset tempString = mid(x,compBegin,stringCount)>
<cfset x = replacenocase(x, tempString, '')>
</cfif>
#x#
<div style="float:left; position:absolute; top:925px; text-align:center; border-top:1px solid ##910062; width:100%; padding-top:5px;">
<div style="float:left; "><img src="#request.controlurl#images/Logo_small.jpg" /></div>
<div style="text-align:center; float:left; width:80%;">www.Tt.com</div>
<div style="float:right; position:absolute; width:100%; text-align:right; font-size:10px; padding-top:10px;">Page 1 of 1</div>
</div>
<cfbreak>
</cfloop>
</cfoutput>
</cfdocument>
<cfoutput>
<br />
View Client PDF<br />
<br />
View Participant PDF<br />
<br />
<a href="#request.controlURL#salarybenchmarking/index.cfm?fa=view&benchID=#attributes.benchID#" >Return to Benchmark Details</a><br />
<br />
Salary Benchmarking Home<br />
<br />
</cfoutput>
The problem comes in when a little too much data is entered an automatic page break is created. Sometimes the user has to spend time abbreviating their notes to make it fit on the page. I was thinking I could allow them to change the font/size and save that info. Then they can re-create the PDF and see if it "fits". I can see where a global font/size might be a little tricky. I need some type of dialog box to allow the user to make a global font selection.
<cfdocument scale="xx">
zooms the whole pdf
I have some buttons to generate PDF files inline in the browser.
The buttons will open a new window the first time and generate the PDF correctly.
However, if you click on any other button to generate the PDF file, which reloads the 2nd browser window, it becomes blank in IE. It however works in Google Chrome.
Here are my two buttons
<form target="blank" action="create_label.cfm" method="post">
<input type="hidden" value="Doe, John" name="full_name">
<input type="hidden" value="11 Test Ave" name="street_line1">
<input type="hidden" value="Testville, CA 00123" name="street_line3">
<button class="btn btn-small btn-success" type="submit">
<form target="blank" action="create_label.cfm" method="post">
<input type="hidden" value="Doe, Jane" name="full_name">
<input type="hidden" value="12 Test Ave" name="street_line1">
<input type="hidden" value="Testville, CA 00123" name="street_line3">
<button class="btn btn-small btn-success" type="submit">
As you can see each button sends address info to create_label.cfm
The first time you click a button, it opens the blank window and loads the form data in pdf.
If I then go back and click either button again, the window will update and then become blank. Only in IE though. If i do this in Chrome it actually updates the pdf with the correct address.
Here is the create_label.cfm code
<cfdocument format="PDF" localurl="no" marginTop=".1" marginLeft=".1" marginRight=".1" marginBottom=".1" pageType="custom" pageWidth="2.625" pageHeight="2.0" overwrite="true">
<table width="225px" border="0" cellspacing="2" cellpadding="2">
<cfoutput>
<cfif isDefined('form.full_name')>
<span style = "font-size:12px">#form.full_name#</span><br />
</cfif>
<cfif isDefined('form.street_line1')>
<span style = "font-size:12px">#form.street_line1#</span><br />
</cfif>
<cfif isDefined('form.street_line2')>
<span style = "font-size:12px">#form.street_line2#</span><br />
</cfif>
<cfif isDefined('form.street_line3')>
<span style = "font-size:12px">#form.street_line3#</span><br />
</cfif>
<cfif isDefined('form.street_line4')>
<span style = "font-size:12px">#form.street_line4#</span><br />
</cfif>
</cfoutput>
</table>
</cfdocument>
Any ideas why IE would not allow this? Is it caching something between IE and Adobe?
Thanks,
Tony