Something similar I have done in the past is use IMapDocument. It does require a hard file, so I just create a temp file for the process, and delete after the export. In the code snippet below, the MapExportFormat is a little enumerator I created representing different output formats (pdf,gif,png).
private static void ExportMap(IMapDocument map,MapExportFormat exportFormat, string outputFile)
{
int OUTPUT_RES = 600;
IExport export = null;
switch (exportFormat)
{
case MapExportFormat.PDF:
IExportPDF pdfExport = new ExportPDFClass();
pdfExport.ImageCompression = esriExportImageCompression.esriExportImageCompressionDeflate;
pdfExport.EmbedFonts = true;
pdfExport.Compressed = true;
//IExportPDF2 pdfExport2 = (IExportPDF2)pdfExport;
//pdfExport2.ExportPDFLayersAndFeatureAttributes = esriExportPDFLayerOptions.esriExportPDFLayerOptionsLayersOnly;
export = (IExport)pdfExport;
break;
case MapExportFormat.GIF:
IExportGIF gifExport = new ExportGIFClass();
export = (IExport)gifExport;
break;
case MapExportFormat.JPG:
IExportJPEG jpgExport = new ExportJPEGClass();
export = (IExport)jpgExport;
break;
case MapExportFormat.PNG:
IExportPNG pngExport = new ExportPNGClass();
export = (IExport)pngExport;
break;
}
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();
}