I need to export a map for several extents (typically states or regions of a country) to PDF. I have a MXD document that I open in an ArcObject console program.
I manage to set the PageLayout to A2 form and change the orientation of the page depending on my extent.
Nevertheless, I would like to set the data frame to fill my PageLayout with a given margin (1cm for example) between the PageLayout and the data frame, and then change the map extent to my region extent. How can I do that please ?
My actual code is
IPageLayout pageLayout = (IPageLayout)activeView;
IPage page = pageLayout.getPage();
if(regionExtent.getHeight() > regionExtent.getWidth()) {
log.info("Orientation : Portrait");
page.setOrientation((short) 1);
} else {
log.info("Orientation : Paysage");
page.setOrientation((short) 2);
}
log.info("Format : A2");
page.setFormID(esriPageFormID.esriPageFormA2);
page.setUnits(esriUnits.esriCentimeters);
page.setStretchGraphicsWithPage(true);
pageLayout.zoomToWhole();
pageLayout.setAlignToMargins(true);
IMap map = activeView.getFocusMap();
// here I have to get the map fill the pageLayout