Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under coldfusion...

aqlong says...

Ever have Verity crash on your 24x7 website, but the only way you find
it's down is when someone complains or you see it in your error
logs/emails?

Want to be more proactive? Set up a Probe from ColdFusion to point to
this file (VerityProbe.cfm) on the physical server where Verity runs.
If there are multiple CF instances, they all share the same Verity
process, per physical server. Set you CF Probe in the CF Admin such
that it emails your IT team (or whomever is responsible for keeping
your system running). Then, they can go start/restart Verity right
away.

Filed under: ColdFusion

 I have been working on a tool that creates models, listeners, basic views and xml for MACH-II applications.

 

This has been identified as a requirement in our working environment to ensure we can grab some more time to do analysis and design.  We feel that this approach will allow us to jump straight In to the programming required to turn a basic application in to one that pretty much satisfies the requirements in a fraction of the time presently spent doing so.

Filed under: ColdFusion

aqlong says...

Peoplexs.com, in Holland (The Netherlands), has a great opportunity for a Junior Web Developer to join me and an international team of ColdFusion developers to work on some exciting new projects. We will be upgrading from ColdFusion 8 Enterprise to ColdFusion 9 Enterprise soon; we're on MySQL 5.1 Enterprise, all with powerful 64bit servers packed with RAM. We provide training, may help with relocation, a fun and casual work environment, time to attend CFUG meetings and SOTR, and we have a very experienced and senior-level group of developers and product managers to collaborate with on a daily basis. We're excited to here from you, and feel free to ask me any questions any time. I'm happy to help.

Apply to the Junior Developer position now

Aaron Longnion
http://twitter.com/aqlong
http://www.google.com/profiles/aqlong

Filed under: ColdFusion

simonbingham says...

Here's how it's done...

---

// Create an instance of the mail object
mail=new mail();

// Set it's properties
mail.setSubject( "Sample Email" );
mail.setTo( "to@example.com" );
mail.setFrom( "from@example.com" );
mail.setCC( "cc@example.com" );
mail.setBCC( "bcc@example.com" );

// Add an attachment
mail.addParam( file="C:\foo.txt" );

// Add email body content in text and HTML formats
mail.addPart( type="text", charset="utf-8", wraptext="72", body="This is a test message." );
mail.addPart( type="html", charset="utf-8", body="<p>This is a test message.</p>" );

// Send the email
mail.send();

---

More information about using the CFMAIL tag in CFSCRIPT can be found at http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSe9cbe5cf462523a0693d5dae123bcd28f6d-7ff9.html.

Filed under: coldfusion

Matt says...

I'm porting a ColdFusion 8 application to Open BlueDragon and the app in question generates documents using both iText and PDFBox (which I posted about before), and also generates PDF files from HTML content using CFDOCUMENT. When compared with CF 8 I ran into some differences with CFDOCUMENT so I figured I'd post them here. In general everything just works, so this is more formatting issues than anything else.

1. Use Full URLs for Images and CSS

This was covered by Nitai in a thread on the OpenBD mailing list a while ago, so consider this a reminder that you need to use full URLs for images and external stylesheets.

2. Tweak Your CSS as Needed

Because the underlying rendering engine differs between OpenBD and CF (not sure what CF is using, but OpenBD uses the amazing Flying Saucer project), you may see differences in the handling of CSS. None of the ones I ran into were biggies, and in many cases when I looked at the CSS being used, CF 8 wasn't doing what it was supposed to be doing so while the rendered output was what I wanted, it wasn't adhering properly to the CSS. One particular case I'll mention as an example--an h1 tag had a style of float:left in the CSS which wasn't being respected by CF 8, so when the document was generated in OpenBD there wasn't a break where I was expecting one. A quick change to float:none and all was well.

3. Empty Paragraphs Don't Count

I had some instances of <p> tags with CSS applied that were being used as spacers, to generate horizontal rules using a border style on the paragraph, etc. but these paragraph tags had nothing between them (e.g. <p class="spacer"><p>). If you don't have *something* in between the open and close paragraph tag the CSS doesn't seem to apply. Throwing a non-breaking space in (<p class="spacer"> </p>) worked great for me.

4. Font Differences

Remember that depending on OS platform and a bunch of other variables you may find differences in the fonts being output. In my case the CSS (which I got from someone else originally) was using Georgia as the main font and I don't have Georgia on my Ubuntu laptop, so the rendered output wasn't the same. Just make sure you have the fonts you want to use available. You can check the Fonts page in the OpenBD administrator to see how OpenBD hunts for fonts and to add your own font paths if necessary.

That's all I ran into with CFDOCUMENT on OpenBD--a few tweaks here and there and it's working fantastically well!

Filed under: ColdFusion

Matt says...

Adobe Flex 4 Training for ColdFusion Developers

A free full-day, hands-on training session, where attendees can learn how to build their first Flex application using the latest Flash Builder 4 beta software. This training is designed to help experienced ColdFusion developers get started in understanding how to add rich UI to existing and new ColdFusion applications.

Great opportunity for FREE Flex training at Fig Leaf in DC! Seating is limited so if you're interested, register right away.

Filed under: ColdFusion

Matt says...

In my continuing war against all things PDF in ColdFusion, today I believe I have achieved victory.

