How To: Print Using the GDI Print API

This topic presents a sample program that illustrates how to print from a native Windows program using the GDI Print API.


Printing is usually an integral part of a native Windows program, so it is not a feature that you can add easily after you have written the program. When designing a program for Windows 7, you should consider using the XPS Print API to provide the printing functionality because it provides the most compatibility for the future. Programs that must run on Windows Vista and earlier versions of Windows will most likely use the GDI Print API to provide printing functionality. The GDI Print API is also supported in Windows 7, but it is more limited than the XPS Print API.

Printing tasks

The GDI Print Sample Program illustrates how you can print from a Windows program using the GDI Print API. It is based on the Print Sample Program that uses the XPS Print API, which is described in detail in How to print from a Windows application.

Related topics

Print Sample Program
GDI Print Sample Program Source Code Download
Using Printing
How to print from a Windows application



Community Additions

© 2015 Microsoft