//Export multiple map series pages to PDF
//Create a PDF export format
PDFFormat msPDF = new PDFFormat()
{
Resolution = 300,
OutputFileName = filePath,
DoCompressVectorGraphics = true
};
//Set up the export options for the map series
MapSeriesExportOptions MSExport_custom = new MapSeriesExportOptions()
{
ExportPages = ExportPages.Custom,
CustomPages = "1-3, 5",
ExportFileOptions = ExportFileOptions.ExportAsSinglePDF,
ShowSelectedSymbology = false
};
//Check to see if the path is valid and export
if (msPDF.ValidateOutputFilePath())
{
layout.Export(msPDF, MSExport_custom); //Export the PDF to a single, multiple page PDF.
}