ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS for Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

PDFDocumentCreate

  • Zusammenfassung
  • Auswertung
  • Syntax
  • Codebeispiel

Zusammenfassung

Creates an empty PDFDocument object in memory.

Auswertung

The PDFDocumentCreate function receives a path to determine the save location and file name where a new PDF file will be created. However, no PDF file will be created until subsequent steps are performed to insert or append pages and save the PDF file. PDFDocumentCreate will return a PDFDocument object that your script should then manipulate and save. A common scenario for using this function is the creation of a PDF map book. The steps typically involve exporting a number of separate PDF files from map documents, creating a new PDFDocument object, appending content from the exported PDF files and other documents, and saving the final PDF map book.

Please note that it is not possible to create blank PDF files, nor does the PDFDocumentCreate function add any blank pages to the document contents. For the saveAndClose method to successfully create a file, content must be added to the PDFDocument object using the appendPages or insertPages methods.

For more discussion on how to create map books, see the Building Map Books with ArcGIS help topic.

Syntax

PDFDocumentCreate (pdf_path)
ParameterErklärungDatentyp
pdf_path

A string that specifies the path and file name for the resulting PDF file when the saveAndClose method is called.

String

Codebeispiel

PDFDocumentCreate example

This script will create a new PDF document, append the contents of three separate PDF documents, and save the resulting PDF file.

import arcpy, os

#Set file name and remove if it already exists
pdfPath = r"C:\Project\ParcelAtlasMapBook.pdf"
if os.path.exists(pdfPath):
    os.remove(pdfPath)

#Create the file and append pages
pdfDoc = arcpy.mapping.PDFDocumentCreate(pdfPath)
pdfDoc.appendPages(r"C:\Project\Title.pdf")
pdfDoc.appendPages(r"C:\Project\ParcelAtlas.pdf")
pdfDoc.appendPages(r"C:\Project\ContactInfo.pdf")

#Commit changes and delete variable reference
pdfDoc.saveAndClose()
del pdfDoc

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS Plattform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2019 Esri. | Datenschutz | Rechtliches