Gregor Kiddie escreveu: > > It all comes down to how you are printing the TextArea in the first place! > > PrintJob allows you to give a Rectangle along with the Sprite to > define the printing area. > > Once you’ve called PrintJob.start() you can get the pageWidth and > pageHeight of the paper and use these values along with the sizes of > your TextArea to create your print area. You can then call > PrintJob.addPage() as many times as required to cover all your TextArea. > > Does that make sense? > > Gk. > > **Gregor Kiddie** > Senior Developer > *INPS* > > Tel: 01382 564343 > > Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ > > Registered Number: 1788577 > > Registered in the UK > > Visit our Internet Web site at www.inps.co.uk > <blocked::http://www.inps.co.uk/> > > The information in this internet email is confidential and is intended > solely for the addressee. Access, copying or re-use of information in > it by anyone else is not authorised. Any views or opinions presented > are solely those of the author and do not necessarily represent those > of INPS or any of its affiliates. If you are not the intended > recipient please contact [EMAIL PROTECTED] > > ------------------------------------------------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] > *On Behalf Of *Otto > *Sent:* 08 January 2008 14:40 > *To:* flexcoders@yahoogroups.com > *Subject:* [flexcoders] Printing very long textarea > > Hello, > I've run into a small issue making a print feature for my application > (flex3 beta3). I have a textarea that may contain lots of text, > enough to wrap beyond the first page. The problem is that it doesn't > wrap inbetween lines but it just cuts a line in two. See sample pdf > here [1]. > > Is there any way around this? Is it possible to split the textarea in > two programmatically? > > cheers, > Otto > > [1] http://themansion.mine.nu/otto/files/split.pdf > <http://themansion.mine.nu/otto/files/split.pdf> > > > > __________ NOD32 2769 (20080107) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com Hi,
I'm making a PrintTextArea component wich is basically a TextArea with simillar behaviour to PrintDatagrid. Still has some bugs, so I'll repost has soon has I corrected them. Read the documentation on PrintDatagrid to learn how to use this. By the way, if someone has corrections or suggestions on this please let me know. <?xml version="1.0" encoding="utf-8"?> <mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" change="invalidateSize()" verticalScrollPolicy="off" horizontalScrollPolicy="off" creationComplete="initComponent()"> <mx:Script> <![CDATA[ import mx.core.EdgeMetrics; public function get validNextPage():Boolean { var nextPosition:int = verticalScrollPosition + numLines - maxVerticalScrollPosition; return (nextPosition<numLines)?true:false; } public function nextPage():void { if(validNextPage) { var nextPosition:int = verticalScrollPosition + numLines - maxVerticalScrollPosition; if(nextPosition<maxVerticalScrollPosition) { verticalScrollPosition = nextPosition; } else { var nextHeight:Number = 0; for(var i:int=nextPosition-1;i<numLines;i++) { nextHeight += getLineMetrics(i).height; } height = nextHeight; validateNow(); verticalScrollPosition = maxVerticalScrollPosition; } } } private function get numLines():Number { invalidateProperties(); validateNow(); return textField.numLines; } private function initComponent():void { textField.antiAliasType = AntiAliasType.NORMAL setStyle("fontAntiAliasType","normal"); } ]]> </mx:Script> </mx:TextArea> Regards, Frederico Garcia -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/