使用服务器端代码打印多个网页 [英] Printing Multiple web Pages using server side code

查看:83
本文介绍了使用服务器端代码打印多个网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我正在asp.net中开发一个Web应用程序。我的申请表共有32页。与此同时,我有一个母版页。我在母版页中保留了打印按钮。当用户单击打印按钮时,我必须同时打印所有32页。对于这个要求,一个可能的解决方案可能是,我需要有一个页面,其中我必须包括我所有的32个内容页面并使用window.print。我不想做这个过程。我期待着另一种方式继续下去。谁能帮我。



是否可以运行调用32页的后台进程并将其以html格式保存在临时文件夹中。稍后我们可以将这些html文件读成pdf。

Hi
I am developing a web application in asp.net. I have totally 32 pages in my application. Along with this i have one master page. I kept Print button in the master page. When a user click on the Print button, i have to print all 32 pages simultaneousely. For this requirement one possible solution could be, i need to have one page in which i have to include all my 32 content page and using window.print. I don''t want to do this process. I am expecting another way to proceed. Can anyone help me.

Is it possible to run a background process which calls the 32 pages and save it in a html form in the temporary folder. Later we can read these html file into pdf.

推荐答案

您好,



您可以获取HTML使用 WebRequest 的所有32个页面的内容。

这是一个例子:

http://www.csharp-station.com/HowTo/HttpWebFetch.aspx [ ^ ]



请注意,如果您在服务器上调用页面,请求参数与客户端请求中的请求参数不同。因此,您可以将请求设置(浏览器,Cookie)从原始客户端请求复制到您正在从服务器执行的请求,以获取原始客户端请求的页面。





希望这会有所帮助。



最好的关注和快乐的编码,

停止
Hi,

You could fetch the HTML content of all the 32 pages by using a WebRequest.
Here is an example doing this:
http://www.csharp-station.com/HowTo/HttpWebFetch.aspx[^]

Please be aware of the fact that if you call a page on the server, the request parameters are not the same as the request parameters from the client-request. So perhaps you could copy the request settings (Browser, Cookies) from the original client-request to the request you are executing from the server to get the page as it would be requested by the original client.


Hope this helps.

Best regard and happy coding,
Stops


Hello Arima,



我认为在这个帖子中提出任何问题都已经很晚了,但我也坚持了类似要求。我的要求与你的要求完全相同。所以,只是想知道,你还记得你最终选择的方法。



它是单页还是你可以想出更好的逻辑。请帮我解决这个问题。



谢谢,

Sushil
Hello Arima,

I think it is really late to ask anything in this thread, but am also stuck with a similar requirement. My requirement is exactly same as yours. So, just wanted to know, do you remember which was the approach you finally picked up.

Was it make it as single page or you could come up with some better logic to do. Please do help me with this issue.

Thank You,
Sushil


这篇关于使用服务器端代码打印多个网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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