• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

HTML Printing

Hello Experts,

I am now printing a document using the following code, but is there any way I can remove the header and footer that usually are printed like time, date and URL. I know that this is a browser settings, but can I do it by code?

<BODY onload="window.print(); window.close();">

Open in new window

0
APD_Toronto
Asked:
APD_Toronto
  • 3
1 Solution
 
Rainer JeschorCommented:
Hi,
as far as I know - No - this is not possible.
That what be a huge security risk/impact if you could change browser settings through Javascript.

HTH
Rainer
0
 
GaryCommented:
To confirm there is no cross browser method of doing this.
Your best option is to create a pdf of the page and then you won't have this.
0
 
APD_TorontoAuthor Commented:
I thought so.

I have abc pdf, which I have not used in years, was 800 pixels a good width when converting to pdf, or am I imagining this number?
0
 
GaryCommented:
I don't know ABC PDF but if it has a simple HTML to PDF option with an option to fit to A4 then just use that. Or just do a convert and let the user scale the print if needed.
Screen and print are different beasts when printing,
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now