打印备用页面 [英] To print an alternate page

查看:175
本文介绍了打印备用页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个非常长的html页面,上面有很多照片。

因此,打印此页面的最佳方法是将某些页面打印为PDF格式。

因此我制作了一个像我的页面一样的PDF文件,以便打印得最好。

我想要当用户按下浏览器中的打印按钮时,它

自动打印pdf文件,而不是html页面。

要做到这一点,我在页面顶部插入:

< link media =" ;打印"的rel ="备用" href =" printthepage.pdf">

但它不起作用,浏览器打印html页面。

我该怎么办?

钢铁

解决方案

Steel写道:


我有一个很长的html页面,里面有很多照片。
因此,打印此页面的最佳方法是将某些页面打印为PDF格式。
因此我制作了一个像我的页面一样的PDF文件,以便打印出来。
我想要当用户按下浏览器中的打印按钮时,它会自动打印pdf文件而不是html页面。
要做到这一点,我会在页面顶部插入:
< link media =" print"的rel ="备用" href =" printthepage.pdf">
但它不起作用,浏览器打印html页面。
我该怎么办?
Steel




我认为媒体属性只有在你的LINK标签指向一个

CSS样式表时才有意义。


这里有一些东西你可以这样做:


1.添加一个可点击的链接:

< A href =" printthepage.pdf">点击此处查看这个页面的PDF文件< / A>

2.为打印媒体创建一个CSS样式表,这样你就能正确打印页面

无论如何。 (有些浏览器比其他浏览器更好地支持这些。)


3.考虑将非常长的HTML页面分成一系列较小页面的




Phil

-

Philip Ronan
ph *********** @ virgin.net

(如果通过电子邮件回复,请删除z)


Philip Ronan< ph *********** @ virgin.net>:

Steel写道:

因此我制作了一个像我的页面一样的PDF文件,以便打印得最好。
我想要当用户按下浏览器中的打印按钮时,它打印出来
打印自动pdf文件,而不是html页面。
< link media =" print"的rel ="备用" href =" printthepage.pdf">
我认为只有当您的LINK标记指向CSS样式表时,媒体属性才有意义。




不,这种方法绝对正确,但是浏览器的支持有点不受限制,很好地说。

< A href =" printthepage.pdf">点击这里是该页面的PDF文件< / A>


点击此处链接很糟糕 - 如果你使用鼠标,你还会用链接做什么呢? ''Rel''也是''a''的有效属性,但''media''是
不是。

2.创建一个CSS样式表打印媒体


嘿,你没有谈论主题!! 11

3.考虑将你的长篇HTML页面分成一系列
较小的页面。




这会让打印变得更难!


-

为和平而战就像他妈的童贞。




" Christoph Paeper" < CH ************** @ nurfuerspam.de>在消息中写道

news:opsgx6cprvb8p244 @ crissov ...

Philip Ronan< ph *********** @ virgin.net>:< blockquote class =post_quotes> Steel写道:

因此我制作了一个像我的页面一样的PDF文件,以便打印得最好。
我想要当用户按下时在浏览器中打印按钮,
它会自动打印pdf文件,而不是html页面。
< link media =" print"的rel ="备用" href =" printthepage.pdf">



我认为只有当您的LINK标记指向CSS样式表时,媒体属性才有意义。



不,这种方法绝对正确,但浏览器支持有点受限,很好地说。

< A href =" printthepage.pdf" ;>点击此处查看此页面的PDF文件< / A>



点击此处链接是坏的---如果你使用鼠标,你还会用链接做什么?




一位老乡开了鱼市场,正在竖起一个标语,上面写着Fresh Fish

Sold Here。一个路人停下来说:嗯,当然你的鱼在这里卖*

。没有人会认为你会放弃它。


鱼贩说,你是对的,然后取下标志。第二天,

,而他正在点着Fresh Fish Here的标语,一个路人停下来,

说,嗯,当然你'在这里卖鱼*。这就是你的
商店所在的地方!


鱼贩说,你是对的,然后取下标志。第二天,

,而他正在张贴Fresh Fish的标语,一个路人停下来,

说,嗯,我希望你的鱼是新鲜的*。如果你指出这么说,你只会让人怀疑它真的不是。


