I have a weird issue in exporting the layout to PDF My code is really simple and I have tried in ArcGIS Python IDLE but I have came across the problem.

My Code and error is :


aprx = arcpy.mp.ArcGISProject("CURRENT")
Layout = aprx.listLayouts()[0]


Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\utils.py", line 191, in fn_
    return fn(*args, **kw)
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\_mp.py", line 975, in exportToPDF
    return convertArcObjectToPythonObject(self._arc_object.exportToPDF(*gp_fixargs((out_pdf, resolution, image_quality, compress_vector_graphics, image_compression, embed_fonts, layers_attributes, georef_info, jpeg_compression_quality, clip_to_elements), True)))
OSError: C\1.pdf
  • 1
    What happens when you try to save it to a directory instead of the root of the C:\ drive and give it a name that starts with a letter, i.e. C:\temp\a1.pdf
    – user2856
    Commented Mar 24, 2019 at 2:23
  • I have tried and it worked. Actually, it was part of my script tools and the problem was I was referring to save pdf to project path instead of project folder path. but as curiosity why could not we able to save in C drive. Commented Mar 24, 2019 at 2:41
  • 1
    If you’re using CURRENT you need to run the code from within Pro. You can’t run it from outside the app, in Idle. CURRENT doesn’t exist there
    – KHibma
    Commented Mar 24, 2019 at 2:44

1 Answer 1


If using a filename that starts with a numeral like this:


gives that OSError and using one that does not like this:


does not give the error, then it suggests to me that you may not be using supported file naming conventions for ArcGIS Pro. If I can find a link to where these are documented I will add it into this answer.

  • 2
    This is highly unlikely to be a Pro problem. Its almost certainly a domain policy setting within the users organization. I'm at a company where I cannot create c:\foo.txt using notepad.
    – KHibma
    Commented Mar 25, 2019 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.