Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 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.right, exportFrame.bottom);
export.PixelBounds = exportEnvelope;

int hdc = export.StartExporting();
map.ActiveView.Output(hdc, OUTPUT_RES,exportFrame,null,null);
share|improve this question
If i remember correctly the layers may need to be grouped, then each group becomes a layer in the PDF. Or something like that. Also, if you have a raster layer in there, every layer bellow the raster will be rasterized. Transparencies also don't play well with the PDF renderer - might need to turn those off as well. – Jakub Oct 17 '11 at 19:22
Perhaps I should have first asked if you've tried this using the default PDF exporter and whether that yielded the expected result... – Jakub Oct 17 '11 at 19:27
Can you get the results you want interactively using the export command in arcmap? – Kirk Kuykendall Oct 17 '11 at 19:36
Exporting manually from ArcMap produces expected result; pdf with same layer groupings as in map document. – user890 Oct 17 '11 at 23:47

Your Answer


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

Browse other questions tagged or ask your own question.