' Copyright (c) 2021 ActivePDF, Inc. ' ActivePDF Toolkit 2018 ' Example generated 01/18/21 Dim FSO, strPath, intOpenInputFile, strFieldInfo, _ longFieldInfo, floatFieldInfo ' Get current path Set FSO = CreateObject("Scripting.FileSystemObject") strPath = FSO.GetFile(Wscript.ScriptFullName).ParentFolder & "\" Set FSO = Nothing ' Instantiate Object Set oTK = CreateObject("APToolkit.Object") ' Open the PDF to read from intOpenInputFile = oTK.OpenInputFile(strPath & "xmpfields.pdf") If intOpenInputFile <> 0 Then ErrorHandler "OpenInputFile", intOpenInputFile End If ' Get the reference to the XMP object Set oXMP = oTK.GetXMPManager() ' Get a field instances from the XMP data Set oXMPField = oXMP.GetXMPFieldInfo("name") ' Get field properties and write them out strFieldInfo = oXMPField.Name Wscript.Echo(strFieldInfo) strFieldInfo = oXMPField.Type Wscript.Echo(strFieldInfo) strFieldInfo = oXMPField.Value Wscript.Echo(strFieldInfo) longFieldInfo = oXMPField.Instance Wscript.Echo(longFieldInfo) longFieldInfo = oXMPField.PageNum Wscript.Echo(longFieldInfo) ' Bottom left of the field with the height and width floatFieldInfo = oXMPField.LLX Wscript.Echo(floatFieldInfo) floatFieldInfo = oXMPField.LLY Wscript.Echo(floatFieldInfo) floatFieldInfo = oXMPField.Width Wscript.Echo(floatFieldInfo) floatFieldInfo = oXMPField.Height Wscript.Echo(floatFieldInfo) ' Combo box or list box items list count ' count will be 0 for other field types longFieldInfo = oXMPField.ItemsSize Wscript.Echo(longFieldInfo) ' For options available to dropdown fields strFieldInfo = oXMPField.GetDisplayValue(1) Wscript.Echo(strFieldInfo) strFieldInfo = oXMPField.GetExportValue(1) Wscript.Echo(strFieldInfo) ' Release Object Set oXMPField = Nothing ' Release Object Set oXMP = Nothing ' Close the input file oTK.CloseInputFile ' Release Object Set oTK = Nothing ' Process Complete Wscript.Echo("Done!") ' Error Handling Sub ErrorHandler(method, outputCode) Wscript.Echo("Error in " & method & ": " & outputCode) End Sub