Hello,
I use this script Creating a PDF Form Filler via Automated Script. I have problem with used in foreach - return error Save-PdfField : Cannot find type [iTextSharp.text.pdf.PdfReader]: verify that the assembly containing this type is loaded. Can I help me, please? Thank you.
This is my script
foreach($line in Get-Content $saveFileLog) {
if($line -match $regex){
$data = $line.Split(';')
$firstname = $data[0]
$surname = $data[1]
$parameters = @{
Fields = @{
'Firstname' = $firstname;
'Surname' = $surname
}
InputPdfFilePath = 'c:\pdf\input.pdf'
ITextSharpLibrary = 'c:\pdf\modules\itextsharp.dll'
OutputPdfFilePath = 'c:\pdf\'+ $surname +'.pdf'
}
Save-PdfField @parameters
}
}