RE: [flexcoders] FlexPrintJob problem

2007-03-09 Thread Giles Roadnight
I solved this by adding a cretionComplete event listener to the canvas
object. This fired another function that did the printing.

 

Giles Roadnight

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Giles Roadnight
Sent: 09 March 2007 10:04
To: flexcoders@yahoogroups.com
Subject: [flexcoders] FlexPrintJob problem

 

Hi

 

I am trying to print a list of ID's from a canvas. I have the following
code:

 

private function printMovies(e:Event):void

{



var printJob:FlexPrintJob = new FlexPrintJob();



if(printJob.start()){  

var printCanvas:Canvas = new Canvas();

var txtApprovedList:Text = new Text();

txtApprovedList.width = printJob.pageWidth;

txtApprovedList.text = textstring;

code for generating string



printCanvas.addChild(txtApprovedList);

 
printCanvas.setStyle(backgroundColor,0xFF);



 
this.parentApplication.MainPanel.addChild(printCanvas); //just so I can see
it renders OK, will be removed



printJob.addObject(printCanvas);

printJob.send();

}

}

 

With the last 2 lines commented out I get the print dialogue then when I
click print the canvas appears with the text in. With the last 2 lines not
commented out I get the print dialogue but when I hit print nothing happens,
no canvas or text appears and nothing prints.

This code does work if I just add the Text Object (not the canvas) to print
but then the text has a grey background.

 

What am I doing wrong?

 

Thanks.

 

Giles Roadnight 

 

attachment: image001.jpg
attachment: image002.jpg


Re: [flexcoders] FlexPrintJob problem: application background colors showing in margins

2007-01-17 Thread Jason Y. Kwong

Since there doesn't appear to be any follow-up to this topic, I'll provide
an example.  I recently started working with printing (using 2.0.1) and
noticed this problem of the background colour bleeding through into the
margin of the printed output.  This might be printer/driver specific,
though.  It happens on my HP Photosmart 2575 printer, but doesn't happen
when I print to a PDF using CutePDF Writer.  A quick example follows below.
It would be good to know if this happens with other people's printers, and
hopefully someone has a workaround.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute
backgroundColor=0xff
   mx:Script
   ![CDATA[
   import mx.printing.FlexPrintJobScaleType;
   import mx.printing.FlexPrintJob;

   private function doPrint(): void
   {
   var job: FlexPrintJob = new FlexPrintJob();
   job.printAsBitmap = false;
   if (job.start())
   {
   job.addObject(preview, FlexPrintJobScaleType.SHOW_ALL);
   job.send();
   }
   }
   ]]
   /mx:Script

   mx:Button x=24 y=31 label=Print click=doPrint()/
   mx:HBox id=preview x=24 y=61 backgroundColor=0xff
paddingLeft=20 paddingRight=20 paddingTop=10 paddingBottom=0
   mx:Canvas height=665 width=500 backgroundColor=0xff
   mx:DataGrid x=0 width=100%
   mx:columns
   mx:DataGridColumn headerText=Column 1
dataField=col1/
   mx:DataGridColumn headerText=Column 2
dataField=col2/
   mx:DataGridColumn headerText=Column 3
dataField=col3/
   /mx:columns
   /mx:DataGrid
   /mx:Canvas
   /mx:HBox
/mx:Application


On 11/6/06, Samuel Reuben [EMAIL PROTECTED] wrote:


  can you send a the isolated printing code that you are seeing the
problem in?

Are you by any chance mentioning the corners that show the bg color,
specially when the component has rounded corners?

Thanks,
-sam

On 11/6/06, Tom Bray [EMAIL PROTECTED] wrote:

   The background color of my application is printing in the margins of
 the page when I print my component in landscape mode.  In portrait mode,
 there's a tiny sliver of the bg color on each side.  Is there a way to
 prevent that besides using a white background?  It seems like a bug since I
 can't actually print my component in those areas (it gets cropped at the
 margins) but the background color shows anyway.  Any thoughts?

 Thanks,

 Tom


 



Re: [flexcoders] FlexPrintJob problem: application background colors showing in margins

2007-01-17 Thread luciano

Hi,
I'm having a similar problem.
The effect that i'm getting is that it prints a line depending on the fit
done when the component is rendered.
As i'm using FlexPrintJobScaleType.SHOW_ALL, some reports are scaled with
MATCH_HEIGHT and others with MATCH_WIDTH.
When the print job is scaled to fit the width, a vertical line is printed at
the right of the paper, and when the job is scaled to height the line is
printed horizontally at the bottom of the page.
I assume that this line is the background as it haves the same width or
height than the printed component.

Any clue?

thanks for the info

Luciano


On 11/5/06, Tom Bray [EMAIL PROTECTED] wrote:


  The background color of my application is printing in the margins of the
page when I print my component in landscape mode.  In portrait mode, there's
a tiny sliver of the bg color on each side.  Is there a way to prevent that
besides using a white background?  It seems like a bug since I can't
actually print my component in those areas (it gets cropped at the margins)
but the background color shows anyway.  Any thoughts?

Thanks,

Tom




Re: [flexcoders] FlexPrintJob problem: application background colors showing in margins

2006-11-06 Thread Samuel Reuben



can you send a the isolated printing code that you are seeing the problem in?Are you by any chance mentioning the corners that show the bg color, specially when the component has rounded corners?Thanks,
-samOn 11/6/06, Tom Bray [EMAIL PROTECTED] wrote:













  



The background color of my application is printing in the margins of the page when I print my component in landscape mode. In portrait mode, there's a tiny sliver of the bg color on each side. Is there a way to prevent that besides using a white background? It seems like a bug since I can't actually print my component in those areas (it gets cropped at the margins) but the background color shows anyway. Any thoughts?
Thanks,Tom

  















__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___