Skip to main content

Posts

Showing posts from July, 2013

How to Export WebPage with Images to PDF using iTextSharp in Ap.net(C#)

Default.aspx <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form id="form1" runat="server"> <div></div> <div><b>Export Webpage with images to pdf using itextsharp dll</b></div><br /> <div> <asp:GridView ID="gvDetails" AutoGenerateColumns="false" CellPadding="5" runat="server"> <Columns> <asp:BoundField HeaderText="UserId" DataField="UserId" /> <asp:BoundField HeaderText="UserName" DataField="UserName" /> <asp:BoundField HeaderText="Education" DataField="Education" /> <asp:BoundField HeaderText="Location" DataField="Location" /> </Columns> <HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White" /> </asp:G

How to convert Html page to a Image using WebBrowser in Asp.net

Thumbnail Image: public class Thumbnail {     public string Url { get; set; }     public Bitmap ThumbnailImage { get; set; }     public int Width { get; set; }     public int Height { get; set; }     public int BrowserWidth { get; set; }     public int BrowserHeight { get; set; }     public Thumbnail(string Url, int BrowserWidth, int BrowserHeight, int ThumbnailWidth, int ThumbnailHeight)     {         this.Url = Url;         this.BrowserWidth = BrowserWidth;         this.BrowserHeight = BrowserHeight;         this.Height = ThumbnailHeight;         this.Width = ThumbnailWidth;     }     public Bitmap GenerateThumbnail()     {         Thread thread = new Thread(new ThreadStart(GenerateThumbnailInteral));         thread.SetApartmentState(ApartmentState.STA);         thread.Start();         thread.Join();         return ThumbnailImage;     }     private void GenerateThumbnailInteral()     {         WebBrowser webBrowser = new WebBrowser();         webBrowser