Solved

HTML Printing

Posted on 2014-01-23
5
212 Views
Last Modified: 2014-01-25
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
Comment
Question by:APD_Toronto
  • 3
5 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39805156
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
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39805173
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
 

Author Comment

by:APD_Toronto
ID: 39805191
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
 
LVL 58

Expert Comment

by:Gary
ID: 39805216
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
 
LVL 58

Expert Comment

by:Gary
ID: 39805224
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now