TeeChart Export PDF format

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jkath
Newbie
Newbie
Posts: 2
Joined: Wed Aug 10, 2016 12:00 am
Contact:

TeeChart Export PDF format

Post by jkath » Wed Aug 10, 2016 11:32 pm

When I attempt to export teechart as PDF issues are arising. Using The latest version of TeeChartNET2016_4.1.2016.05120

Here is what my code looks like on the backend c-sharp:

Steema.TeeChart.Export.PDFFormat pdfFormat = chart.Export.Image.PDF;
pdfFormat.Width = chartWidth;
pdfFormat.Height = chartHeight;
pdfFormat.Save(filePath);

For other formats all is working well (jpeg, png, gif, png, bmp). However, with the pdf export above a blank pdf doc is produced. Pdf doc can be opened it is simply a blank page.

Thanks for any advice here,

John

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart Export PDF format

Post by Sandra » Thu Aug 11, 2016 12:12 pm

Hello John

Seems is necessary redraw the Chart before export to Pdf format. The code below shows you how can do that:

Code: Select all

            private void InitializeChart()
        {


            // Load the ArrayLists that have been processed
            fastLineSeries1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);

            fastLineSeries1.Clear();
            fastLineSeries1.FillSampleValues(100);
            tChart1.Header.Lines = new string[] { "Second Curve: ILD" };

            this.tChart1.Zoom.Direction = Steema.TeeChart.ZoomDirections.None;
            this.tChart1.Axes.Left.Logarithmic = true;
            this.tChart1.Axes.Bottom.SetMinMax(0.01, 10);
            tChart1.Draw();
            Steema.TeeChart.Export.PDFFormat pdfFormat = tChart1.Export.Image.PDF;
            pdfFormat.Width = tChart1.Width;
            pdfFormat.Height = tChart1.Height;
            pdfFormat.Save("TestImage.pdf");
        }
Hoping this helps you.
Thanks in advance
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply