Skip to main content
Added language tag
Source Link
Hornbydd
  • 44.6k
  • 5
  • 42
  • 84

I understand that you have to re-orient the XY/min/max to fit a tagRECT but I'm still getting an "Invalid pixel bound value(s)" error. I have also tried setting Ymin/Ymax = bottom/top but I get the same error.

IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView actView = mxdoc.ActiveView;

IExport exporter = new ExportPDFClass();
exporter.ExportFileName = @"U:\FILEPATH\topoexport.pdf";
exporter.Resolution = 300;

IEnvelope pixBounds = new EnvelopeClass();
int hdc = exporter.StartExporting();
pixBounds.XMin = actView.ExportFrame.left;
pixBounds.XMax = actView.ExportFrame.right;
pixBounds.YMin = actView.ExportFrame.top;
pixBounds.YMax = actView.ExportFrame.bottom;
exporter.PixelBounds = pixBounds;
tagRECT rectangle = actView.ExportFrame;

actView.Output(hdc, (int)exporter.Resolution, ref rectangle, null, null);
exporter.FinishExporting();
exporter.Cleanup();
IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView actView = mxdoc.ActiveView;

IExport exporter = new ExportPDFClass();
exporter.ExportFileName = @"U:\FILEPATH\topoexport.pdf";
exporter.Resolution = 300;

IEnvelope pixBounds = new EnvelopeClass();
int hdc = exporter.StartExporting();
pixBounds.XMin = actView.ExportFrame.left;
pixBounds.XMax = actView.ExportFrame.right;
pixBounds.YMin = actView.ExportFrame.top;
pixBounds.YMax = actView.ExportFrame.bottom;
exporter.PixelBounds = pixBounds;
tagRECT rectangle = actView.ExportFrame;

actView.Output(hdc, (int)exporter.Resolution, ref rectangle, null, null);
exporter.FinishExporting();
exporter.Cleanup();

I understand that you have to re-orient the XY/min/max to fit a tagRECT but I'm still getting an "Invalid pixel bound value(s)" error. I have also tried setting Ymin/Ymax = bottom/top but I get the same error.

IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView actView = mxdoc.ActiveView;

IExport exporter = new ExportPDFClass();
exporter.ExportFileName = @"U:\FILEPATH\topoexport.pdf";
exporter.Resolution = 300;

IEnvelope pixBounds = new EnvelopeClass();
int hdc = exporter.StartExporting();
pixBounds.XMin = actView.ExportFrame.left;
pixBounds.XMax = actView.ExportFrame.right;
pixBounds.YMin = actView.ExportFrame.top;
pixBounds.YMax = actView.ExportFrame.bottom;
exporter.PixelBounds = pixBounds;
tagRECT rectangle = actView.ExportFrame;

actView.Output(hdc, (int)exporter.Resolution, ref rectangle, null, null);
exporter.FinishExporting();
exporter.Cleanup();

I understand that you have to re-orient the XY/min/max to fit a tagRECT but I'm still getting an "Invalid pixel bound value(s)" error. I have also tried setting Ymin/Ymax = bottom/top but I get the same error.

IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView actView = mxdoc.ActiveView;

IExport exporter = new ExportPDFClass();
exporter.ExportFileName = @"U:\FILEPATH\topoexport.pdf";
exporter.Resolution = 300;

IEnvelope pixBounds = new EnvelopeClass();
int hdc = exporter.StartExporting();
pixBounds.XMin = actView.ExportFrame.left;
pixBounds.XMax = actView.ExportFrame.right;
pixBounds.YMin = actView.ExportFrame.top;
pixBounds.YMax = actView.ExportFrame.bottom;
exporter.PixelBounds = pixBounds;
tagRECT rectangle = actView.ExportFrame;

actView.Output(hdc, (int)exporter.Resolution, ref rectangle, null, null);
exporter.FinishExporting();
exporter.Cleanup();
Source Link
cevondanady
  • 633
  • 7
  • 16

Cannot export IActiveView to PDF, invalid pixel bound value(s)

I understand that you have to re-orient the XY/min/max to fit a tagRECT but I'm still getting an "Invalid pixel bound value(s)" error. I have also tried setting Ymin/Ymax = bottom/top but I get the same error.

IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView actView = mxdoc.ActiveView;

IExport exporter = new ExportPDFClass();
exporter.ExportFileName = @"U:\FILEPATH\topoexport.pdf";
exporter.Resolution = 300;

IEnvelope pixBounds = new EnvelopeClass();
int hdc = exporter.StartExporting();
pixBounds.XMin = actView.ExportFrame.left;
pixBounds.XMax = actView.ExportFrame.right;
pixBounds.YMin = actView.ExportFrame.top;
pixBounds.YMax = actView.ExportFrame.bottom;
exporter.PixelBounds = pixBounds;
tagRECT rectangle = actView.ExportFrame;

actView.Output(hdc, (int)exporter.Resolution, ref rectangle, null, null);
exporter.FinishExporting();
exporter.Cleanup();