If you've been following my posts (OK, rants) over the past few weeks you'll know that I ran into some annoying bugs in CFPDFFORM that were wreaking all sorts of havoc with the one application I wrote that depends on CFPDFFORM for a key part of what it does. I sent my test case to Adobe Support and, well, there are probably a million ways to couch this nicely, but the bottom line is they told me they can't/won't fix the bug, and their suggested workaround was to use iText to populate my PDF forms instead of using CFPDFFORM. Given that I ran into another annoying bug with CFPDFFORM a couple of years ago and got another "can't/won't fix" answer, this was strike two for CFPDFFORM. And personally I don't like being backed into a corner by a third strike before making a change.

Now that my CFPDFFORM code had been changed over to use iText instead (which gave some nice speed benefits as well), the only remaining thing keeping me tied to ColdFusion 8 was the use of CFPDF to merge multiple PDFs into a single file. I looked into doing this with iText and although it's doable, even being the gearhead I am I have to admit that's a bit of a hassle. So before implementing that solution I decided to hunt around a bit more.

Enter Apache PDFBox.

PDFBox is already bundled with Open BlueDragon since we use it as the underlying libraries for some CFDOCUMENT functionality, but it's a version behind the absolute latest. Turns out that the newest version of PDFBox has a great, easy-to-use PDFMergeUtility built in. This made removing my dependence on CFPDF (which isn't in Open BlueDragon yet) pretty simple.

My application populates a varying number of individual PDF pages and then merges these pages into a single PDF file at the end of processing. So I use an "assembly" directory to build up the individual pages of the final result, and the final step is to merge the files. Previously I was using CFPDF for this:

<cfpdf action="merge" 
       source="#filesToMerge#"
       destination="#destDir##destFileName#.pdf"
       overwrite="true" />

And the PDFBox PDFMergeUtility solution looks like this:

<cfset pdfMerger = CreateObject("java", "org.apache.pdfbox.util.PDFMergerUtility").init() />

<cfloop list="#filesToMerge#" index="fileToMerge">
  <cfset pdfMerger.addSource(fileToMerge) />
</cfloop>

<cfset pdfMerger.setDestinationFilename("#destDir##destFileName#.pdf") />
<cfset pdfMerger.mergeDocuments() />

So it's a few more lines of code, but honestly not bad at all compared to the CFPDF version, and if you've been looking for ways to do some of what CFPDF and CFPDFFORM do in CF 8, between iText and PDFBox it looks like you're covered.

I was forced to make the switch from CFPDFFORM to iText in order to get around a bug in CFPDFFORM, and with that out of the way it was only one more step to make this application CFML engine agnostic. I need to do some additional testing but with the CF 8 dependencies removed the app is running great on Open BlueDragon. I'll do some comparison metrics but in initial testing, particularly since this is a CFC-heavy application, the speed and CPU load are both dramatically improved. Speed is about 30-50% faster (which makes a BIG difference when this app runs processing for hours at a time), CPU utilization is about half (CF completely pegs the CPU while this app is in full processing mode), and it's noticeably lighter on RAM as well. All told the minor hassle of reworking these portions of the app will have been well worth it.

Filed under: ColdFusion

simonbingham says...

Ok, this is my first attempt at using ColdFusion 9's built-in ORM features (and I'm very impressed!).

Download Sample Files

You can view the code, but will need to have ColdFusion 9 installed and the cfartgallery datasource which comes with the installation setup to execute it.

Filed under: coldfusion

aqlong says...

This "Battle of the Frameworks" CFUG meeting is going to be off the hook for ColdFusion developers who want to know which framework is best for their systems/projects.

Sign up at the bottom of the page here: http://www.cfug.nl/default/index.cfm/agenda/meeting-20-november/

Aaron Longnion
http://twitter.com/aqlong
http://cfzen.instantspot.com/blog
http://www.google.com/profiles/aqlong

Filed under: ColdFusion

Matt says...

I'm in PDF hell yet again today and had to vent. Now that iText fixed my
searchability problems (CFPDFFORM fail), I'm noticing cases where the font
in particular fields in the generated PDF does not in any way match the
settings that are in the PDF form when you look at the settings in Acrobat.

For example, all the form fields in one of the PDFs I'm working with are
set to font face Times New Roman and "Auto" for the font size. Random
fields here and there show up as Arial instead of Times New Roman and come
out some massive font size, even though other fields with the same amount
(or less) text are a reasonable size and are the correct font face.

Since I only recently figured out how to do mass changes of the font face
on multiple fields (usability fail; and this doesn't work consistently by
any means, but it's faster than doing it one by one), I thought I missed
setting the font face correctly on a field or two. But lo and behold when I
open the PDF form in Acrobat Pro the font is CLEARLY set correctly, yet the
generated PDF still renders the font incorrectly.

All that's bad enough, but the PDF size issue is really starting to kill
me. The particular PDF I'm modifying started out at about 500K in size. I'm
having to experiment with some things to figure out these annoying font
issues, so I changed all the fonts from Times New Roman to Arial, saved the
PDF, and the file size went up to 800K. I then changed the font back from
Arial to Times New Roman (which is what it was originally) and the file
size is now 1MB.

What. The. @$&*.

I'm sure there are stupid subtleties or fancy Acrobat Guru tips and tricks
of which I am woefully unaware but my file size shouldn't grow by 200K
every time I save it, so I'll declare this a "fail" and try to suffer
through. Once I get these god-forsaken things working if I never have to
touch Acrobat the rest of my natural life it'll be too soon.

Filed under: ColdFusion