Hi, I'm trying to run this sample to create a PMF file from a C# console application
http://help.arcgis.com/en/sdk/10.0/a...0000077000000/
but I get the following error in this line
IPropertySet settings = publishMaps.GetDefaultPublisherSettings();
Attachment 26394
According to this object model I should be able to do the QI but it's not working
http://resources.arcgis.com/en/help/...bjectModel.pdf
Any help will be welcome
http://help.arcgis.com/en/sdk/10.0/a...0000077000000/
but I get the following error in this line
IPropertySet settings = publishMaps.GetDefaultPublisherSettings();
Attachment 26394
According to this object model I should be able to do the QI but it's not working
http://resources.arcgis.com/en/help/...bjectModel.pdf
Any help will be welcome
Code:
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
AoInitialize aoi = new AoInitialize();
esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeBasic;
//if (aoi.IsProductCodeAvailable(productCode) == esriLicenseStatus.esriLicenseAvailable)
//{
// aoi.Initialize(productCode);
//}
esriLicenseExtensionCode extensionCode = esriLicenseExtensionCode.esriLicenseExtensionCodePublisher;
if (aoi.IsExtensionCodeAvailable(productCode,extensionCode) == esriLicenseStatus.esriLicenseAvailable)
{
aoi.Initialize(productCode);
aoi.CheckInExtension(extensionCode);
}
string folderName = System.IO.Path.GetRandomFileName();
string folderPath = System.IO.Path.Combine("C:\\temp\\Factory\\", folderName);
System.IO.Directory.CreateDirectory(folderPath);
string mxdPath = System.IO.Path.Combine(folderPath, "PublishedMap.mxd");
IMapDocument md = new MapDocument();
md.New(mxdPath);
IMap defaultMap = md.get_Map(0);
#region create PMF
IPMFPublish publishMaps = new PublisherEngineClass();
string pmfPath = System.IO.Path.Combine(folderPath, "PublishedMap.pmf");
ESRI.ArcGIS.esriSystem.IArray orderedMaps = new ESRI.ArcGIS.esriSystem.Array();
IPropertySet settings = publishMaps.GetDefaultPublisherSettings();
//Loop over all the maps in the map document and each one to an Array object
for (int i = 0; i <= md.MapCount - 1; i++)
{
orderedMaps.Add(md.get_Map(i));
}
publishMaps.Publish(md.PageLayout, md.ActiveView, null, true, pmfPath);
aoi.CheckOutExtension(extensionCode);}