<?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 ExportToPDF and scale issues in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/exporttopdf-and-scale-issues/m-p/291003#M22534</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am having trouble with a script that I've used hundreds of times in 10.0 and 10.1 but no longer works in 10.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is necessary for me to export the data frame instead of the entire page layout so I am passing the data frame object to the ExportToPDF function and I am providing height and width with df_export_height and df_export_width. I have always set the height to df.elementHeight / 0.004 and width to df.elementWidth / 0.004 because this ensures that the pdf document's height and width are the same as the data frame's height and width. This part still works. A data frame set to 36 inches by 48 inches will result in a 36x48 inch pdf. But the exported map appears to be zoomed out to about 1:60,000 even though I've set the df.scale to 31680. I have tried different data frame heights and widths, different scales, and different mxds&amp;nbsp; but the pdf always appears zoomed out to around double the data frame scale. This code produced pdfs with the appropriate scale before I upgraded to 10.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.scale = 31680
dfew = df.elementWidth/0.004
dfeh = df.elementHeight/0.004
arcpy.mapping.ExportToPDF(mxd, 'C:/test.pdf', df, df_export_width=dfew, \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df_export_height=dfeh, resolution=250, image_quality='BETTER', \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jpeg_compression_quality=25, layers_attributes='NONE')&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:02:09 GMT</pubDate>
    <dc:creator>JohnKidd3</dc:creator>
    <dc:date>2021-12-11T14:02:09Z</dc:date>
    <item>
      <title>ExportToPDF and scale issues</title>
      <link>https://community.esri.com/t5/python-questions/exporttopdf-and-scale-issues/m-p/291003#M22534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am having trouble with a script that I've used hundreds of times in 10.0 and 10.1 but no longer works in 10.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is necessary for me to export the data frame instead of the entire page layout so I am passing the data frame object to the ExportToPDF function and I am providing height and width with df_export_height and df_export_width. I have always set the height to df.elementHeight / 0.004 and width to df.elementWidth / 0.004 because this ensures that the pdf document's height and width are the same as the data frame's height and width. This part still works. A data frame set to 36 inches by 48 inches will result in a 36x48 inch pdf. But the exported map appears to be zoomed out to about 1:60,000 even though I've set the df.scale to 31680. I have tried different data frame heights and widths, different scales, and different mxds&amp;nbsp; but the pdf always appears zoomed out to around double the data frame scale. This code produced pdfs with the appropriate scale before I upgraded to 10.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.scale = 31680
dfew = df.elementWidth/0.004
dfeh = df.elementHeight/0.004
arcpy.mapping.ExportToPDF(mxd, 'C:/test.pdf', df, df_export_width=dfew, \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df_export_height=dfeh, resolution=250, image_quality='BETTER', \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jpeg_compression_quality=25, layers_attributes='NONE')&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:02:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporttopdf-and-scale-issues/m-p/291003#M22534</guid>
      <dc:creator>JohnKidd3</dc:creator>
      <dc:date>2021-12-11T14:02:09Z</dc:date>
    </item>
  </channel>
</rss>

