You must Sign In to post a response.
  • Category: Sharepoint

    Convert hyperliks from a pdf document to a word document ?


    am facing a problem is am try try to convert a pdf document to aword document. it working fine, but if a pdf document having a hyperlink it dosent convert into a hyperlink format it is convert simply text format please help me fast...
    below is my code.

    private void button1_Click(object sender, EventArgs e)
    OpenFileDialog dlg = new OpenFileDialog();
    string filepath;
    dlg.Filter = "PDF Files(*.PDF)|*.PDF|All Files (*.*)|*.*";
    if (dlg.ShowDialog() == DialogResult.OK)

    filepath = dlg.FileName.ToString();

    string strtext = string.Empty;
    PdfReader reader = new PdfReader(filepath);
    for (int page = 1; page <= reader.NumberOfPages; page++)
    //PdfDictionary PageDictionary = reader.GetPageN(page);
    //PdfArray Annots = PageDictionary.GetAsArray(PdfName.ANNOTS);
    ////var Links =Annots
    ITextExtractionStrategy its = new iTextSharp.text.pdf.parser.LocationTextExtractionStrategy();
    string s = PdfTextExtractor.GetTextFromPage(reader, page, its);
    s = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(s)));
    strtext = strtext + s;
    richTextBox1.Text = strtext;
    catch (Exception ex)

    StreamWriter File = new StreamWriter("E://testing//" + dlg.SafeFileName + DateTime.Now.Millisecond + ".doc" + "");


    Thanks in advance,
  • #737764
    Does your hyperlink in pdf has got complete URL? As per my understanding by default if you have full URL it will show as hyperlink.
    Can you show us the hyperlink you are trying to convert in your pdf file?

    Asheej T K

  • #737803
    Thanks Asheej T k this is the url(in Hyperlink Format) in pdf. ok if i try to convert into word document it is like (simple text fromat)
    ok did you got it or do you want any clarification i will explain once again but its very urgent ple help me fast

    Thanks in Advance

  • #738895
    I got solution for this senario is here we cant convert the hyperlinks to a txt file in a hyperlink format because txt document dosent accepts hyplinks it accepts only simple text.

    Any how thank you all for supporting me on this thread finally i achive this

  • Sign In to post your comments