Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
How to use pdf title in Listbox ? I'm looking for an example. I can use ..
Posted
Comments
Sergey Alexandrovich Kryukov 15-Aug-14 3:59am    
Example of what? what use? what do you mean by ListBox? which one? Full type name, please.
—SA
Member 10992416 15-Aug-14 4:14am    
for example string path = "C:\1.pdf";
listBox1.Items.Clear();
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] rgFiles = di.GetFiles();
how to get pdf title add ListBox ?

1 solution

You could use iTextSharp[^] to do this.
string pattern = @"C:\*.pdf";
listBox1.Items.Clear();
foreach (string filename in Directory.GetFiles (pattern)) {
    PdfReader r = new PdfReader (filename);
    listBox1.Items.Add (reader.Info["Title"]);
}
/ravi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900