Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy, os
- # Set the workspace.
- arcpy.env.workspace = r"C:Output"
- #Set file name and remove if it already exists
- pdfPath = r"C:OutputMap.pdf"
- if os.path.exists(pdfPath):
- os.remove(pdfPath)
- # List all of the pdf files in the output folder.
- # pdfList is a Python List returned from the ListFiles function.
- pdfList = arcpy.ListFiles("*.pdf")
- #Create the file and append pages
- pdfDoc = arcpy.mp.PDFDocumentCreate(pdfPath)
- for f in pdfList:
- pdfDoc.appendPages(f)
- pdfDoc.saveAndClose()
- del pdfDoc
- import os
- for f in pdfList:
- pdfDoc.appendPages(os.path.join (r"C:Output", f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement