Tuesday, May 06, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Friday, December 16, 2011

Export fusion charts as images and add to pdf file with text


Export fusion charts as images and add to pdf file with text

string fileName = "fusionchart/pdf.png";
ServerSideImageHandler ssh = new ServerSideImageHandler(Server.MapPath("fusionchart/MSCombi2D.swf"), 500, 400, "", Server.MapPath("xmlschemas/XmlData.xml"), Server.MapPath(fileName));
ssh.BeginCapture();
string pdfpath = Server.MapPath("fusionchart/FusionCharts.pdf");
string imagepath = Server.MapPath("fusionchart/pdf.png");
Document doc = new Document();
try
{
PdfWriter.GetInstance(doc, new FileStream(pdfpath, FileMode.Create));
doc.Open();
doc.Add(new Paragraph("GIF"));
iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(imagepath);
doc.Add(gif);
}
catch (DocumentException dex)
{
Response.Write(dex.Message);
}
catch (IOException ioex)
{
Response.Write(ioex.Message);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
finally
{
doc.Close();
}

3 comments :

  1. ServerSideImageHandler error

    ReplyDelete
  2. Hi I have used above code but getting ServerSideImageHandler error, so please kindly help me out.

    ReplyDelete
  3. Hi I have used above code but getting ServerSideImageHandler error, so please kindly help me out.

    ReplyDelete

Contact Us

Name

Email *

Message *