Export a chart in a PDF file

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ACDTOURS
Newbie
Newbie
Posts: 6
Joined: Wed Jun 12, 2013 12:00 am

Export a chart in a PDF file

Post by ACDTOURS » Tue Jul 02, 2013 12:54 pm

Hello,

I get the following output when I try to export to PDF, a graph with the gradient property enabled

I use a pie chart, and for each part of the pie, a colored square appears.

These squares are not seen during the preview that presents a correct result.

I tried to change the options on the component, but without any success.

I hope someone can help me.

best regards

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Export a chart in a PDF file

Post by Yeray » Tue Jul 02, 2013 2:24 pm

Hi,

Could you please show us some screenshots and even better, could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

As an alternative to the exportation to pdf TeeChart integrates, you could try to export your chart as an image and use a virtual pdf printer to get the pdf from it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ACDTOURS
Newbie
Newbie
Posts: 6
Joined: Wed Jun 12, 2013 12:00 am

Re: Export a chart in a PDF file

Post by ACDTOURS » Wed Jul 03, 2013 8:03 am

Here is the result in the preview

Image

And the result when exporting pdf
Image

It is extremely difficult for me to give you a simple example program.

We are working on a project whose sources are interconnected and therefore difficult fragmentable

I hope these screenshots will help you ...

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Export a chart in a PDF file

Post by Yeray » Thu Jul 04, 2013 10:20 am

Hi,

Are you using the latest version v2013.08?
I've made a simple example to try to reproduce it. Just place a Chart and two buttons in a form; and use the following code:

Code: Select all

uses TeePDFCanvas, TeExport;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Legend.Visible:=false;

  for i:=0 to 3 do
    with Chart1.AddSeries(TPieSeries) do
    begin
      FillSampleValues;
      Marks.Visible:=false;
    end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  TeeExport(Self, Chart1);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  TeeSaveToPDFFile(Chart1, 'C:\tmp\test.pdf');
end;
Then you have three ways to create a pdf:
- Click button1 to show the Export dialog. Select "as PDF" Format in the "Export\Picture" tab. Click the "Preview" button.
- Click button1 to show the Export dialog. Select "as PDF" Format in the "Export\Picture" tab. Click the "Save" button. Give a name to create the pdf file.
- Click button2.

I get a correct pdf following any of the three ways:
2013-07-04_1220.png
2013-07-04_1220.png (45.75 KiB) Viewed 11028 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ACDTOURS
Newbie
Newbie
Posts: 6
Joined: Wed Jun 12, 2013 12:00 am

Re: Export a chart in a PDF file

Post by ACDTOURS » Thu Jul 04, 2013 1:38 pm

At first, thank you for your reply.

I tried the code you provide for me and ... it works.

However, it seems to persist a little problem.

I changed the options TChart (adding a ChartEditor and throwing on the double click of TChart).

I then changed the Gradient property to make it visible

The result of the component is as expected

Image

The preview bmp and its export is correct.

Image

The preview metafile and its export is also correct.

Image

But when exporting to PDF format, you lose the concept of gradient.
Image

Do you have any idea?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Export a chart in a PDF file

Post by Yeray » Thu Jul 04, 2013 1:55 pm

Hi,

I'm afraid the gradients aren't exported to pdf. This is an enhancement already present in the wish list to be implemented in future releases (TV52016633).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ACDTOURS
Newbie
Newbie
Posts: 6
Joined: Wed Jun 12, 2013 12:00 am

Re: Export a chart in a PDF file

Post by ACDTOURS » Thu Jul 04, 2013 2:40 pm

OK thank you for all your replies.

ACDTOURS
Newbie
Newbie
Posts: 6
Joined: Wed Jun 12, 2013 12:00 am

Re: Export a chart in a PDF file

Post by ACDTOURS » Thu Jul 04, 2013 2:56 pm

One last thing.

Do you have an approximate date for this release ?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Export a chart in a PDF file

Post by Yeray » Thu Jul 04, 2013 3:29 pm

Hi,

No, I can't tell you a date for it to be implemented.
In the meanwhile, have you tried the alternative suggested above, using a virtual printer?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ACDTOURS
Newbie
Newbie
Posts: 6
Joined: Wed Jun 12, 2013 12:00 am

Re: Export a chart in a PDF file

Post by ACDTOURS » Mon Jul 08, 2013 1:24 pm

It will be difficult but we'll see.

Thank you for the time spent helping me.

Post Reply