如何使用 AlivePdf 创建我的 Web 应用程序的 PDF
我有一个带有 VerticalScrollBar 的大型 Web 应用程序,其中有一些图表和大型数据网格。我计划使用 AlivePdf 创建我的网络应用程序的 pdf。
现在,我使用下面的代码创建我的应用程序的 pdf,但没有运气。
var printView:DisplayObject = new InteractionsAnalysis() as DisplayObject;
printView.width = Application.application.width;
printView.height = Application.application.height;
var printPDF:PDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.A4);
printPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
printPDF.addPage();
printPDF.addImage(printView,0,0,0,0,"PNG",100,1,ResizeMode.FIT_TO_PAGE);
var f:FileReference = new FileReference();
var b:ByteArray = printPDF.save(Method.LOCAL);
f.save(b);
有人能给我一些指示吗?
I have a large web application with verticalScrollBar with few charts and large datagrid. I am planning to create pdf of my web application using AlivePdf.
Right now, Im using below code to creat a pdf of my application, but no luck.
var printView:DisplayObject = new InteractionsAnalysis() as DisplayObject;
printView.width = Application.application.width;
printView.height = Application.application.height;
var printPDF:PDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.A4);
printPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
printPDF.addPage();
printPDF.addImage(printView,0,0,0,0,"PNG",100,1,ResizeMode.FIT_TO_PAGE);
var f:FileReference = new FileReference();
var b:ByteArray = printPDF.save(Method.LOCAL);
f.save(b);
Can anybody give me some directions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
验证调用 f.save() 的方法是否是由用户事件触发的。根据 FileReference 文档:
Verify that the method which is calling f.save() was triggered due from a user event. According to the FileReference doc: