China Open source community
站内导航:

 
 
 
当前位置: 首页 >> 应用软件 >> 网络相关 >> 未公开的Openlaszlo应用打印功能
 

未公开的Openlaszlo应用打印功能

作者:      来源:blog.csdn.net/lwz7512     发表时间:2006-06-01     浏览次数:      字号:    

自从一年前使用openlaslzo以来,就知道它有个缺陷,就是不能打印界面上东西,现在终于在今天的邮件列表中看到了解决方案,是调用flash的打印函数进行打印的,这下终于有办法了,下面的样例文件:

--------------------------------------------------------------------
laszlo print sample code From: "Clint Dickson" <clintjd@hotmail.com>
--------------------------------------------------------------------
<canvas width="400" height="400">

    <view y="50" x="50" id="myview">
  <view width="50" height="50" bgcolor="blue"/>
  <view width="50" height="50" bgcolor="red"/>
  <simplelayout axis="x"/>
    </view>

    <button x="50" y="150">Print It
         <method event="onclick">
                  // create new PrintJob object, and the print dialog to
appear
                  var printJob = new PrintJob();

                  // this will wait for an OK from the dialog to print
                  if (printJob.start()) {

                       // get your view as a flash movie
                       var viewAsMovie = myview.__LZmovieClipRef;

                       //create a print area object, which will be relative
to myview (just showing the blue
                       // and red views)
                       var printArea = {xMin:0, xMax:100, yMin:0, yMax:50}

                       // add a page to the print job with the movie
                       printJob.addPage(eval(viewAsMovie), printArea);

                      // send it to the printer
                      printJob.send()

                  }
                  delete printJob;

         </method>
    </button>
</canvas>

非常高兴,openlaszlo越来越让人满意了,继续支持!

编辑 webmaster

 
 
 
评论
 
 
发表
 
姓名: QQ:
性别: MSN:
E-mail: 主页:
评分: 1 2 3 4 5
评论内容:
验证码:
  
  • 请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
  • 严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。
  • 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表网友个人观点,与本网站立场无关。
  •  
    中国源码网 - WWW.YUANMA.ORG - 中国开放源代码社区