SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot Netscape's Avatar
    Join Date
    Apr 2000
    Location
    Toronto, ON, Canada
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Printable pages unsing JavaScript

    Hi there,

    I was wondering if someone knows a resource of tuturial/ready-to-go script/or else to achive the task of making web pages "printer friendly" using JavaScript. All I want to achive is strip down the page from the graphics and open a new (perhaps) screen with only the text from the page.
    This has to be generated on the fly and text extracted from the page.

    Help will be appritiated.

    Regards,

    Netscape

  2. #2
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    print page

    Why don't you just create the text page for the user then use this http://www.a1javascripts.com/essenti...printpage.html
    David Peterson
    ProactiveSale.com
    "You have a web site, now you might as well use it!"

  3. #3
    SitePoint Zealot Netscape's Avatar
    Join Date
    Apr 2000
    Location
    Toronto, ON, Canada
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    Simply, I have about 90 html pages, maintaned by DW template and library system but I was wondering if there is something quick like JavaScript application that I could use to strip up the graphics and open a new window with only a text.

    Regards,

  4. #4
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Netscape
    Hi there,

    Simply, I have about 90 html pages, maintaned by DW template and library system but I was wondering if there is something quick like JavaScript application that I could use to strip up the graphics and open a new window with only a text.

    Regards,
    No! Printing a page is not quick and simple, especially if you want decent formatting. Unless you use a server sided language to rip the content and only place it is in a printable template. With 90 pages you should consider using a server sided language

    If you do. Then simply create a template for the information to be pulled into and print that clean page.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    urm would this be an option or sumthing similar to it

    PHP Code:

    <html>
    <
    head>
    <
    base target="middle">

    <
    script type="text/javascript">

        function 
    getLinkInfo()
        {
        
            var 
    len parent.bFrame.document.links.length;
        
            
    with(parent.mFrame.document)
            {
                
    open();
                
    write("<h3> Sphinxs Links (" len ")</h3><p>");
        
                for(var 
    0leni++)
                {
                    
    write((1) + ". " parent.bFrame.document.links[i].href "<p>");
                }
                
    close()
            }
        }

    </script>

    </head>
    <body bgcolor="black">
      <form>
        <div align="center">
        <a href="javascript:void(0);" onClick="getLinkInfo();">links</a>
          <input type="button" name="Extract" value="Extract Link Information" onclick="getLinkInfo();this.disabled=true">
        </div>
      </form>
    </body>
    </html> 
    but instead of extracting links extract all your text into blocks, using span tags or what ever to isolate them from other content.

    but after reading that you have 90 pages you should consider using a server side language.

    Also I recommend you dont use frames, I dunno about anyone else i cant stand them.

    ps is there something wrong with the javascript:void(0) as it opens a popup for somereason, even if i do take out the (open and close) tags?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •