<?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: Problems creating an MXD thumbnail. in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problems-creating-an-mxd-thumbnail/m-p/40346#M1046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have any working cod, but I ran the following script and had problems.&amp;nbsp; Every map document in the folder reverted back to 8 1/2 x 11 inch page sizes targeted to my default printer.&amp;nbsp; I lost all my large-format printer settings and had to reposition and resize every element in the layout view, causing me to redo hours of work done over the last few days.&amp;nbsp; Yes, I should have tried with only one map document as a test, but it's a hard less to relearn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
import os.path
import arcpy.mapping
mapFolder = os.curdir
for mapDoc in os.listdir(mapFolder):&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.splitext(mapDoc)[1] == '.mxd':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPath = os.path.join(mapFolder, mapDoc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Regenerating thumbnail for ' + mapPath + '...'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mapPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.deleteThumbnail()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.makeThumbnail()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del mxd&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:34:24 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-10T21:34:24Z</dc:date>
    <item>
      <title>Problems creating an MXD thumbnail.</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problems-creating-an-mxd-thumbnail/m-p/40345#M1045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to create a thumbnail for a map document, but I've run into problems.&amp;nbsp; I've found two avenues of aproach, but neither works well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Method 1 opens the MXD with the MapDocumentClass and then saves using IMapDocument.Save(useRelativePaths, createThumbnail).&amp;nbsp; This method works for simple map documents.&amp;nbsp; But, any map layers with a transparency setting will not show in the thumbnail.&amp;nbsp; Their labels will show, but not the features.&amp;nbsp; For the maps I'm working with, this results in an unrecognizable thumbnail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Method 2 uses IDocumentPreview.CreatePreview method off of an MxDocumentClass retrieved from the currently open map document in ArcMap.&amp;nbsp; This method used to work in ArcMap 9 (as long as the document already had a thumbnail).&amp;nbsp; It does not seem to work in ArcMap 10.&amp;nbsp; I have tried setting the IDocumentInfo.SavePreview flag to true and flagging the document as dirty before save, but nothing results in a thumbnail saved with the MXD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it should be possible to get this to work, since the CreateThumbnail button in the Map Document Properties dialog works.&amp;nbsp; Does anyone have some working code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 16:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problems-creating-an-mxd-thumbnail/m-p/40345#M1045</guid>
      <dc:creator>PrestonMcCormick</dc:creator>
      <dc:date>2013-05-30T16:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problems creating an MXD thumbnail.</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problems-creating-an-mxd-thumbnail/m-p/40346#M1046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have any working cod, but I ran the following script and had problems.&amp;nbsp; Every map document in the folder reverted back to 8 1/2 x 11 inch page sizes targeted to my default printer.&amp;nbsp; I lost all my large-format printer settings and had to reposition and resize every element in the layout view, causing me to redo hours of work done over the last few days.&amp;nbsp; Yes, I should have tried with only one map document as a test, but it's a hard less to relearn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
import os.path
import arcpy.mapping
mapFolder = os.curdir
for mapDoc in os.listdir(mapFolder):&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.splitext(mapDoc)[1] == '.mxd':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPath = os.path.join(mapFolder, mapDoc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Regenerating thumbnail for ' + mapPath + '...'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mapPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.deleteThumbnail()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.makeThumbnail()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del mxd&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:34:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problems-creating-an-mxd-thumbnail/m-p/40346#M1046</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T21:34:24Z</dc:date>
    </item>
  </channel>
</rss>

