Itextsharp - use in foreach

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
    }
}

Have you installed all prerequisits?

Yes, If I use only one file no problem (without foreach)

Is this the complete error message you posted?

Complet error:
Save-PdfField : Cannot find type [iTextSharp.text.pdf.PdfReader]: verify that the assembly containing this type is loaded.
At C:\Users\user\Documents\script\powershell\test2.ps1:26 char:17

  •             Save-PdfField @parameters
    
    • CategoryInfo : InvalidType: (:slight_smile: [Save-PdfField], PSArgumentException
    • FullyQualifiedErrorId : TypeNotFound,Save-PdfField

Actually I don’t know what to say. I cannot reproduce because I don’t have appropriate PDF files and the library you’re referencing is not supported anymore. And it seems like there is more code in your script than you show here (Error "At C:\Users\user\Documents\script\powershell\test2.ps1:26 char:17")
Sorry