package require printer
package require gdi

puts "Printer version: [printer version]"
puts "Gdi version: [gdi version]"
set hdc [printer dialog select]

if { [lindex $hdc 1] == 0 } {
  # Print canceled
  return
}
set hdc [lindex $hdc 0]

printer job start -name gdi

printer page start

# GDI STUFF HERE
# Page is about 2000 by 3000

set text1 "European users have unusual characters like åäöÅÄÖ"

# text
gdi text $hdc 700 200 -text $text1 -font {Arial 10 bold} -anchor w
gdi text $hdc 700 600 -text $text1 -width 250 -font { {Times New Roman} 12 bold} -anchor w
gdi text $hdc 700 1000 -text $text1 -width 200 -font {Arial 12} -anchor c -justify center
gdi text $hdc 700 1400 -text $text1 -font { {Times New Roman} 10 } -anchor c
# END GDI STUFF

printer page end

printer job end

printer close

if { $tcl_interactive == 0 } {
  exit
}
