简体   繁体   中英

HTML page to Print - How to manipulate the printer settings prior to printing automatically

My client wants their client to be able to print the results of an html page in a printer friendly format so using media queries and css we created a print stylesheet. When we look at the page in print preview, the printer sets the document up to be at 100%.

Unforunately at 100% printer size the document resizes everything to stretc acrossed and the page breaks but at 50% printer size everything is in tact, also automatically the printer setting are set up to not have it checked to allow images and background images. How can I force it to make it so that when a person clicks print in this specific html page that it forces the page to render at 50% so that it shows everything and that it forces it to show images and background images. So that the page at the end prints the way we want it to print.

I suggest using exact page size you want.

@media print 
{
   @page
   {
    size: 5.5in 8.5in;
    size: landscape;
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM