Page 1 of 1

TeeChart Export PDF format

Posted: Wed Aug 10, 2016 11:32 pm
by 15678906
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

Re: TeeChart Export PDF format

Posted: Thu Aug 11, 2016 12:12 pm
by 10050769
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