Summary
Exports an existing PDF file to a Tagged Image File Format (TIFF). If the PDF has georeference information, the TIFF can be a GeoTIFF. These TIFFs can be used as a source for heads-up digitizing and viewing in ArcMap. Both GeoPDF and ISO standards of georeferenced PDFs are supported.
Usage
If the PDF consists of more than one page, PDF Page Number lists the pages in the PDF. You will get an error if you try to enter an invalid page number.
PDF Page Number can only be one page; it cannot be a range of pages.
If the PDF doesn't contain a spatial reference, PDF Map and Write GeoTIFF Tags are disabled.
3D GeoPDF version 1.0 is not supported. The tool will output a TIFF but it may not be georeferenced.
Syntax
arcpy.conversion.PDFToTIFF(in_pdf_file, out_tiff_file, {pdf_password}, {pdf_page_number}, {pdf_map}, {clip_option}, {resolution}, {color_mode}, {tiff_compression}, {geotiff_tags})
Parameter | Explanation | Data Type |
in_pdf_file | The path and name of the PDF file that is going to be converted into a TIFF. | File |
out_tiff_file | The path and name of the output TIFF file. | Raster Dataset |
pdf_password (Optional) | If the PDF is password protected the tool requires an appropriate password for processing. Different passwords can be provided based on the security setting embedded in the PDF. If the PDF is protected by restricting access to
| Encrypted String |
pdf_page_number (Optional) | The page number containing the content you want to export to TIFF. You can only enter one page, not a range of pages. | Long |
pdf_map (Optional) | In a PDF file, a map is a defined container of graphics on the PDF page that has a spatial reference. A PDF map is equivalent to an ArcMap data frame in that it is the container for spatial data. A PDF may have one or more maps. For example, a page may have a main map and an additional smaller overview or key map. The PDF Map is used for setting the output spatial reference of the TIFF, if the Write GeoTIFF Tags setting is enabled. The PDF Map is also used to define the extent of the output TIFF, if the Clip Output to Map option is enabled. You can specify the map you wish to use by name. You can also use LARGEST to use the largest map in the PDF. This will also be the default if the parameter is not specified. | String |
clip_option (Optional) |
Specifies what should be clipped/extracted.
| Boolean |
resolution (Optional) | A number that defines the resolution of the exported TIFF in DPI (dots per inch). The default is 250. | Long |
color_mode (Optional) | This value specifies the number of bits used to describe color. The default is RGB_TRUE_COLOR.
| String |
tiff_compression (Optional) | The compression scheme for the output TIFF. The default is LZW.
| String |
geotiff_tags (Optional) | If the PDF contains a spatial reference, you can choose to add GeoTIFF tags.
| Boolean |
Code sample
PDFToTIFF example 1 (Python window)
This sample runs the required parameters using ISO PDF.
import arcpy
#Define variables
inPDF = r'C:\Project\export.pdf'
outTIFF = r'C:\Project\export.tif'
#Export PDF to GeoTIFF
arcpy.PDFToTIFF_conversion(inPDF, outTIFF)
PDFToTIFF example 2 (stand-alone script)
This sample loops through each page of a multipage OGC PDF, exports each page with some optional parameters set, and finally builds pyramids and calculates statistics on each TIFF.
import arcpy
import os
# Define variables
inPDF = r'C:\Project\OGC_DDP.pdf'
outTIFF = r'C:\Project\TIFFs'
# Create PDFDocument Object from inPDF
pdf = arcpy.mapping.PDFDocumentOpen(inPDF)
# Loop through each page in the PDF and create a name based on the page number
for page in range(1, pdf.pageCount+1):
name = str(page) + ".tif"
outTIFFpath = os.path.join(outTIFF, name)
# Export each page to TIFF using 96 DPI, CMYK color mode, and JPEG compression
arcpy.PDFToTIFF_conversion(inPDF, outTIFFpath, '#', str(page), '#', '#', 96, 'CMYK_TRUE_COLOR', 'JPEG')
# Build pyramids and calculate statistics on each output TIFF
arcpy.BuildPyramidsandStatistics_management(outTIFF)
print "Exported " + outTIFFpath
print "Done"
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes