Skip to content

Instantly share code, notes, and snippets.

@tormodfj
Created January 15, 2014 14:58
Show Gist options
  • Select an option

  • Save tormodfj/8437770 to your computer and use it in GitHub Desktop.

Select an option

Save tormodfj/8437770 to your computer and use it in GitHub Desktop.
function Get-PdfFormData
{
param($file)
Add-Type -Path 'iTextSharp.dll'
$fileInfo = Get-ChildItem $file
$doc = New-Object iTextSharp.text.pdf.pdfreader -ArgumentList $fileInfo.FullName
$doc.AcroFields.Fields.Keys | % { New-Object PSObject -Property @{ Key = $_ ; Value = $doc.AcroFields.GetField($_) } } | ? Value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment