48 users online (1 members and 47 guests)  

Thread: Page Printing


  Results 1 to 4 of 4

Related

  1. Css Printing Problem    Forum: CSS Forum
    Replies: 2
  2. Printing    Forum: HTML Forum
    Replies: 0
  3. Non-printing of images...help me, please.    Forum: Website Scripts Forum
    Replies: 5
  4. Printing with CSS    Forum: CSS Forum
    Replies: 3
  5. printing    Forum: CSS Forum
    Replies: 5
  1. #1
    Glenvern's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Norfolk, UK.
    Posts
    112

    Page Printing

    How do I print a page with a button the page is not needed to be seen on screen.

    example - my name and address for those who want it

    I have tried -
    window.print("pagetobeprinted.htm")

    but it didn't work, it printed the current page..
    Glenvern

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Page Printing

    what i would do is make 2 pages...

    the first one has the content that you want...

    the second one is for a frame in your first page...

    use some javascript that will open a popup with the info you want then print it! then close it when it is done!

    try this example:
    HTML Code:
    <!--PAGE 1-->
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <script>function pgPrint(){
    printwindow = window.open('page2.html', 'win', 'height=1,width=1,left=20,top=20,resizable=no,scrollbars=no,toolbar=no,status=no');
    this.focus();
    printwindow.close();
    }</script>
    </head>
    
    <body>
    <input type="button" onclick="javascript:pgPrint();" name="printbutton" value="print stuff">
    </body>
    
    </html>
    HTML Code:
    <!--PAGE 2-->
    <html>
    <body onload="this.print();">
    put your address or whatever here!
    </body>
    </html>

  3. #3
    Glenvern's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Norfolk, UK.
    Posts
    112

    Re: Page Printing

    Thanx for the reply -

    I have copied and pasted your suggestion into both pages -

    excellent - it works just fine...

    many thanx..
    Glenvern

  4. #4
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Page Printing

    no problem!



Tags for this Thread