0

I need to parse XML data and fill HTML(XML) or precompiled JS template for printing and then send it to print, all this work should be done on client side.

  1. Is it possible and is some libs for this purpose available for JS?
  2. Is it possible to rotate some pages for print. For example: first page in A4-vertical, second A4-horizontal.
  3. What approach should I use if I start develop own lib? I'm primary work with Java, so I don't know how to build structure on JS, is it possible to write classes in different files and then compile in one JS (I know that in JS classes not available, but we can emulate something similar...)

PS: should work with ie6 ;(

Thanks

Sonique
  • 6,670
  • 6
  • 41
  • 60

1 Answers1

1

[Assuming your talking about client-side js in the browser:] To rotate the page for printing use CSS. there are two ways to do it:

  1. specifying @media print{@page {size: landscape}}
  2. rotating content using transform:rotate(-90deg);.

See this Stackoverflow answer for details.

There are a lot of special CSS commands for printing. Smashing magazine has an introduction.

Community
  • 1
  • 1
R D
  • 687
  • 8
  • 14