Skip to content

AIR 横版打印

ythy edited this page Aug 31, 2017 · 1 revision

先看段代码

var pj:FlexPrintJob = new FlexPrintJob();
box.rotation=90; //box width 810 高 561
pj.addObject(box, FlexPrintJobScaleType.NONE);

此时, pj 实际打印高度只有561 翻转后的高度810不生效 导致打印不全,处理方法:

var canvas:Canvas = new Canvas();
canvas.horizontalScrollPolicy = "off";
canvas.verticalScrollPolicy = "off";
canvas.width = 561;
canvas.height = 810;
this.addChild(canvas);
canvas.addChild(box);
box.x = 561;
box.y = 0;
box.rotation=90;
pj.addObject(canvas, FlexPrintJobScaleType.NONE);

新建一个canvas撑开打印区域, box在canvas内翻转。
注意box的x值等于宽度 否则翻转90度后就看不见了

Clone this wiki locally