Hello Everyone,
I am having trouble printing to PFD using C#. The code outputs the map with everything it is suppose to have but it creates a much smaller pdf the what I have set for the page layout. For example, my page layout is 8.5 by 11 landscape but my document comes out as 4.4 by 3.4 inches. I am not sure what I am missing. I have tried the changing the resolution to 96dpi but it changes nothing. Any help would be great. My code is posted below.
Cheers,
Jeff
IMxDocument mxDoc = (IMxDocument)esriApp.Document;
int hdc = 0;
string path = textBox3.Text;
string VendorID = textBox1.Text;
ESRI.ArcGIS.Display.tagRECT pExportFrame = mxDoc.ActiveView.ExportFrame;
IEnvelope env = new EnvelopeClass();
env.PutCoords(pExportFrame.left, pExportFrame.top, (pExportFrame.right) , (pExportFrame.bottom) );
IExport exOP = new ExportPDFClass();
exOP.PixelBounds = env;
exOP.ExportFileName = path + "\\" + VendorID+".pdf";
try
{
hdc = exOP.StartExporting();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
mxDoc.ActiveView.Output(hdc, 300,ref pExportFrame, null, null);
exOP.FinishExporting();