Re: Html to PDF with page break

  •  05-17-2007, 8:00 AM

    Re: Html to PDF with page break

    The initial post is old, but try this :

    HttpContext
    .Current.Response.ClearContent();
    HttpContext.Current.Response.ClearHeaders();
    HttpContext.Current.Response.ContentType = "application/pdf";
    HttpContext.Current.Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
     
    System.IO.MemoryStream stmMemory = new System.IO.MemoryStream();
     

    CuteEditor.Convertor.PDF.HTML2PDF convertor = new CuteEditor.Convertor.PDF.HTML2PDF(Server.HtmlDecode(this.RTE.XHTML));

    convertor.RenderSinglePageContent = false;
    convertor.Render();

    convertor.Save(stmMemory);
     

    stmMemory.WriteTo(HttpContext.Current.Response.OutputStream);
    stmMemory.Close();
    stmMemory.Dispose();

    Response.End();
View Complete Thread