JavaScript print preview

后端 未结 10 1443
梦毁少年i
梦毁少年i 2020-12-28 19:46

How can I see print preview of my invoice generated from website. If I print with the script

print this page         


        
10条回答
  •  旧时难觅i
    2020-12-28 20:31

    You can create separate print stylesheets to have some general control over how a site will look in print. You can display the site to your user using this special print stylesheet before printing. That does not give you a 100% preview though, as every browser handles things a bit differently. You won't see how it prints until it actually prints. Using a print stylesheet will get you pretty close though.

    Some operating systems and printer drivers offer a preview to the user between hitting the Print button and the actual print, but that's not something you have control over or that's guaranteed to always be available.

提交回复
热议问题