English 中文(简体)
印有 Java印的多页
原标题:Printing multiple pages with Javascript
  • 时间:2012-01-11 17:13:28
  •  标签:
  • javascript

I have a website where users click a read more button so that they can view the rest of the information on the page. I am curious how I could make it so that users do not have to print each page seperately. I would like to be able to make it so that I could have a script that print s related pages. I f anyone could help me out and point me in the right direction it would be greatly appreciated. I need this functionality to work in all browsers.

增 编

最佳回答

你们需要从中删除的是利用媒体风格的风格。 基本好像有两种血管;一种是印刷,另一种是观察。 为了成为带宽的保守假期,在提出请求之前,将“印章><>>代码”空出。 根据请求活动,填写在<代码>印本<><>>,请填写全文。 我建议你研究酒吧及其负荷,并提出这方面的要求。

@media screen
    {
    #screenarea
        {
        display: block;
        }
    #printarea
        {
        display: none;
        }
    }
@media print
    {
    #screenarea
        {
        display: none;
        }
    #printarea
        {
        display: block;
        }
    }
问题回答

在你在单一网页(使用注射或服务器程序)上拥有所有内容之后,格式页使用CSS的特性进行“媒体印刷”,例如:

@media print {
    h1 {page-break-before: always;}
}

Other attributes are "page-break-after" and "page-break-inside", the latter of which helps avoid breaks inside content.

我的格乌特感首先告诉我,这将需要一个基于服务器的解决办法,因为window.print/code>只能够打印本文件中的内容,而且你应当书写服务器代码,制作一个网页,由你想要印刷的所有网页组成,并援引window.

但是,你可以为你做j Qury工作,在装上所有页次后,可使用“www.c.w.t. /cp.htm”的页页数,然后在装上“http://c.t.w.htm”。 如果你能够出于某种原因使用 j,你可以使用XH,写整个pl。

It is difficult to provide a more detailed answer without having any information about the structure of your web app.

I think that you can print it on an iframe inside a layer

tihs就是一例(不是很 n,而是为这一想法工作):

如果你出于某种原因在表格中总结内容的话,它就发挥了作用。 最近,我在更新的图表中做了一个现有特征,必须研究如何在旧的图表中做到这一点。 Uglier设计,但browser印刷方方言中有一页以上。

找不到任何文件,以便可能与其他要素一起使用,但四舍五入的印刷区总是被压缩为一份文件。

Ended up doing a table based layout with a simple but cleaner design. Was pretty happy with the results actually.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签