In this topic
- Introducing the PageLayoutControl
- Loading map documents
- Saving map documents
- Managing elements
- Printing tasks
The PageLayoutControl corresponds to the layout view of the ArcMap desktop application and encapsulates the PageLayout ArcObject. Map documents authored with ArcMap can be loaded into the PageLayoutControl, eliminating the need to programmatically compose the cartography.
The map document can be set at design time through the PageLayoutControl property pages (in development environments that support property page capability).
Alternatively, a map document can be loaded into the PageLayoutControl programmatically using the checkMxFile() method to determine whether the document is valid and the loadMxFile() method to load the map document.
The PageLayoutControl can write map documents (*.mxd) as well as read them. The PageLayoutControl implements the IMxdContents interface that enables the MapDocument ArcObject to write the contents of the PageLayoutControl to a new map document. See the following code snippet:
[Java]
IMapDocument mapDocument = new MapDocument();
String ArcGISInstallDir = System.getenv("ARCGISHOME");
mapDocument.esri_new(ArcGISInstallDir + "java/samples/data/mxds/brazil.mxd");
mapDocument.replaceContents((IMxdContents)pageLayoutControl.getObject());
mapDocument.setActiveView(pageLayoutControl.getActiveView());
mapDocument.save(true, true);
The PageLayoutControl provides shortcuts to frequently used methods, such as getGraphicsContainer() and addElement(), and helper methods, such as findElementByName()and locateFrontElement(), to manage individual elements in the PageLayout.
The PageLayoutControl also provides shortcuts to frequently used Page and Printer ArcObjects through helper methods, such as setPrinterByRef(), setPageLayoutByRef(), and printPageLayout(), to assist with printing tasks.
See Also:
Controls library overviewWorking with the page layout
How to get started with the PageLayoutControl property pages
Sample: PageLayoutBean, TOCBean, ToolbarBean
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine Runtime |
ArcView | |
ArcEditor | |
ArcInfo |