U can use BeginPrint and in that GetDeviceCaps .. U can set page layout in that