coldfusion

How to set the height of a PDF header?

半城伤御伤魂 提交于 2019-12-12 13:15:24
问题 Does anyone know how I can set the height of a header in a pdf generated by <cfdocumentitem format="pdf:... ? I am using <cfdocumentitem type="header"> So have something like <cfdocument format="pdf" marginbottom="0" margintop="4" marginleft="0" marginright="0" pagetype="a4" unit="cm" fontembed="no"> <cfdocumentitem type="header"> This is my header.. I want to reduce the height but can't work out how. <cfdocumentitem> </cfdocument> Thanks in advance for any pointers. Jason 回答1: Use the margin

Generating Powerpoint PPT with ColdFusion?

╄→гoц情女王★ 提交于 2019-12-12 12:27:53
问题 Does anyone know if it's possible to generate powerpoint ppts within ColdFusion? I can't rely on the approach of installing a copy of office and generate one through COM and I can't use ooxml since my client is still in the office 2003 era. Any suggestion is much appreciated. 回答1: You can try using Apache POI, specifically their Powerpoint support. Looks to be still in beta though: http://poi.apache.org/slideshow/index.html I've used POI to extra from Word docs before and it was rather easy

ColdFusion VARIABLES Race Condition?

≯℡__Kan透↙ 提交于 2019-12-12 12:23:03
问题 I would like some help identifying why this particular code, in rare circumstances, produces a race condition. I've found a fix, which I'll outline as well, but I really want to understand it. We have a CMS based system comprised of many modules loosely based off a fusebox model. Everything runs through a single index.cfm. In our Index.cfm we are creating a couple instances of Components, some are bsaed on the APPLICATION.PortalApp instance created in Application.cfc. I'm not including that

Prevent SQL injection without using cfqueryparam

喜夏-厌秋 提交于 2019-12-12 12:08:40
问题 I have old projects containing a lot of queries which are not using cfqueryparam to prevent SQL injection. Is there any way to use some function to do similar on Application level on each form field? As a beginner with a PHP background, I thought I could loop posted data and do an escape_string() or similar. but I don't want data to be saved in escaped form. I think cfqueryparam doesn't save data in escaped form. (I haven't tried it yet. I'm new at CF.) Otherwise, I have to unescape the data

Creating QR Codes with ColdFusion

被刻印的时光 ゝ 提交于 2019-12-12 11:55:07
问题 Is there any way with pure ColdFusion/cfscript to produce a QR code, without relying on external APIs or JavaScript? 回答1: No. ColdFusion cannot generate bar codes by itself. You need a separate tool or library. It is easy enough to install a java library, like ZXing. Then generate the images from CF. Alternately, you could do a <cfhttp> call to an external server that generates the bar code image for you, or basically do the same thing with javascript. You would not need to install anything

How to loop over array of structures and display all key values

时间秒杀一切 提交于 2019-12-12 11:51:45
问题 I am looping over an array of structures and trying to assign and store all key values. If I wrap inner loop in <cfoutput> , I am getting an error: "Complex object types cannot be converted to simple values". If I leave it out, then it does not work. What am I missing? <cfif isJSON(httpResp.fileContent)> <cfset jsonData = deserializeJSON(httpResp.fileContent) /> <cfloop from="1" to="#arrayLen(jsonData)#" index="i"> <cfset data = jsonData[i]> <!---<cfoutput>---> <cfloop collection="#data#"

How can I call a function in another CFC file from within a query of a function in one cfc file?

主宰稳场 提交于 2019-12-12 11:34:22
问题 I have one cfc file (info.cfc) with multiple functions as shown below. <cfcomponent output="true" extends="DateFunctions"> <cffunction name="getStatuses" access="remote" returntype="any" output="true" returnformat="plain"> ... </cffunction> <cffunction name="viewDate" access="remote" returntype="any" output="true" returnformat="plain"> <cfquery name="records"> SELECT dbo.tickets.Incident, dbo.tickets.Start_Date, dbo.tickets.Days_Due FROM dbo.tickets </cfquery> </cffunction> </component> And

Automatic Type Conversion in ColdFusion 11

你说的曾经没有我的故事 提交于 2019-12-12 11:30:43
问题 I am migrating an application from ColdFusion 9 to ColdFusion 11. In the existing code there is an assignment of a variable to false : <cfset VARIABLES.roleTypeId = false > And then, farther down, a function that expects this variable to be numeric: <cffunction name="rolesForStudy" > <cfargument name="id" hint="Study Id"> <cfargument name="roleTypeId" default="#VARIABLES.roleTypeId#" type="numeric"/> </cffunction> I inherited the code, and I cannot defend the original programmer's decision to

How to add a pure javascript compiler plugin server-side when running CFGroovy in Coldfusion?

Deadly 提交于 2019-12-12 11:30:36
问题 I'm trying to sell myself to the idea of trying to build enhanced Jquery Mobile markup on the server (running Coldfusion8 ) and then try to use DustJS (Javascript templating engine) to precompile the markup into a js string, which I want to server as a static file. I think I have it down to trying to add the plugin in Coldfusion. Here is what I want to do: Start with a template like this in Coldfusion: <cfsavecontent variable="renderedResults"> <cfoutput> {##person}{root}: {name}, {age}{

With what is the key padded in cfusion_encrypt in c# alternative?

末鹿安然 提交于 2019-12-12 11:12:33
问题 I found an answer to replicate the cfusion_encrypt function in C# from here... ColdFusion - cfusion_encrypt() and cfusion_decrypt() - C# alternative But the answer doesn't say with what the key is padded with to make it the same length as the clear text? Can anyone suggest what the key is padded with? And whether it is padded to the right or left? 回答1: This provides more clarity on what the function does. cfusion_encrypt The key is repeated a number of times until it is longer or equal to the