1

I have a MapDocument that I am trying to export to PDF. I am using this example. However, it always says it is finished but when I open the pdf file there is nothing in it. I have tried exporting to a TIFF but with the same results. Is there a known reason why this might be happening?

When it brings up the ArcMap program, it displays everything properly and I can manually export to PDF from the program just fine.

2

I ended with the same result months before and I could not found a solution using IPrintAndExport. I would recommend to use theIExportdirectly. Please have a look at the following ExportActiveView function in this example in VBA or this post to a different topic with an example in C#. This works without problems in my case. You can simply exchange the ExportJPEG instance by the format you prefer.

| improve this answer | |
0

I hit the same blank PDF issue when creating a winforms program to ArcMap to do automation tasks. Reading the official documentation and specifically this discussion, I realize it is due to the processing space issue. I resolve the issue by create the ExportPDF and PrintAndExport instance via IObjectFactory.

IObjectFactory oj = _app as IObjectFactory; //_app is the IApplication obtained via ((new MxDocument() as IDocument).Parent) as IApplication
IExport docExport = (IExport) oj.Create("esriOutput.ExportPDF");;
IPrintAndExport docPrintExport = (IPrintAndExport)oj.Create("esriCarto.PrintAndExport");
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.