如何在网页上点击按钮将屏幕保存为pdf(Asp.net MVC2) [英] How to save the screen as pdf on the click of button in web page (Asp.net MVC2)

查看:94
本文介绍了如何在网页上点击按钮将屏幕保存为pdf(Asp.net MVC2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网页上有几个按钮。



1.首先我需要做的是,点击保存按钮,客户端屏幕需要保存为pdf并且必须提供自动下载选项到客户端,以便客户端可以保存pdf文件。



2.接下来,点击邮件按钮客户端应该能够邮寄该pdf文件。邮件可以按照下面提到的任何方式完成,

a。使用pdf附件自动打开Outlook。

b。接受用户的收件人并使用pdf附件直接向他们发送邮件。





任何有任何想法与此有关, 请帮忙。这对我来说非常有用。

Aleast任何你的输入,如何实现这一点。





当前情况,



我有三个按钮



I have a web page with few buttons.

1. First thing i need to do is, on the click of the save button, clients screen need to saved as pdf and a auto download option has to be given to client, so that client can save the pdf file.

2. Next, on click of mail button client should be able to mail that pdf file. The mailing can be done in any way as mentioned below,
a. Automatically open the outlook with the pdf attachment.
b. Accept the recipients from the user and send mail directly to all of them with the pdf attachment.


Anyone having any idea related to this, Please help. It will be very useful for me.
Aleast any your inputs, how this can be achieved.


Current scenario,

I am having three buttons

<span>
           <input type="button" id="btnSave" value="Save" style="width: 75px; height: 21px" />
       </span>
       <span>
           <input type="button" id="btnPrint" value="Print" style="width: 75px; height: 21px"/>
       </span>
       <span>
           <input type="button" id="btnMail" value="Mail" style="width: 75px; height: 21px" />
       </span>







并为他们创建点击事件,如下所示,






and created click event for them as below,

$("#btnPrint").click(function (e) {
    window.print();
});

$("#btnSave").click(function (e) {
    alert("btnSave clicked");

    $.ajax({
        url: 'Index/SavePage',
        success: function (result) {

        }
    });
});


$("#btnMail").click(function () {
    alert("btnMail click");

    $.ajax({
        url: 'Index/MailPage',
        success: function (result) {
            $("#divFileUpload").html(result);
        }
    });
});









提前致谢。





Thanks in advance.

推荐答案

#btnPrint ).click(function(e){
window.print();
});
("#btnPrint").click(function (e) { window.print(); });


#btnSave)。点击(function(e){
alert( btnSave点击);
("#btnSave").click(function (e) { alert("btnSave clicked");


.ajax({
url: ' Index / SavePage'
成功:函数(结果){

}
}) ;
});
.ajax({ url: 'Index/SavePage', success: function (result) { } }); });


这篇关于如何在网页上点击按钮将屏幕保存为pdf(Asp.net MVC2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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