Solved

Print a message after every page-break when printing aspx page

Posted on 2013-11-19
1
494 Views
Last Modified: 2013-11-22
Hello,

When using IE, I can print my web page doing right click on page and selecting Print.

How could I print a message or image after every page-break when printing my aspx page directly to printer?

I know I can produce a page-break after each H2 on the page doing this:

<HEAD>
       <STYLE TYPE="text/css">
           H2 {page-break-before: always}
      </STYLE>
</HEAD>

But how can I print a message or jpg image after a page-break was done?
0
Comment
Question by:miyahira
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39659437
you'd have to use javascript for this:

<script language="javascript" type="text/javascript">
    function CallPrint(strid) {
        var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'letf=0,top=0,width=800,height=100,toolbar=0,scrollbars=0,status=0,dir=ltr');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();
        prtContent.innerHTML = strOldOne;
    }
</script>

Open in new window


this code will put the section in a popup and allow you to print from there.

of course, you also create a print style sheet in CSS, hide the elements you don't want to print, and have a class (for example, named print) applied to all of the controls on your page. Therefore it would just be the need for one button.

see http://code.msdn.microsoft.com/Print-a-specific-part-of-7189b52b for more details
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

617 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