# Get a list of printers (local, not network) set names [blt::printer names] # Open the first one set pid [blt::printer open [lindex $names 0]] # Print the graph .graph print1 $pid # Close the printer. blt::printer close $pid2) Use the (undocumented) "printer" command and the "print2" operation in the graph. This prints the graph to the printer device context. This works with many printers, but has problems with PostScript printer (but then you should be printing PostScript instead).
# Get a list of printers (local, not network) set names [blt::printer names] # Open the first one set pid [blt::printer open [lindex $names 0]] # Print the graph .graph print2 $pid # Close the printer. blt::printer close $pidThe [blt::printer names] function only returns local printers. But if you have a list of valid network printer names, the [blt::printer open] function appears to accept them. Michael Schwart's printing extension (see TkPrint) seems to get a valid list of network printers.3) Use the "snap" operation to generate an enhanced windows metafile. You can then include the file into a Windows document (such as as a PowerPoint slide) and print that document. You can also send the metafile to the clipboard and paste it in. (Note that the "snap" operation works on both Windows and Unix, but you can only snap photos on Unix.)
# Print the graph .graph snap -format emf file.emf # Copy the graph to the clipboard for pasting .graph snap -format emf CLIPBOARD4) Convert PostScript of the graph into PDF and print. You can generate a PostScript file of the graph and then run the file through a distiller to generate PDF. You can use either Adobe Acrobat or the Ghostscript distiller. See BLT - graph - printing postscript for an example.
Network PrintersNote that the [blt::printer names] function only returns locally connected printers. But if you just call the [blt::printer print1] or [blt::printer print2] function without a printer id, then the standard Windows printer dialog pops up, and the user can just select the printer they want.