Posts

Showing posts from January 16, 2014

Reading a pdf Document and extracting the hyperlinks and and save it as a.csv file

 string FileName = string.Empty;             string FilePath = string.Empty;             string FileType = string.Empty;             string LinkLable = string.Empty;             string LinkURL = string.Empty;             int pagenumber;             OpenFileDialog dlg = new OpenFileDialog();             string filepath;             dlg.Filter = "PDF Files(*.PDF)|*.PDF|All Files (*.*)|*.*";             if (dlg.ShowDialog() == DialogResult.OK)             {                 //// need to global verable to store file name and file path                 filepath = dlg.FileName.ToString();                 ////String sourceFileName = "D:\\reader2.pdf";                 //Setup some variables to be used later                 PdfReader R = default(PdfReader);                 int PageCount = 0;                 PdfDictionary PageDictionary = default(PdfDictionary);                 PdfArray Annots = default(PdfArray);                 //Open our reader