locked
How i can add a TextBox Value in a PDF header using iTextSharp? RRS feed

  • Question

  • User-1391509671 posted

    hi, How i can add a TextBox Value in a PDF header using iTextSharp?

    or a DropDownList value, etc.

    in my code i'm using

    public class pdfPage : iTextSharp.text.pdf.PdfPageEventHelper
    {
            public override void OnStartPage(PdfWriter writer, Document doc)   
            {}
    
            public override void OnEndPage(PdfWriter writer, Document doc)
            {}
    }
    

    Tuesday, July 14, 2015 7:01 PM

Answers

  • User-1391509671 posted

    thanks to Nan Yu, the answers will be like this.

    public class pdfPage : iTextSharp.text.pdf.PdfPageEventHelper
    {
            public string TextBoxValue{ get; set; }
            public override void OnStartPage(PdfWriter writer, Document doc)   
            {}
    
            public override void OnEndPage(PdfWriter writer, Document doc)
            {}
    }

    set value:

    //create an instance of your PDFpage class. This is the class we generated above.
    pdfPage page = new pdfPage();
    page.TextBoxValue = TextBox1.ToString();

    And in "OnStartPage" function ,you could get SelectValue by

    var value = TextBoxValue;

    Source: http://forums.asp.net/p/2059555/5941960.aspx?p=True&t=635731564787543437

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 22, 2015 10:17 AM