• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

IE print templates

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    IE print templates

    Anyone ever used the MS IE print templates and has a simple sample of how to call print preview? Looked at stuff on MS and it seems like pages of incomprehensible earwig.

    Basically I just want to print an HTML page without all that default header and footer stuff and also scale it so it fits on the printed page.

    Much ta for any ideas.

    #2
    this is very simple

    with javascript and appropriate styles - let me know if you need more.

    Comment


      #3
      Re: this is very simple

      Ta SP. Just changing styles seems like a much easier option for the scaling, no probs with that. However, no way to get rid of/modify headers and footers from jscript is there?

      These templates I mentioned seem like a non starter as am using webbrowser in VB and it seems, according to MS, that there is no mechanism for using from a VB app.

      One really would have thought these days that there was a decent formal webbrowser method for formatting and scaling printout from a bog standard HTML page. Even the page setup in IE is total rubbish.

      Comment


        #4
        if you

        are automating internet exploer (?) then it should be straightforward.

        Comment


          #5
          ...

          you get rid of headers and footers by using style as well.....

          Comment


            #6
            ...

            style =
            nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
            @media print {
            .hidden { display: none }
            nnnnnnnnnnnnnnnnnnnnnnnnnnnnn


            javascript
            nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
            function screenPrint()
            {
            document.body.style.zoom = '80%';
            window.print();
            document.body.style.zoom = '100%';
            }
            nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn


            then use "span class='hidden'" etc

            Comment


              #7
              Re: ...

              Sorry SP not quite with you on 1st bit. I assume that's shorthand not actual syntax ie you mean summit like:

              £STYLE type="text/css" media="print"£
              span {visibility:hidden}
              £/STYLE£
              and stick hidden bits in a span?

              How does that remove headers/footers? Maybe we are at cross purposes here, I mean the title, page 1 of 1 etc that IE sticks on when it prints, not anything actually on the HTML page.

              Comment


                #8
                using

                the javascript prints out the doc without any header stuff you mention. using the style, assigned to any bits you want not printed, such as

                table style=hidden
                td style=hidden
                span style=hidden

                will cause those elements not to be printed out.

                so, just give your user a button to click that runs the javascript function.

                Comment


                  #9
                  Re: using

                  Ta for your time SP, but no can't get that to work, it prints headers and footers. As I say, the header/footer are added on by the IE dll, they are not anything in the original html so hiding anything in it is not going to make a difference.

                  Comment


                    #10
                    but

                    the javascript only prints out the screen - like a screen dump. i use it myself quite a lot...

                    Comment

                    Working...
                    X