<!-- -- SCRIPT--->
<script type="text/javascript">
function printpage() {
//Get the print button and put it into a variable
var printButton = document.getElementById("printpagebutton");
//Set the print button visibility to 'hidden'
printButton.style.visibility = 'hidden';
//Print the page content
window.print()
//Set the print button to 'visible' again
//[Delete this line if you want it to stay hidden after printing]
//printButton.style.visibility = 'visible';
}
</script>
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Cherry
Hi Everyone,
I added a print this page button. I customized the style. It is working, but the Print this Page text still visible under the Print Page Window.
How to get rid of the PDF Text?
Please see attached screenshots.
Thanks a lot.
-Cherry
Below is the styling and script I used.
<style>
button {
background-color: blue;
border: none;
color: white;
padding: 8px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius:4px;
}
</style>
<!-- -- PRINT BUTTON--->
<div style="margin-left: 330px; margin-top: 10px; margin-bottom: 10px;">
<button onclick="window.print()">PDF</button>
</div>
<!-- -- SCRIPT--->
<script type="text/javascript">
function printpage() {
//Get the print button and put it into a variable
var printButton = document.getElementById("printpagebutton");
//Set the print button visibility to 'hidden'
printButton.style.visibility = 'hidden';
//Print the page content
window.print()
//Set the print button to 'visible' again
//[Delete this line if you want it to stay hidden after printing]
//printButton.style.visibility = 'visible';
}
</script>
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.