<?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: ExportActiveViewVB Sample - obtain PDF PageLayout in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412220#M11061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please see the following document that describes this issue in detail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001nn000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001nn000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Specifically this section is of interest:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Creating components�??In .NET, when you use the C# or VB.NET operator, it creates the object in the driving application's process space, not in the target application (for example, ArcMap) process. Often, what you really want is to create an object in the target application process space while accessing control of it from the driving application. This sort of control is made possible by the IObjectFactory interface, obtainable from the application object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After casting the application reference to IObjectFactory and using it to create the objects in the appropriate process space the export should no longer empty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jan 2011 18:59:38 GMT</pubDate>
    <dc:creator>JohnHauck</dc:creator>
    <dc:date>2011-01-24T18:59:38Z</dc:date>
    <item>
      <title>ExportActiveViewVB Sample - obtain PDF PageLayout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412219#M11060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sample runs me ok, inside ArcGis 10. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But if runs in a windows form application (with automated arcgis opened), the result its blank PDF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, Anyone can you help me ??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;JMJ98&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sample for SDK Argis 10:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Sub ExportActiveViewParameterized(ByVal ExportFormat As String, ByVal iOutputResolution As Long, ByVal lResampleRatio As Long, ByVal bClipToGraphicsExtent As Boolean)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'Export the active view using the specified parameters&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim docActiveView As IActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim docExport As IExport&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim docPrintAndExport As IPrintAndExport&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim RasterSettings As IOutputRasterSettings&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim sNameRoot As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim sOutputDir As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim bReenable As Boolean&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If (GetFontSmoothing()) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bReenable = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DisableFontSmoothing()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If (GetFontSmoothing()) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MsgBox("Cannot Disable Font Smoothing. Exiting.")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;docActiveView = My.ArcMap.Document.ActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;' Create an Export* object and cast the docExport interface pointer onto it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' To export to any format, we simply create the desired Class here&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ExportFormat = "PDF"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Select Case ExportFormat&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "PDF"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportPDF&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "EMF"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportEMF&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "BMP"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportBMP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "EPS"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "SVG"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportSVG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "GIF"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportGIF&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "TIF"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportTIFF&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "JPEG"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportJPEG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "PNG"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportPNG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case "AI"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportAI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Case Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MessageBox.Show("Unrecognized output format, defaulting to EMF")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExportFormat = "EMF"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport = New ExportEMF&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Select&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;docPrintAndExport = New PrintAndExport&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;' Output Image Quality of the export. The value here will only be used if the export&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' object is a format that allows setting of Output Image Quality, i.e. a vector exporter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' The value assigned to ResampleRatio should be in the range 1 to 5.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' 1 corresponds to "Best", 5 corresponds to "Fast"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If TypeOf docExport Is IOutputRasterSettings Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' for vector formats, assign a ResampleRatio to control drawing of raster layers at export time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterSettings = docExport&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterSettings.ResampleRatio = lResampleRatio&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;' NOTE: for raster formats output quality of the DISPLAY is set to 1 for image export &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' formats by default which is what should be used&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'assign the output path and filename. We can use the Filter property of the export object to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' automatically assign the proper extension to the file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sOutputDir = System.Environment.GetFolderPath(Environment.Speci alFolder.Personal) + "\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sNameRoot = "VBExportActiveViewSampleOutput"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport.ExportFileName = sOutputDir &amp;amp; sNameRoot &amp;amp; "." &amp;amp; Right(Split(docExport.Filter, "|")(1), _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Len(Split(docExport.Filter, "|")(1)) - 2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;docPrintAndExport.Export(docActiveView, docExport, iOutputResolution, bClipToGraphicsExtent, Nothing)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MessageBox.Show("Finished Exporting " &amp;amp; sOutputDir &amp;amp; sNameRoot &amp;amp; "." &amp;amp; Right(Split(docExport.Filter, "|")(1), _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Len(Split(docExport.Filter, "|")(1)) - 2) &amp;amp; ".", "Export Active View Sample")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'cleanup for the exporter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;docExport.Cleanup()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If (bReenable) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EnableFontSmoothing()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bReenable = False&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 08:55:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412219#M11060</guid>
      <dc:creator>JMJJDJM</dc:creator>
      <dc:date>2011-01-20T08:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: ExportActiveViewVB Sample - obtain PDF PageLayout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412220#M11061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please see the following document that describes this issue in detail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001nn000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001nn000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Specifically this section is of interest:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Creating components�??In .NET, when you use the C# or VB.NET operator, it creates the object in the driving application's process space, not in the target application (for example, ArcMap) process. Often, what you really want is to create an object in the target application process space while accessing control of it from the driving application. This sort of control is made possible by the IObjectFactory interface, obtainable from the application object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After casting the application reference to IObjectFactory and using it to create the objects in the appropriate process space the export should no longer empty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 18:59:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412220#M11061</guid>
      <dc:creator>JohnHauck</dc:creator>
      <dc:date>2011-01-24T18:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: ExportActiveViewVB Sample - obtain PDF PageLayout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412221#M11062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Please see the following document that describes this issue in detail.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001nn000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001nn000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Specifically this section is of interest:&lt;BR /&gt;&lt;BR /&gt;Creating components�??In .NET, when you use the C# or VB.NET operator, it creates the object in the driving application's process space, not in the target application (for example, ArcMap) process. Often, what you really want is to create an object in the target application process space while accessing control of it from the driving application. This sort of control is made possible by the IObjectFactory interface, obtainable from the application object.&lt;BR /&gt;&lt;BR /&gt;After casting the application reference to IObjectFactory and using it to create the objects in the appropriate process space the export should no longer empty.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not know in which namespace I create my objects. If when you create the class MXDocument, PageLayout object is created and is the one I use for export.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; It should not be complicated, in version 10 of ArcMap, export to PDF, is an operation of the most common ... Why so complicated?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I read the article and sent me a code that is the one I use to launch the ArcMap application. Add a legend to the layout (codes) but the export, only get a blank PDF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JMJ98&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 14:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exportactiveviewvb-sample-obtain-pdf-pagelayout/m-p/412221#M11062</guid>
      <dc:creator>JMJJDJM</dc:creator>
      <dc:date>2011-03-09T14:57:20Z</dc:date>
    </item>
  </channel>
</rss>

