Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import arcpy, os
  2.  
  3. # Set the workspace.
  4. arcpy.env.workspace = r"C:Output"
  5.  
  6. #Set file name and remove if it already exists
  7. pdfPath = r"C:OutputMap.pdf"
  8. if os.path.exists(pdfPath):
  9. os.remove(pdfPath)
  10.  
  11. # List all of the pdf files in the output folder.
  12. # pdfList is a Python List returned from the ListFiles function.
  13. pdfList = arcpy.ListFiles("*.pdf")
  14.  
  15. #Create the file and append pages
  16. pdfDoc = arcpy.mp.PDFDocumentCreate(pdfPath)
  17.  
  18. for f in pdfList:
  19. pdfDoc.appendPages(f)
  20.  
  21. pdfDoc.saveAndClose()
  22.  
  23. del pdfDoc
  24.  
  25. import os
  26. for f in pdfList:
  27. pdfDoc.appendPages(os.path.join (r"C:Output", f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement