Page 1 of 1
Export a chart in a PDF file
Posted: Tue Jul 02, 2013 12:54 pm
by 16566227
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
Re: Export a chart in a PDF file
Posted: Tue Jul 02, 2013 2:24 pm
by yeray
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.
Re: Export a chart in a PDF file
Posted: Wed Jul 03, 2013 8:03 am
by 16566227
Here is the result in the preview
And the result when exporting pdf
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 ...
Re: Export a chart in a PDF file
Posted: Thu Jul 04, 2013 10:20 am
by yeray
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 (45.75 KiB) Viewed 11026 times
Re: Export a chart in a PDF file
Posted: Thu Jul 04, 2013 1:38 pm
by 16566227
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
The preview bmp and its export is correct.
The preview metafile and its export is also correct.
But when exporting to PDF format, you lose the concept of gradient.
Do you have any idea?
Re: Export a chart in a PDF file
Posted: Thu Jul 04, 2013 1:55 pm
by yeray
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).
Re: Export a chart in a PDF file
Posted: Thu Jul 04, 2013 2:40 pm
by 16566227
OK thank you for all your replies.
Re: Export a chart in a PDF file
Posted: Thu Jul 04, 2013 2:56 pm
by 16566227
One last thing.
Do you have an approximate date for this release ?
Re: Export a chart in a PDF file
Posted: Thu Jul 04, 2013 3:29 pm
by yeray
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?
Re: Export a chart in a PDF file
Posted: Mon Jul 08, 2013 1:24 pm
by 16566227
It will be difficult but we'll see.
Thank you for the time spent helping me.