We are building an standalone ArcGIS Engine application and we are going to add support for printing.
There are several APIs for printing a PageLayout in ArcObjects, in ArcGIS 10 there are at least three different ways to do this:
- The new PrintAndExport class, in
the documentation they seem to
promote this API Conceptual help –
Printing maps. - It's also possible to print a
layout using the PrintPageLayout method PageLayoutControl Sample: Printing with the PageLayoutControl - But also Output method on IActiveView can be used.
Can someone give recommendations on which API we should choose? Is there any known pitfalls in these APIs?
Update:
Found one pitfall during my research:
- When working with ArcGIS Server layers, only PrintAndExport draw the patches/swatches on the legend when printing the layout.
Best Answer
PrintAndExport is the recommended approach at ArcGIS 10. This class was not just added for data driven pages support. It was added as a wrapper method to simplify print and export for developers. In addition to wrapping many COM calls, it also handles many of the GDI/Win32 calls that are needed for correct printing and exporting.