Convert Webpage to PDF

Posted by Venkat | Labels: ,

How to Convert the webpage to PDF. There is a question asked in forums by most of the members.

Here the some methods that will be help you.

There are number of ways to do...,

1) using ITextSharp

2) Make the webpage as Image and add it to PDF ( proposed by Charith - Thanks anyway)

Check the forums discussion here

3) Using some online tool like this HTML to PDF

4) If the User want a link on the webpage so if the user click the link , current page is converted to PDF.

Check this:  http://www.pdfspot.com/

Thanks

Post Method - Example Code

Posted by Venkat | Labels: ,

Here I am going show : how to post the data from one page to another page using POST Method.

Here is the Simple example.

P1.aspx


   <form id="form1" runat="server" method ="post" action ="p2.aspx">
    <div>
    User : <asp:TextBox ID="txtName" runat="server"></asp:TextBox><br/>
        Password : <asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>

        <asp:Button ID="btnSend" runat="server" Text="Send"  PostBackUrl ="~/p2.aspx" /> 
    </div>
    </form>



So if you are going to use post method on form tag set method="post" and action="p2.aspx" ie: designation url to get the data of p1.aspx on p2.aspx.

P2.aspx


 <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    </div>
    </form>





protected void Page_Load(object sender, EventArgs e)
    {
        TextBox1.Text = Request.Form["txtName"].ToString ();
        TextBox2.Text = Request.Form["txtPassword"].ToString ();
    }


Finally on destination page

using Request.Form["yourcontrolid"] to get value of the control on p1.aspx

PayOffers.in