Invalid MXD while trying to convert MXD to PDF using ArcPy? The 2019 Stack Overflow Developer...

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Did the new image of black hole confirm the general theory of relativity?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Student Loan from years ago pops up and is taking my salary

Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?

Solving overdetermined system by QR decomposition

Do working physicists consider Newtonian mechanics to be "falsified"?

Is an up-to-date browser secure on an out-of-date OS?

How to read αἱμύλιος or when to aspirate

How many cones with angle theta can I pack into the unit sphere?

Button changing its text & action. Good or terrible?

TDS update packages don't remove unneeded items

Match Roman Numerals

What is the padding with red substance inside of steak packaging?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

How to handle characters who are more educated than the author?

How to determine omitted units in a publication

What's the point in a preamp?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

Is every episode of "Where are my Pants?" identical?

Why can't devices on different VLANs, but on the same subnet, communicate?

number sequence puzzle deep six

Make it rain characters

How do you keep chess fun when your opponent constantly beats you?



Invalid MXD while trying to convert MXD to PDF using ArcPy?



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to Batch export MXD to PDF files?Error while publishing a mxd as service uing pythonWhy do ECWs go missing when exporting MXD to PDF with ArcPy?Python Error while Publishing mxd ArcGIS 10.1Invalid MXD filename in a python scriptHow to convert MXD to DWG FileTrying to convert lines to pointsArcGIS Data driven pages Two MXD in one pdfGetting error while trying to saveWhen exporting MXD to PDF, map layout moves to left?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am trying to convert an MXD using a script from this link
https://www.arcgis.com/home/item.html?id=4ddd1323ae0d4ebe8f8250992faab0f4



When I run the script I get the following error: Invalid MXD filename.



Looking at the command promt pasted below I can already see that there is path problems as the path I enter is different form the path I output (Missing '/'). However even if I create that bogus path and place the file there, there is still an error.



import arcpy, sys, os

arcpy.OverWriteOutput = 1

print "Enter folder path:"
mapDoc = raw_input()

print os.path.dirname(mapDoc)
fullnam = os.path.basename(mapDoc)

nam = fullnam.strip(".mxd")
print nam

map = arcpy.mapping
mxd = map.MapDocument(mapDoc)

map_document = mxd
out_pdf = os.path.dirname(mapDoc) + os.sep + nam + ".pdf"

data_frame = 'PAGE_LAYOUT'
resolution = "300"
image_quality = "NORMAL"
colorspace = "RGB"
compress_vectors = "True"
image_compression = "DEFLATE"
picture_symbol = 'RASTERIZE_BITMAP'
convert_markers = "False"
embed_fonts = "True"
layers_attributes = "NONE"
georef_info = "False"

map.ExportToPDF(map_document, out_pdf, data_frame, 640, 480, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info)

arcpy.GetMessages()

Command Prompt

