We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF containing tables & charts. Is this possible?

Thread ID:

Created:

Updated:

Platform:

Replies:

69538 Oct 31,2007 04:11 PM UTC Nov 2,2007 11:35 AM UTC General Discussion 1
loading
Tags: General Discussion
Ryan
Asked On October 31, 2007 04:11 PM UTC

I have to create a PDF that's auto-generated (on the web) daily. I've been auto-generating excel files using xlsIO for several months now but have no experience with any other products in the essential studio so I'm wondering if the type of PDF I need to auto-generate can be accomplished via essential studio.

The PDF is a combination of some basic text tables (as seen in "page 1" of my attached image) and charts (as seen in "page 2" of my attached image).

I was looking at "essential PDF" but it doesn't appear to be able to handle charts such as these. I was also looking at "essential Chart", and noticed it can be exported into a PDF but don't know if I can include my additional text tables into the same PDF file.

So can this type of PDF be accomplished using essential studio? I'll be using the latest version of essential studio and vs.net 2005.

Thanks.

Regards,
-Ryan


samplePDF.zip

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On November 2, 2007 11:35 AM UTC

Hi Ryan,

Thank you for your interests in Syncfusion products.

Yes, you can achieve the results which you are expecting with Syncfusion suite.

Here is the code to add Chart image, text and Table inside the PDF document,

//Create instance for PDF
PdfDocument pdfDoc = new PdfDocument();
//Add pages to the document
pdfDoc.Pages.Add();
pdfDoc.Pages[0].Graphics.DrawImage(PdfImage.FromFile(file), new RectangleF(10, 30, 200, 200));
pdfDoc.Pages[0].Graphics.DrawImage(PdfImage.FromFile(file1), new RectangleF(300, 30,200,200));
pdfDoc.Pages[0].Graphics.DrawImage(PdfImage.FromFile(file1), new RectangleF(10, 230, 200, 200));
pdfDoc.Pages[0].Graphics.DrawImage(PdfImage.FromFile(file), new RectangleF(300, 230, 200, 200));

PdfGraphics g = pdfDoc.Pages[0].Graphics;
//Create a solid
PdfSolidBrush brush = new PdfSolidBrush(Color.Black);
//Set the fontPdfFont
PdfStandardFont font = new PdfStandardFont(PdfFontFamily.Helvetica,12);
//Draw the text
g.DrawString("Exporting chart PDF!\nThe chart control can be exported into a PDF file as an image using Essential PDF. The chart control provides APIs to convert it to an image,\n while Essential PDF lets you insert this image into a Word Document file programatically.", font, brush,new PointF(10,500));
//Create the table
PdfLightTable table = new PdfLightTable();
string[,] array = CreateStringArray(4, 10, 10, 2);
table.DataSource = array;
PdfPage page = pdfDoc.Pages.Add();
//Draw the table inside the PDF document
PdfLayoutResult result = table.Draw(page, new Rectangle(0, 20,300,300));

Please download the sample from the below link for export the chart image to PDF with tables and text as it is in your screenshot

http://websamples.syncfusion.com/samples/PDF.Web/5.2.0.25/F69538_1/main.htm

Please let me know if you have any other queries.

Regards,
Fahad

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;