Hi I have a C# code snippet which would assign title to the pdf file.But I am trying to do the same for each and every pdf files in a directory.Can any one help me...?
Following is the code snippet " PdfReader pdfReader = new PdfReader(filePath); using (FileStream fileStream = new FileStream(newFilePath, FileMode.Create, FileAccess.Write)) { string title = pdfReader.Info["Title"] as string; Trace.WriteLine("Existing title: " + title);
PdfStamper pdfStamper = new PdfStamper(pdfReader, fileStream);
Hashtable newInfo = pdfReader.Info;
newInfo["Title"] = "New title";
pdfStamper.MoreInfo = newInfo;
pdfReader.Close();
pdfStamper.Close();
}
"