Print multiple pages


Purpose
This sample shows how to programmatically print multiple pages from a map document—whose map page size is larger than the printer's paper size—using the IPrinterMPage interface. A sample MXD file is included that can be used to test the sample.
 
The IPrinterMPage interface used in this sample is intended for use by those who are customizing or extending the printing pipeline and need fine-grained control over the steps of the output process. In cases where you simply need to print a page layout to tiles or to print data driven pages, use the PrintAndExport class, which internally handles multipage printing. For more information on typical programmatic printing scenarios, see Print active view.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/LayoutElements/PrintMultiPage.mxd.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Start Visual Studio and open the solution file.
  2. Click the Build menu and click Build Solution to compile and register the project.
  3. Start ArcMap and open the sample MXD file. You can also use your own MXD file if it's set up to tile to multiple pages.
  4. Click the Customize menu and click Customize Mode. The Customize dialog box opens.
  5. Click the Commands tab and select the Developer Samples category.
  6. Drag and drop the PrintMultiPage command onto an active toolbar.
  7. Click close on the Customize dialog box.
  8. Click the PrintMultiPage tool to print multiple pages. By default the sample is set at two pages to prevent paper waste.

PrintMultiPagesCS_NET_Addin\PrintMultiPagesCS_NET_Addin\PrintMultiPagesCS_NET_Addin.cs Source code for PrintMultiPages.
Download the C# files
PrintMultiPagesVB_NET_Addin\PrintMultiPagesVB_NET_Addin\PrintMultiPagesVB_NET_Addin.vb Source code for PrintMultiPages.
Download the VB.NET files

Download the files for all languages

See Also:

Sample: Print active view
Output




Development licensing Deployment licensing
ArcInfo ArcInfo
ArcEditor ArcEditor
ArcView ArcView
Engine Developer Kit Engine Runtime