I have a small function that exports a map document to a pdf. The function works in the fact that it does export a pdf. However, regardless of what I set pdfExport.ExportPDFLayersAndFeatureAttributes to, all of the layers are grouped into a single layer 'Image' in the output pdf. In the code snippet below, I would expect the map layers to be toggle-able layers in the output pdf. What am I doing wrong?
BTW - this is at ArcGIS 9.3.1
int OUTPUT_RES = 300;
IExport export = null;
IExportPDF2 pdfExport = new ExportPDFClass();
pdfExport.ExportPDFLayersAndFeatureAttributes = esriExportPDFLayerOptions.esriExportPDFLayerOptionsLayersAndFeatureAttributes;
export = (IExport)pdfExport;
export.Resolution = OUTPUT_RES;
export.ExportFileName = outputFile;
tagRECT exportFrame = map.ActiveView.ExportFrame;
IEnvelope exportEnvelope = new EnvelopeClass();
exportEnvelope.PutCoords(exportFrame.left, exportFrame.top, exportFrame.right, exportFrame.bottom);
export.PixelBounds = exportEnvelope;
int hdc = export.StartExporting();
map.ActiveView.Output(hdc, OUTPUT_RES,exportFrame,null,null);
export.FinishExporting();
export.Cleanup();