`(arcgispro-py3) C:Program FilesArcGISProbinPythonenvsarcgispro-py3>"C:Us
ersantDocumentsMyCensus_FilesPython scriptExport2PDF.py"
Enter folder path:
C:UsersantDocumentsMyCensus_FilesPython script
C:UsersantDocumentsMyCensus_Files
Python script
Traceback (most recent call last):
File "C:UsersantDocumentsMyCensus_FilesPython scriptExport2PDF.py
", line 22, in <module>
mxd = map.MapDocument(mapDoc)
File "C:Program Files (x86)ArcGISDesktop10.6ArcPyarcpyarcobjectsmixins.
py", line 651, in __init__
assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(
89004, "Invalid MXD filename")
AssertionError: Invalid MXD filename.


Looking for some assistance in fixing this path issue or even a script to convert batch mdx to pdf.










share|improve this question









New contributor




Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I am trying to convert an MXD using a script from this link
    https://www.arcgis.com/home/item.html?id=4ddd1323ae0d4ebe8f8250992faab0f4



    When I run the script I get the following error: Invalid MXD filename.



    Looking at the command promt pasted below I can already see that there is path problems as the path I enter is different form the path I output (Missing '/'). However even if I create that bogus path and place the file there, there is still an error.



    import arcpy, sys, os

    arcpy.OverWriteOutput = 1

    print "Enter folder path:"
    mapDoc = raw_input()

    print os.path.dirname(mapDoc)
    fullnam = os.path.basename(mapDoc)

    nam = fullnam.strip(".mxd")
    print nam

    map = arcpy.mapping
    mxd = map.MapDocument(mapDoc)

    map_document = mxd
    out_pdf = os.path.dirname(mapDoc) + os.sep + nam + ".pdf"

    data_frame = 'PAGE_LAYOUT'
    resolution = "300"
    image_quality = "NORMAL"
    colorspace = "RGB"
    compress_vectors = "True"
    image_compression = "DEFLATE"
    picture_symbol = 'RASTERIZE_BITMAP'
    convert_markers = "False"
    embed_fonts = "True"
    layers_attributes = "NONE"
    georef_info = "False"

    map.ExportToPDF(map_document, out_pdf, data_frame, 640, 480, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info)

    arcpy.GetMessages()

    Command Prompt

    `(arcgispro-py3) C:Program FilesArcGISProbinPythonenvsarcgispro-py3>"C:Us
    ersantDocumentsMyCensus_FilesPython scriptExport2PDF.py"
    Enter folder path:
    C:UsersantDocumentsMyCensus_FilesPython script
    C:UsersantDocumentsMyCensus_Files
    Python script
    Traceback (most recent call last):
    File "C:UsersantDocumentsMyCensus_FilesPython scriptExport2PDF.py
    ", line 22, in <module>
    mxd = map.MapDocument(mapDoc)
    File "C:Program Files (x86)ArcGISDesktop10.6ArcPyarcpyarcobjectsmixins.
    py", line 651, in __init__
    assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(
    89004, "Invalid MXD filename")
    AssertionError: Invalid MXD filename.


    Looking for some assistance in fixing this path issue or even a script to convert batch mdx to pdf.










    share|improve this question









    New contributor




    Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I am trying to convert an MXD using a script from this link
      https://www.arcgis.com/home/item.html?id=4ddd1323ae0d4ebe8f8250992faab0f4



      When I run the script I get the following error: Invalid MXD filename.



      Looking at the command promt pasted below I can already see that there is path problems as the path I enter is different form the path I output (Missing '/'). However even if I create that bogus path and place the file there, there is still an error.



      import arcpy, sys, os

      arcpy.OverWriteOutput = 1

      print "Enter folder path:"
      mapDoc = raw_input()

      print os.path.dirname(mapDoc)
      fullnam = os.path.basename(mapDoc)

      nam = fullnam.strip(".mxd")
      print nam

      map = arcpy.mapping
      mxd = map.MapDocument(mapDoc)

      map_document = mxd
      out_pdf = os.path.dirname(mapDoc) + os.sep + nam + ".pdf"

      data_frame = 'PAGE_LAYOUT'
      resolution = "300"
      image_quality = "NORMAL"
      colorspace = "RGB"
      compress_vectors = "True"
      image_compression = "DEFLATE"
      picture_symbol = 'RASTERIZE_BITMAP'
      convert_markers = "False"
      embed_fonts = "True"
      layers_attributes = "NONE"
      georef_info = "False"

      map.ExportToPDF(map_document, out_pdf, data_frame, 640, 480, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info)

      arcpy.GetMessages()

      Command Prompt

      `(arcgispro-py3) C:Program FilesArcGISProbinPythonenvsarcgispro-py3>"C:Us
      ersantDocumentsMyCensus_FilesPython scriptExport2PDF.py"
      Enter folder path:
      C:UsersantDocumentsMyCensus_FilesPython script
      C:UsersantDocumentsMyCensus_Files
      Python script
      Traceback (most recent call last):
      File "C:UsersantDocumentsMyCensus_FilesPython scriptExport2PDF.py
      ", line 22, in <module>
      mxd = map.MapDocument(mapDoc)
      File "C:Program Files (x86)ArcGISDesktop10.6ArcPyarcpyarcobjectsmixins.
      py", line 651, in __init__
      assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(
      89004, "Invalid MXD filename")
      AssertionError: Invalid MXD filename.


      Looking for some assistance in fixing this path issue or even a script to convert batch mdx to pdf.










      share|improve this question









      New contributor




      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am trying to convert an MXD using a script from this link
      https://www.arcgis.com/home/item.html?id=4ddd1323ae0d4ebe8f8250992faab0f4



      When I run the script I get the following error: Invalid MXD filename.



      Looking at the command promt pasted below I can already see that there is path problems as the path I enter is different form the path I output (Missing '/'). However even if I create that bogus path and place the file there, there is still an error.



      import arcpy, sys, os

      arcpy.OverWriteOutput = 1

      print "Enter folder path:"
      mapDoc = raw_input()

      print os.path.dirname(mapDoc)
      fullnam = os.path.basename(mapDoc)

      nam = fullnam.strip(".mxd")
      print nam

      map = arcpy.mapping
      mxd = map.MapDocument(mapDoc)

      map_document = mxd
      out_pdf = os.path.dirname(mapDoc) + os.sep + nam + ".pdf"

      data_frame = 'PAGE_LAYOUT'
      resolution = "300"
      image_quality = "NORMAL"
      colorspace = "RGB"
      compress_vectors = "True"
      image_compression = "DEFLATE"
      picture_symbol = 'RASTERIZE_BITMAP'
      convert_markers = "False"
      embed_fonts = "True"
      layers_attributes = "NONE"
      georef_info = "False"

      map.ExportToPDF(map_document, out_pdf, data_frame, 640, 480, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info)

      arcpy.GetMessages()

      Command Prompt

      `(arcgispro-py3) C:Program FilesArcGISProbinPythonenvsarcgispro-py3>"C:Us
      ersantDocumentsMyCensus_FilesPython scriptExport2PDF.py"
      Enter folder path:
      C:UsersantDocumentsMyCensus_FilesPython script
      C:UsersantDocumentsMyCensus_Files
      Python script
      Traceback (most recent call last):
      File "C:UsersantDocumentsMyCensus_FilesPython scriptExport2PDF.py
      ", line 22, in <module>
      mxd = map.MapDocument(mapDoc)
      File "C:Program Files (x86)ArcGISDesktop10.6ArcPyarcpyarcobjectsmixins.
      py", line 651, in __init__
      assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(
      89004, "Invalid MXD filename")
      AssertionError: Invalid MXD filename.


      Looking for some assistance in fixing this path issue or even a script to convert batch mdx to pdf.







      arcpy pdf mxd






      share|improve this question









      New contributor




      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 9 mins ago









      PolyGeo

      53.9k1782246




      53.9k1782246






      New contributor




      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 hours ago









      Niana Niana

      1011




      1011




      New contributor




      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Niana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Niana is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318644%2finvalid-mxd-while-trying-to-convert-mxd-to-pdf-using-arcpy%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Niana is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Niana is a new contributor. Be nice, and check out our Code of Conduct.













          Niana is a new contributor. Be nice, and check out our Code of Conduct.












          Niana is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318644%2finvalid-mxd-while-trying-to-convert-mxd-to-pdf-using-arcpy%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Энтрерриос (город) Содержание История | Географическое...