如何使用print()函数在javascript中打印字节数组 [英] How to Print byte array in javascript using print() function

查看:99
本文介绍了如何使用print()函数在javascript中打印字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

byte[] bytes = rptvw1.LocalReport.Render("pdf", null, out mimeType, out encoding, out extension, out streamIds, out warnings);





这里输出格式为pdf的byte []。

问题是

i想要打印这个字节数组使用javascript print()函数或者其他什么。

请任何人建议任何解决方案。



Here am getting the output format as byte[] for pdf.
The Question is
i want to print this byte array using javascript print() function or whatever.
please can any one suggest any solution for this.

推荐答案

//i haven't tested it but you should try the below one it might  help
funtion print(bytes)
{
   var s = "";
   for(var i=0,l=bytes.length; i<l) 
       s += String.fromCharCode(bytes[i]); 
   return s;
}
//let me know whether its working or not.


Hi Suk @ nta,

感谢您的回复。但我想使用javascript window.print()函数打印此文档而不在我的系统中保存该pdf。
Hi Suk@nta,
Thanks for reply. but i want to print this document using javascript window.print() function without saving that pdf in my system.




我只是询问我的问题。



当我使用window.print打印文档时,我希望使用javascript获取按钮点击事件的字节数据。

我正在使用vb.net。



请帮助我。
Hi ,
I just asking about my problem.

When i print the document using window.print at that time i want to get byte data on click event of a button using javascript .
I am using vb.net.

Please help me.


这篇关于如何使用print()函数在javascript中打印字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