Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am following a printing tutorial, but it's not working.

The tutorial is here:

Maybe printing in ArcEngine 10 is different. The initial problem is that the PageLayout is null.

//I tried this like in the sample
docPaper.Orientation = m_hookHelper.PageLayout.Page.Orientation;

//Then I tried passing in my own ActiveView obj and casting to PageLayout
 IPageLayout pageLayout = docActiveView as IPageLayout;

But in both cases they are null.

Does anyone have a good link for printing in ArcEngine 10?

share|improve this question
Are you using the pagelayout control? – Kirk Kuykendall Apr 15 '11 at 16:36
@Kirk Kuykendall No, I don't know anything about that. I tried adding esriControlCommands.ControlsPageLayoutToolbar to my toolbar but it was inactive. So I'm not really clear on what it's supposed to do, any links are appreciated. – patrick Apr 15 '11 at 20:42
If you want to print a nice looking map, I'd recommend using the pagelayoutcontrol instead of the mapcontrol.… – Kirk Kuykendall Apr 15 '11 at 20:47

The ActiveView can be either a Map or a Pagelayout if you check the sample you see that they are checking if the ActiveView is a pagelayout or not at several places. The reason for this is to make it would work in both cases. If you customizing the code and are only interested in printing a MapControl, you should look only on the parts of the code where the ActiveView is not a pagelayout.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.