Question: I am using Datagrid in WPF. This is a very simple and basic implementation. I not using any styles.
I created a simple datagrid :

```
<dg:DataGrid x:Name="dg" >
            </dg:DataGrid>

```

and populated it with data as:

```
 dg.ItemsSource = " H E L L O W O R L D!".Split();

```

Grid gets properly populated but the columnheader of the grid is drawn with some offset. Due to this my data and header are mis aligned. I tried searching for this over net but I haven't found anything. This seems to be a straightforward implementation which is working for everyone except me :(.
Can anyone please tell me what might be going wrong? I have tried using different data sets and appyling some style to test this.

Thanks in advance.

Answer: 
There's an underdocumented [`printto`](http://msdn.microsoft.com/en-us/library/aa969321.aspx#class) verb which takes the **printer name** as a parameter *(enclosed in quotes if it contains spaces)*.

```
import tempfile
import win32api
import win32print

filename = tempfile.mktemp (".txt")
open (filename, "w").write ("This is a test")
win32api.ShellExecute (
  0,
  "printto",
  filename,
  '"%s"' % win32print.GetDefaultPrinter (),
  ".",
  0
)

```

*snippet from [Ja8zyjits](https://stackoverflow.com/users/4693568/ja8zyjits)'s [link](http://timgolden.me.uk/python/win32_how_do_i/print.html#shellexecute)*
Looks like bluish left a comment about this but did not leave an answer.

Install Ghostprint <http://pages.cs.wisc.edu/~ghost/gsview/gsprint.htm>

Then use the command in the question 

> 
> [Print PDF document with python's win32print module?](https://stackoverflow.com/questions/1462842/print-pdf-document-with-pythons-win32print-module)
> 
> 
>