print template: how to print a document fragment instead of the document? RRS feed

  • Question

  • HEllo guys.

    According to the docs (and if i didnt' misread them), I can print the current document, a document fragment or a svg document. If I decide to also use a template for my printing, how do I recover the passed in document fragment?


    Luis Abreu

    Saturday, May 19, 2012 1:24 PM

All replies

  • Hi Luis,

    What do you mean by: "how do I recover the passed in document fragment"?


    Jeff Sanders (MSFT)

    Monday, May 21, 2012 12:56 PM
  • Hello Jeff.

    Well, I'm no print wiz, but I've noticed that the platform is using the print behaviours introduced by IE5.5 (which I really don't like, btw). When you set the layout and rects, you can specify the contents that should be printed. If you look at the sample, it's using the special "document" string which makes it print the contents of the current page.

    Now, I've copied the template which comes with the printing sample and I've noticed that it shows nothing when I pass a document fragment (http://ejohn.org/blog/dom-documentfragments/) instead of passing the current document. Btw, if I don't specify the template, then the document fragment does get printed without any problems...

    that this explains the problem better?

    Luis Abreu

    Monday, May 21, 2012 6:14 PM
  • Luis,

    Can you send me a complete repro.  This must be some sort of error on the template.


    Jeff Sanders (MSFT)

    Tuesday, May 22, 2012 7:28 PM
  • sure thing. We'll be sending it to you right now.

    btw, any comments on the other sample I've sent you?

    Luis Abreu

    Tuesday, May 22, 2012 9:50 PM