Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
jmicah #1
Creating a print window
I am working on creating a print window (TitleWindow) that can be used
throughout my application as a "canvas" to drop in visual objects that need to
be printed. I opted for this route because I can add a header or footer and
control the size of the window. I can call the print window and pass it a
header just fine because it is merely a string object bound to a label on the
print window. My problem comes in passing the print window a visual object
(ie. VBox) that I want added to the print window. I have tried using the
createChild() method for the TitleWindow and also creating a static VBox that
holds all of the print content and using its createChild() method to add the
passed in VBox to the window. No luck. Any suggestions would be great.
printScreen = mx.managers.PopUpManager.createPopUp(_root, printCanvas, true,
{printHeader:cSummary, printBody:someVBox});
<mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml" width="600"
height="700" creationComplete="initContent()">
<mx:Script>
<![CDATA[
var printHeader:String;
var printBody:mx.containers.VBox;
function initContent() {
var printDetail = printContent.createChild(printBody, "detail");
}
function startPrint() {
var pageCount:Number = 0;
var my_pj:PrintJob = new PrintJob();
if (my_pj.start())
{
// Print the content of this window
my_pj.addPage(printContent);
}
// If addPage() was successful at least once, print the spooled pages.
if (pageCount > 0){
my_pj.send();
}
delete my_pj;
}
]]>
</mx:Script>
<mx:VBox id="printContent" width="100%" height="100%">
<mx:Label id="header" text="{printHeader}"></mx:Label>
<mx:Spacer height="20"></mx:Spacer>
</mx:VBox>
</mx:TitleWindow>
jmicah Guest
-
Creating PDFs from Freehand -- print to PDFvs. export vs. print/scan to PDF?
I've had a lot of compatibility problems with created presentations so have started using Acrobat instead of trying to export my Macromedia Freehand... -
Help with javascript:window.print()
I am trying to send a specific page to the printer using javascript:window.print(). There has to be a way top so this. I assume the variable can... -
Trouble with javascript:window.print
My page is an ASP with a lot of VB. Go to http://71.97.138.65/isgmsds/ Then go to http://71.97.138.65/isgmsds/search(new).asp?t=i You will... -
Bringing up the PRINT window
Thanks to those who helped me out with this question before. I'm using the "getURL" command on a button in Flash to open a document in a separate... -
Discrepancy in color between Photoshop window and print window
My photos look very dark and saturated when I load them in Photoshop 7 or Photoshop Elements 2.0, but when viewed in the printer's preview window... -
ntsiii #2
Re: Creating a print window
Printing in Flex 1.5 sucks.
Also, it sounds like you are trying to "re-parent" a component into your title
window, but this is not possible in 1.5.
I hope someone can correct me, but the only way to print succesfully is to
have an entire static component for each print view you want.
That said, I advise continuing on the trachkyou are on for a while. Try
passing a reference to the main application scope into the title window. Then
try using this reference to get your PrintContent.
[url]http://www.cflex.net/showfiledetails.cfm?ObjectID=197[/url]
Let us know if you have any success.
Tracy
ntsiii Guest
-
jmicah #3
Re: Creating a print window
I realized after I made the post that the problem was probably related to
reparenting and you just affirmed my hypothesis. Before I read your post I
decided to go the route of a static print window for each different screen I
wanted to print. So basically, I went the route you suggested and it seems to
be working fine. Another issue that I had to work around though was the fact
that my application must consider people running 800 x 600 resolutions which
gives me very little real estate for printing since what prints is what is
showing on the screen. The printing functionality is very disappointing. I
guess we'll see what they do for 2.0. Thanks for your reply.
jmicah Guest
-
ntsiii #4
Re: Creating a print window
" printing functionality is very disappointing" yeah.
You probably know this but you can print more than a screen's worth in a print
job, it is just that you can only print one screen's worth per page.
Tracy
ntsiii Guest
-
jmicah #5
Re: Creating a print window
Yes I did know that, but thanks for the heads up anyway. I would rather be
able to use the entire printable page instead of maybe half per page. That
really looks unprofessional. Thanks again for your help.
jmicah Guest



Reply With Quote

