显然这是一个已知的bug与Flex印刷库和滚轮控制。您可以在此阅读这里我的讨论: http://forums.adobe.com/message/3626759
作为一种变通方法,我做了以下内容:
var printer:FlexPrintJob = new FlexPrintJob();
// Display the print dialog to the user. If they choose a printer
// and click "print", this method will return true, and we will
// spool the job to the printer they selected. If they hit cancel,
// this method will return false, and we will not attempt to send
// anything to the printer.
if(printer.start()){
// Add some padding before spooling the object to the printer.
// This will give it a reasonable margin on the printout.
itemsToPrintContainer.paddingBottom = 100;
itemsToPrintContainer.paddingTop = 100;
itemsToPrintContainer.paddingLeft = 100;
itemsToPrintContainer.paddingRight = 100;
this.removeElement(itemsToPrintContainer);
FlexGlobals.topLevelApplication.addElement(itemsToPrintContainer);
printer.addObject(itemsToPrintContainer);
printer.send();
FlexGlobals.topLevelApplication.removeElement(itemsToPrintContainer);
this.addElement(itemsToPrintContainer);
// Reset the margins to 0 for display on the screen.
itemsToPrintContainer.paddingBottom = 0;
itemsToPrintContainer.paddingTop = 0;
itemsToPrintContainer.paddingLeft = 0;
itemsToPrintContainer.paddingRight = 0;
}
,我做正在我想的滚轮之外打印对象,打印它,然后将其移回滚动器内部,以便用户不知道任何更改。用户可能会在屏幕上看到一个简短的闪光,而事情被重新排列,但对于我的情况是可以接受的。
此外,填充是尝试向我的打印输出添加页边空白。如果您有多个页面,它将无法正常工作。你可能不想在你的特定情况下添加填充。
-Josh
为什么这不被标记为答案?这是一个可靠的解决方法。 – JTtheGeek 2011-05-17 00:18:12
好主意 - 这应该被标记为正确的答案。在我的情况下(生成alivepdf)没有必要将容器放到topLevelApplciation。 – 2012-06-17 11:25:06