Monthly Archives: August 2006

Printing in Flex 2

This morning I decided I needed to tackle printing for the project I’m working on. I more or less expected to spend a good part of the day figuring it out. Boy was I wrong! I had my project printing output

While it’s entirely possible to get fancy (which I plan to do tomorrow) to start it’s as simple as

import the class for flex printing:

import mx.printing.FlexPrintJob;

Create a new PrintJob, then start the print job.

var printJob:FlexPrintJob = new FlexPrintJob();
printJob.start();

One thing to keep in mind. Once you’ve started the print job, don’t do too much (really don’t do any) non printing work. Don’t interact with the client, anything. Group all your printing.

then simply add items to the print job.

printJob.addObject(object);

Each addObject is a new page in the printjob (so doing the above 10 times gets you 10 pieces of paper in the printer).

When you’re all done, send your printjob to the printer (really you’re sending it to the OS. From here the print dialogue will open in your OS

printJob.send();

The object you pass the addObject() method can be a layout container (HBox, VBox, etc) or a single text object. My first run at printing, I wrapped my bits in a VBox, then passed the VBox to the addObject() method.

Once I got this solution soundly working I delved a bit deeper and found that a perhaps better solution is to create a printview component. Since often times (including my current project) your application looks a little different than what you’d like the printed output to look like. In my case I have some background colors and such that I don’t want on the print out. So my printview will simply be a component devoid of any colors.

All in all printing in Flex 2 is incredibly easy, in fact IMO much easier than printing in CF/HTML

Good ol’ M$ our product rocks, for everyone but us

So my Friend Citlali send me this link. What’s funny isn’t that M$ thinks there are 400 cool features of Visual Studio, you can’t get elsewhere. though who knows. I’ve never been accosted by a co-worker in plastic knight armor so that’s definitely 1 in their column :)

What’s funny is the site is in Flex. Not M$’s "Flash Killer" I can’t remember the name. It might be sparkle, or maybe that was the "flash killer" they released 2-3 years ago that no one uses. At any rate, it’s not an M$ technology.

I know there’s nothing keeping M$ from using some one else’s technology, or any other company for that matter, but it’d be equally funny if php.net was running ASPX, or if Adobe.com was running on PHP. or if M$’s user manuals came in Open Office Format.

They have a "Flash killer" why not use it? It may not be gold yet. I don’t follow M$ dev much. But still.

MAX Scheduler is out

Actually it’s been out a week or so. But I’ve been busy.

As soon as I got the email I hot footed it over to adobe.com to pick my sessions. The app is very Cool. Of course it’s Flex.

If you’re at all curious, click below to check out where I’ll be and when I’ll be there. Subject to change with out notice. :)

Flex 2 Apps

Updates have been few lately, my apologies. I’m sure google bot understands.

Been working on a really cool project for Esria, learning Cairngorm, and working on my own Red Omega project. Have I mentioned how much I love Flex2!? With CF in the background, Flex apps rock!

The Esria project is/has been great! I’ve learned a ton (I don’t bill for learning, don’t worry). I’m fairly comfortable with Cairngorm. Even though it may not be my first choice of architectures, it does a good job. I just think it’s over complicated.

This was just a quick update to let the bots, and readers out there know that I’m not dead, haven’t abandonned this blog or anything like that.