鱼贩说,你是对的,并取下标志。第二天,

,而他正在竖起一个标语Fish,一个路人停下来说,

嗯,每个人都已经知道你了 '卖*鱼*。你可以闻到这一切

沿着街区向下走!


鱼贩说,你是对的,并取消了标志。永远不要把另外一个放在另一个上面。


Hi at all,
I have a very long html page with many photo.
Therefore the best to print this page is to print the some page as PDF.
Therefore I maked a PDF file like my page to print best.
I''ld want that when the user press the print button in the browser , it
print automatically the pdf file and not the html page.
To do that I insert at the top of my page:
<link media="print" rel="alternate" href="printthepage.pdf">
But it do not work and the browser print the html page.
How can I do please?
Steel

解决方案

Steel wrote:

Hi at all,
I have a very long html page with many photo.
Therefore the best to print this page is to print the some page as PDF.
Therefore I maked a PDF file like my page to print best.
I''ld want that when the user press the print button in the browser , it
print automatically the pdf file and not the html page.
To do that I insert at the top of my page:
<link media="print" rel="alternate" href="printthepage.pdf">
But it do not work and the browser print the html page.
How can I do please?
Steel



I think the media attribute is only meaningful if your LINK tag points to a
CSS stylesheet.

Here are some things you could do instead:

1. Add a clickable link like this:
<A href="printthepage.pdf">Click here for a PDF file of this page</A>

2. Create a CSS stylesheet for print media so you page prints correctly
anyway. (Some browsers support these better than others.)

3. Consider breaking your very long HTML page into a sequence of
smaller pages.

Phil
--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)


Philip Ronan <ph***********@virgin.net>:

Steel wrote:

Therefore I maked a PDF file like my page to print best.
I''ld want that when the user press the print button in the browser , it
print automatically the pdf file and not the html page.
<link media="print" rel="alternate" href="printthepage.pdf">
I think the media attribute is only meaningful if your LINK tag points
to a CSS stylesheet.



No, the approach was absolutely correct, but browser support is somewhat
limited, nicely said.
<A href="printthepage.pdf">Click here for a PDF file of this page</A>
"Click here" links are bad---what else would you do with a link, if you
are using a mouse? ''Rel'' is a valid attribute of ''a'', too, but ''media'' is
not.
2. Create a CSS stylesheet for print media
Hey, don''t you get on topic!!11
3. Consider breaking your very long HTML page into a sequence of
smaller pages.



That would make printing actually harder!

--
Fighting for peace is like fucking for virginity.



"Christoph Paeper" <ch**************@nurfuerspam.de> wrote in message
news:opsgx6cprvb8p244@crissov...

Philip Ronan <ph***********@virgin.net>:

Steel wrote:

Therefore I maked a PDF file like my page to print best.
I''ld want that when the user press the print button in the browser , it print automatically the pdf file and not the html page.
<link media="print" rel="alternate" href="printthepage.pdf">



I think the media attribute is only meaningful if your LINK tag points
to a CSS stylesheet.



No, the approach was absolutely correct, but browser support is somewhat
limited, nicely said.

<A href="printthepage.pdf">Click here for a PDF file of this page</A>



"Click here" links are bad---what else would you do with a link, if you
are using a mouse?



A fellow opens a fish market, and is putting up a sign reading "Fresh Fish
Sold Here". A passerby stops and says, "Well, of course your fish is *sold*
here. No one is going to think you''re giving it away."

The fishmonger says, "You''re right", and takes down the sign. The next day,
while he''s putting up a sign reading "Fresh Fish Here", a passerby stops and
says, "Well, of course you''re selling the fish *here*. This is where your
store is!"

The fishmonger says, "You''re right", and takes down the sign. The next day,
while he''s putting up a sign reading "Fresh Fish", a passerby stops and
says, "Well, I would hope your fish is *fresh*. If you make a point of
saying so, you''ll only make people suspicious that it really isn''t."

The fishmonger says, "You''re right", and takes down the sign. The next day,
while he''s putting up a sign reading "Fish", a passerby stops and says,
"Well, everyone already knows you''re selling *fish*. You can smell it all
the way down the block!"

The fishmonger says, "You''re right", and takes down the sign. And never puts
up another.


这篇关于打印备用页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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