Invalid MXD while trying to convert MXD to PDF using ArcPy? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Change ArcSDE data source for mxds in specific folder using ArcPy?Using arcpy.mapping print command to display mxds in loop?Using os.walk to update broken links and save mxdAssertionError: Invalid MXD filename from arcpy.mapping.MapDocument()?Entering date with arcpy.GetParameterAsText()?arcpy MakeFeatureLayer - one workspace question, one output questionExporting jpeg around polygon boundary using Python?Error converting Json file to a feature classIterating folder of shapefiles using ArcPy and exporting mxd to PDFarcpy SelectLayerByAttribute_management runs in the Python window in ArcGIS Pro, but fails to run from Spyder or PyCharm
NIntegrate on a solution of a matrix ODE
Who said what about *meanings*?
An isoperimetric-type inequality inside a cube
Keep at all times, the minus sign above aligned with minus sign below
One-one communication
In musical terms, what properties are varied by the human voice to produce different words / syllables?
First paper to introduce the "principal-agent problem"
Why not use the yoke to control yaw, as well as pitch and roll?
Order between one to one functions and their inverses
What does 丫 mean? 丫是什么意思?
What is the proper term for etching or digging of wall to hide conduit of cables
Marquee sign letters
Is there any significance to the prison numbers of the Beagle Boys starting with 176-?
Pointing to problems without suggesting solutions
Number of generators of subgroup
Besides transaction validation, are there any other uses of the Script language in Bitcoin
How do you write "wild blueberries flavored"?
Is a copyright notice with a non-existent name be invalid?
Did pre-Columbian Americans know the spherical shape of the Earth?
What is a more techy Technical Writer job title that isn't cutesy or confusing?
Can the Haste spell grant both a Beast Master ranger and their animal companion extra attacks?
The Nth Gryphon Number
How does TikZ render an arc?
How much damage would a cupful of neutron star matter do to the Earth?
Invalid MXD while trying to convert MXD to PDF using ArcPy?
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Change ArcSDE data source for mxds in specific folder using ArcPy?Using arcpy.mapping print command to display mxds in loop?Using os.walk to update broken links and save mxdAssertionError: Invalid MXD filename from arcpy.mapping.MapDocument()?Entering date with arcpy.GetParameterAsText()?arcpy MakeFeatureLayer - one workspace question, one output questionExporting jpeg around polygon boundary using Python?Error converting Json file to a feature classIterating folder of shapefiles using ArcPy and exporting mxd to PDFarcpy SelectLayerByAttribute_management runs in the Python window in ArcGIS Pro, but fails to run from Spyder or PyCharm
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom: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 mxd to pdf.
arcpy pdf mxd
add a comment |
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 mxd to pdf.
arcpy pdf mxd
I see a lot of issues but first, are you typing “current” into the console/terminal?
– PMK
Apr 13 at 2:41
add a comment |
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 mxd to pdf.
arcpy pdf mxd
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 mxd to pdf.
arcpy pdf mxd
arcpy pdf mxd
edited Apr 13 at 0:39
Kirk Kuykendall
21.7k657145
21.7k657145
asked Apr 12 at 18:22
Niana Niana
1011
1011
I see a lot of issues but first, are you typing “current” into the console/terminal?
– PMK
Apr 13 at 2:41
add a comment |
I see a lot of issues but first, are you typing “current” into the console/terminal?
– PMK
Apr 13 at 2:41
I see a lot of issues but first, are you typing “current” into the console/terminal?
– PMK
Apr 13 at 2:41
I see a lot of issues but first, are you typing “current” into the console/terminal?
– PMK
Apr 13 at 2:41
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
I see a lot of issues but first, are you typing “current” into the console/terminal?
– PMK
Apr 13 at 2:41