<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export Map as PDF in C#? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072941#M20339</link>
    <description>&lt;P&gt;Here is another &lt;A href="https://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Create_JPEG_from_ActiveView_Snippet/004900000064000000/" target="_self"&gt;code snippet&lt;/A&gt; for you to explore this one creating a JPEG. Just a matter of adapting to a PDF format.&lt;/P&gt;</description>
    <pubDate>Sat, 26 Jun 2021 15:24:01 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2021-06-26T15:24:01Z</dc:date>
    <item>
      <title>Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1071581#M20332</link>
      <description>&lt;P&gt;Is there a way to automatically export a map to a folder as a pdf using an add-in? I have an add-in set up but can't find any documentation for how to accomplish the exporting part. Please let me know if you can help.&lt;/P&gt;&lt;P&gt;P.S: if you have any general tips for learning development with ArcObjects please leave a comment.&lt;/P&gt;&lt;P&gt;-Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 17:06:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1071581#M20332</guid>
      <dc:creator>Rconrad</dc:creator>
      <dc:date>2021-06-23T17:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072025#M20336</link>
      <description>&lt;P&gt;Here is what I use to export to a BMP.&amp;nbsp; &amp;nbsp;There is also an ExportPDFClass() for line 8 with similar functions.&lt;/P&gt;&lt;P&gt;Uses ESRI.ArcGIS.Output&lt;/P&gt;&lt;P&gt;and VerifyFile merely checks if a file is already there and deletes it if it is.&amp;nbsp; Should be fairly easy to reproduce.&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;P&gt;Brent Hoskisson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;       public static bool ExportActiveView(IMap map, string bmpFile)
        {
            string pathName = "";
            string fileName = "";
            if (AOUtilities.VerifyFile(bmpFile, "bmp", out pathName, out fileName))
                File.Delete(bmpFile);
            IActiveView av = (IActiveView)map;
            IExport pExport = new ExportBMPClass();
            pExport.ExportFileName = bmpFile;
            //pExport.Resolution = 96;
            tagRECT eRect = av.ExportFrame;
            IEnvelope pPBE = new EnvelopeClass();
            pPBE.PutCoords(eRect.left, eRect.top, eRect.right, eRect.bottom);
            pExport.PixelBounds = pPBE;
            try
            {
                int hDC = pExport.StartExporting();
                av.Output(hDC, Convert.ToInt32(pExport.Resolution), ref eRect, null, null);
                pExport.FinishExporting();
                return true;
            }
            catch
            {
                return false;
            }
            finally
            {
                pExport.Cleanup();
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:32:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072025#M20336</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2021-06-24T14:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072765#M20338</link>
      <description>&lt;P&gt;Thank you so much for your reply, I just have a few questions though... I keep getting "Interop Type ExportBMPClass cannot be embedded" errors, and I am not sure where the variables "AOUtilities" or "File" come from. Do you have any ideas? Thanks again.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rconrad_0-1624650117871.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17042iCEE7B1E227F0FE00/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rconrad_0-1624650117871.png" alt="Rconrad_0-1624650117871.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Rylan Conrad&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 19:42:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072765#M20338</guid>
      <dc:creator>Rconrad</dc:creator>
      <dc:date>2021-06-25T19:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072941#M20339</link>
      <description>&lt;P&gt;Here is another &lt;A href="https://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Create_JPEG_from_ActiveView_Snippet/004900000064000000/" target="_self"&gt;code snippet&lt;/A&gt; for you to explore this one creating a JPEG. Just a matter of adapting to a PDF format.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 15:24:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1072941#M20339</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-06-26T15:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073215#M20340</link>
      <description>&lt;P&gt;That's super helpful, but what do I pass in for the IActiveView parameter when calling the function.&lt;/P&gt;&lt;P&gt;It looks something like this -- CreateJPEGFromActiveView(activeView, @"c:\\....")&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3515"&gt;@DuncanHornby&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 15:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073215#M20340</guid>
      <dc:creator>Rconrad</dc:creator>
      <dc:date>2021-06-28T15:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073225#M20341</link>
      <description>&lt;P&gt;Ryan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need only to scroll down the snippet list and you will discover a function called....&amp;nbsp;&lt;/P&gt;&lt;P&gt;Get ActiveView from ArcMap Snippet&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;A href="https://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IActiveView_Interface/001200000199000000/" target="_self"&gt;active view&lt;/A&gt; could be either the Map or Layout as indicated by the object model in the help file&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 15:21:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073225#M20341</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-06-28T15:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073492#M20342</link>
      <description>&lt;P&gt;Duncan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. On the&amp;nbsp;&lt;A href="https://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Get_ActiveView_from_ArcMap_Snippet/00490000008n000000/" target="_self"&gt;Get ActiveView Snippet,&lt;/A&gt;&amp;nbsp; where does the "application" parameter come from? Thanks again.&lt;/P&gt;&lt;P&gt;-Rylan&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 22:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073492#M20342</guid>
      <dc:creator>Rconrad</dc:creator>
      <dc:date>2021-06-28T22:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073587#M20343</link>
      <description>&lt;P&gt;The application parameter is the application, in VB you get a handle on it using the code:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;My.ArcMap.Application&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't code in c# but I would imagine its similar? Just look around at some code samples?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 09:24:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1073587#M20343</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-06-29T09:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Export Map as PDF in C#?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1080964#M20352</link>
      <description>&lt;P&gt;For ExportBMPClass cannot be embedded:&lt;/P&gt;&lt;P&gt;Find ESRI.ArcGIS.Output Reference and view the properties.&amp;nbsp; Set Embed Interop Types to false.&lt;/P&gt;&lt;P&gt;You can remove the VerifyFile type call and just enter the path name and file name of your output BMP into the variable initializers.&amp;nbsp; Then just run a File.Exists on the file name to see if you need to delete it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 17:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-as-pdf-in-c/m-p/1080964#M20352</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2021-07-20T17:55:20Z</dc:date>
    </item>
  </channel>
</rss>

