vlad2005
08-16-2008, 07:34 PM
I work to an test example, that figure what is happening.
First, i have an simple component, named printTest, located into "components" directory, that i want to print. This is code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="600" height="848" backgroundColor="#FFFFFF" borderColor="#000000" borderStyle="none">
<mx:Text id="txt0" fontFamily="Arial" fontWeight="bold" fontSize="12" color="#000000" x="10" y="10"/>
</mx:Canvas>
Second i have an test example, basically with two buttons. One print component directly, and another with 1 second delay.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="450" height="197">
<mx:Script>
<![CDATA[
import mx.printing.FlexPrintJob;
import mx.printing.FlexPrintJobScaleType;
import components.printTest;
import mx.utils.*
private var interval:uint;
private var thePrintView:printTest;
private function printDelayed():void
{
thePrintView = new printTest();
addChild(thePrintView);
thePrintView.txt0.text = '12345678901234567890';
interval = setInterval(doPrint,1000);
}
private function doPrint():void
{
clearInterval(interval);
var printJob:FlexPrintJob = new FlexPrintJob();
printJob.printAsBitmap = false;
if (printJob.start()) {
printJob.addObject(thePrintView,FlexPrintJobScaleT ype.SHOW_ALL);
printJob.send();
removeChild(thePrintView);
}
}
private function printDirectly():void
{
var printJob:FlexPrintJob = new FlexPrintJob();
printJob.printAsBitmap = false;
if (printJob.start()) {
thePrintView = new printTest();
addChild(thePrintView);
thePrintView.txt0.text = '12345678901234567890';
printJob.addObject(thePrintView,FlexPrintJobScaleT ype.SHOW_ALL);
printJob.send();
removeChild(thePrintView);
}
}
]]>
</mx:Script>
<mx:Button y="50" label="Print with delay" horizontalCenter="-143" click="printDelayed();"/>
<mx:Button y="50" label="Print direct" horizontalCenter="104" click="printDirectly();"/>
</mx:Application>
When i print without delay, last char from string is visible only half ("zero" symbol). When i test with delay, everything is ok.
Please, can someone confirm this behavior?
I test using an HP 1200 laser printer, and PrimoPdf to write output to pdf. Same result.
First, i have an simple component, named printTest, located into "components" directory, that i want to print. This is code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="600" height="848" backgroundColor="#FFFFFF" borderColor="#000000" borderStyle="none">
<mx:Text id="txt0" fontFamily="Arial" fontWeight="bold" fontSize="12" color="#000000" x="10" y="10"/>
</mx:Canvas>
Second i have an test example, basically with two buttons. One print component directly, and another with 1 second delay.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="450" height="197">
<mx:Script>
<![CDATA[
import mx.printing.FlexPrintJob;
import mx.printing.FlexPrintJobScaleType;
import components.printTest;
import mx.utils.*
private var interval:uint;
private var thePrintView:printTest;
private function printDelayed():void
{
thePrintView = new printTest();
addChild(thePrintView);
thePrintView.txt0.text = '12345678901234567890';
interval = setInterval(doPrint,1000);
}
private function doPrint():void
{
clearInterval(interval);
var printJob:FlexPrintJob = new FlexPrintJob();
printJob.printAsBitmap = false;
if (printJob.start()) {
printJob.addObject(thePrintView,FlexPrintJobScaleT ype.SHOW_ALL);
printJob.send();
removeChild(thePrintView);
}
}
private function printDirectly():void
{
var printJob:FlexPrintJob = new FlexPrintJob();
printJob.printAsBitmap = false;
if (printJob.start()) {
thePrintView = new printTest();
addChild(thePrintView);
thePrintView.txt0.text = '12345678901234567890';
printJob.addObject(thePrintView,FlexPrintJobScaleT ype.SHOW_ALL);
printJob.send();
removeChild(thePrintView);
}
}
]]>
</mx:Script>
<mx:Button y="50" label="Print with delay" horizontalCenter="-143" click="printDelayed();"/>
<mx:Button y="50" label="Print direct" horizontalCenter="104" click="printDirectly();"/>
</mx:Application>
When i print without delay, last char from string is visible only half ("zero" symbol). When i test with delay, everything is ok.
Please, can someone confirm this behavior?
I test using an HP 1200 laser printer, and PrimoPdf to write output to pdf. Same result.