Exporting ArcGIS Metadata as PDF using ArcPy?

@dvdhns suggestions, are what you should do.

However you don't need to write a xslt for html conversion because Esri has done this for you. see this code snippet:

import arcpy
from arcpy import env
env.workspace = "C:/data"
#set local variables
dir = arcpy.GetInstallInfo("desktop")["InstallDir"]
xslt = dir + "Metadata/Stylesheets/ArcGIS.xsl"
arcpy.XSLTransform_conversion("vegetation", xslt, "vegetation.html", "#")

This code converts your table/Layer metadata directly to html. (You don't need to convert it to a standalone xml file)

Afterward, use this python library to convert formatted HTMLs to pdf.


No. You cannot directly export ESRI Feature Class metadata into PDF files.

This is how I would attempt to do it using python, rather than ArcObjects:

  1. Use arcpy to export the metadata to xml files.
  2. Use python and xslt (xml style sheets) to format the xml files into something human readable, my recommendation is a simply formated txt or html file.
  3. Use a python PDF library to convert the txt or html file you just created into a PDF.