actionscript 2在运行时打印为pdf被截断

时间:2015-04-15 13:15:05

标签: pdf printing actionscript export actionscript-2

当我尝试在运行时打印FLASH SWF(ActionScript 2.0)时,打印区域始终在右下角被切断。如何在运行时打印到pdf并打印舞台上存在的所有内容?

我使用了PrintJob进程,但它似乎不起作用。我已将打印区域设置为1900 x 1400但仍保持修剪。

printbutton.onRelease = function()
  {
    var pj = new PrintJob();
    var success = pj.start();
    if (success)
        {//Centered Variables
        pj.addPage(0,{xMin:0, xMax:1900, yMin:0, yMax:1400});
        pj.send();
        }
        delete pj;
  };

1 个答案:

答案 0 :(得分:0)

检查页面方向。你可以使用下面的例子:

printbutton.onRelease = function(){
 // create PrintJob object
 var pj:PrintJob = new PrintJob();

 // display print dialog box
 if (pj.start()) {
    // boolean to track whether addPage succeeded, change this to a counter
    // if more than one call to addPage is possible
    var pageAdded:Boolean = false;

    // check the user's printer orientation setting
    // and add appropriate print area to print job
    if (pj.orientation == "portrait") {
    pageAdded = pj.addPage(0,{xMin:0, xMax:1400, yMin:0, yMax:1900});
    }
    else {
    // pj.orientation is "landscape"
    pageAdded = pj.addPage(0,{xMin:0, xMax:1900, yMin:0, yMax:1400});
    }

    // send pages from the spooler to the printer
    if (pageAdded) {
    pj.send(); 
    }
 }
 // clean up
 delete pj;
};