--- In [email protected], "Gregor Kiddie" <[EMAIL PROTECTED]>
wrote:
> 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.
Thanks for the quick reply. Yes, I have the pageHeight and the
textarea height. The problem is that I'm not sure how to split the
textarea into pages, I'm pretty new to flex/as3. Can I just treat it
like a bitmap and extract a page from 0 to pageHeight pixels and then
continue with the next page. But how can I then be certain that I
won't split a line in two. The textarea contains html text btw.
My code looks like this:
var newBox:VBox = new VBox();
newBox.setStyle("backgroundColor", "white");
this.addChild(newBox);
newBox.addChild(vBoxInterests);
trace("width: " + vBoxInterests.width);
trace("height: " + vBoxInterests.height);
newBox.width = printJob.pageWidth;
trace(printJob.pageWidth);
trace(printJob.pageHeight);
newBox.height = 2 * printJob.pageHeight;
printJob.addObject(newBox);
--
Otto