Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

deepikakhorana

@deepikakhorana
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Exporting Asp.Net page to PDF file
    D deepikakhorana

    Hi Raheem You need to create one page named preview and render only those things which u need to export on that page (if it is a chart then only render chart on that page) and then try that code. at the time of export just redirect to the export page(another page which will run the bitmap and web browser code) which will do the stuff for you and then call the preview page in url then it will export only charts etc. Thanks Deepika

    ASP.NET csharp asp-net question

  • Exporting Asp.Net page to PDF file
    D deepikakhorana

    Hi Raheem The procedure is step1:render the page through asp.net code in a web browser, this will return a bitmap public System.Drawing.Bitmap CaptureWebPage(string URL) { // create a hidden web browser, which will navigate to the page System.Windows.Forms.WebBrowser web = new System.Windows.Forms.WebBrowser(); web.ScrollBarsEnabled = false; // we don't want scrollbars on our image web.ScriptErrorsSuppressed = true; // don't let any errors shine through web.Navigate(URL); // let's load up that page! // wait until the page is fully loaded while (web.ReadyState != System.Windows.Forms.WebBrowserReadyState.Complete) System.Windows.Forms.Application.DoEvents(); System.Threading.Thread.Sleep(1500); // allow time for page scripts to update // the appearance of the page // set the size of our web browser to be the same size as the page int width = web.Document.Body.ScrollRectangle.Width; int height = web.Document.Body.ScrollRectangle.Height; web.Width = width; web.Height = height; // a bitmap that we will draw to System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(width, height); // draw the web browser to the bitmap web.DrawToBitmap(bmp, new System.Drawing.Rectangle(0, 0, width, height)); return bmp; // return the bitmap for processing } Step 2: and then save this as PDF

    ASP.NET csharp asp-net question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups