Select to view content in your preferred language

Scale in printed map (mxd) is different in code to manual printing

573
4
02-17-2011 12:34 AM
SimonEarnshaw
Occasional Contributor
I have tried printing an A3 mxd with the Print Active View code as published by ESRI and have changed only one line of code and that is, to change it to A3 size.

docPaper.FormID = 8;

This forces it to a size of A3 instead of the default 0 Letter size (esriPageFormLetter).

The map prints out fine(ish) but it is not to scale i.e. the map is supposed to be 1:10000, but the space between the graticule grids is 9.7cm, not 10cm as it should be.

If I print the EXACT same mxd out, but via the manual method i.e. in ArcMap itself,  File -> Print.  The scale is correct and it measures 10cm.

Important to note that I have not changed any of the Page and Print Setup settings between the two prints.

Why would it do this?

See pic below to help understand whats going on.

0 Kudos
4 Replies
SimonEarnshaw
Occasional Contributor
I can't believe no one, in the history of using ArcObjects, has ever printed a map in their application.  Are these forums just dead or something?
0 Kudos
NeilClemmons
Honored Contributor
Yeah, the forums ain't what they used to be...

Are you printing from data view or page layout view?  If you don't change the form id, does it print at the correct scale?  What happens if you go into the page properties in ArcMap and select A3, then run your code with the A3 form id value?
0 Kudos
TomSchuller
Frequent Contributor
If you are printing in PageLayout,
could you add a ScaleText.

I have also problems that the ScaleText is always different when printing the same view from ArcObjects code or directorly in ArcMap.
0 Kudos
LeoDonahue
Deactivated User
I export map layouts using a mapserver object.

http://help.arcgis.com/en/sdk/10.0/java_ao_adf/api/arcobjects/com/esri/arcgis/carto/MapServer.html#e...

Some good background info that might also be the case for .NET (I'm assuming you're in .NET).

But then again, my users are seeing the exported map layout in a browser, so there are other print issues at play there.

An unrelated issue I have using export layout is that ordered stiple polygon styles appear in square groups of dots, whereas exporting the map image doesn't have that problem.

The only reason we export layout is to get the custom legend we created in the mxd.
0 Kudos