Page 1 of 2

Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Thu Mar 22, 2012 1:01 pm
by 10049140
Hi.

I encountered an issue whith the fonts when printing with TeeChart Pro 2011 for Delphi XE2.

With Delphi 2010 the printed export looks as expected:
Image
With Delphi XE2 the fonts of the legend and the hints looks very strange:
Image

I use TChart.PrintPartial() for printing.

Is this a known issue?
Is there a fix or workaround for this?

Thanks for your help!

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Fri Mar 23, 2012 12:45 pm
by narcis
Hi marder,

This works fine for me here with Delphi XE2 using this code:

Code: Select all

uses VCLTee.Series, VCL.Printers;

procedure TForm2.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TPieSeries.Create(Self)).FillSampleValues;
  Chart1.Legend.Alignment:=laBottom
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Printer.Orientation:=poLandscape;
  Printer.BeginDoc;
  Chart1.PrintPartial(Rect(0,0,Printer.PageWidth,Printer.PageHeight));
  Printer.EndDoc;
end;
Which TeeChart version are you using? Does this occur with different printers?

Thanks in advance.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Fri Mar 23, 2012 1:51 pm
by 10049140
Hi Narcis,

I tried the code you send me, but this however leads to the same result.
When I use the code in a simple sample project with chart and pie series default settings, all works as expected :(
Anyway, the printing works correctly with Delphi 2010.

I will try to build a sample project including my settings were this issue occurs.
Contact you soon...

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Fri Mar 23, 2012 1:52 pm
by 10049140
P.S.: This issue is not specific for one printer. I tried with several printers.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Fri Mar 23, 2012 2:20 pm
by narcis
Hi marder,
When I use the code in a simple sample project with chart and pie series default settings, all works as expected :(
Thanks for the feedback.
I will try to build a sample project including my settings were this issue occurs.
Yes, please, that will help.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Fri Mar 23, 2012 2:46 pm
by 10049140
Hi Narcis.

I found the reason that causes this issue!

I am using TGDIPlusCanvas form unit VCLTee.TeeGDIPlus as Canvas for the chart.
Please add

Chart1.Canvas := TGDIPlusCanvas.Create;
to the OnCreate event of the main form to see this issue.

Note: I use TGDIPlusCanvas to prevent an issue with the Anti-Alias tools in TeeChart Pro 2011 which I reported before
(See: http://www.teechart.net/support/viewtop ... f=3&t=9180)

So what should I do now?
Do I have to decide between fancy chart in GUI or fancy chart in printed export :wink:

Thanks for your help!

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Fri Mar 23, 2012 3:11 pm
by narcis
Hi marder,

I don't get strange fonts as you did using the code you posted. What about antialiasing GDI+ canvas and font?

Code: Select all

procedure TForm2.FormCreate(Sender: TObject);
var g: TGDIPlusCanvas;
begin
  Chart1.AddSeries(TPieSeries.Create(Self)).FillSampleValues;
  Chart1.Legend.Alignment:=laBottom;
  g:=TGDIPlusCanvas.Create;
  g.AntiAlias:=True;
  g.AntiAliasText:=gpfBest;
  Chart1.Canvas := g;
end;
If the problem persists could you please let us know the exact TeeChart version you are using and attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Mon Mar 26, 2012 9:56 am
by 10049140
Dear Narcis.
I don't get strange fonts as you did using the code you posted.
Please take a look at the printed chart with common canvas:
Image
And here the printed chart with gdi+ canvas:
Image
The printed font in the hints and legend looks quite strange.
What about antialiasing GDI+ canvas and font?
In my version of TeeChart Pro "AntiAlias:=True" and "AntiAliasText:=gpfBest" are the default settings of TGDIPlusCanvas.
I see no effect when I set them again after creation.
If the problem persists could you please let us know the exact TeeChart version you are using
From the "Release.txt":
Release Notes 17th November 2011
TeeChart VCL version 2011
Build 2011.04.41118

and attach a simple example project we can run "as-is" to reproduce the problem here
Please find a sample project here
http://download.jam-software.de/treesiz ... tPrint.zip

Thanks for your help and best regards.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Mon Mar 26, 2012 10:25 am
by narcis
Dear marder,

Neither the images nor the examples project links are working. Could you please check them or attach the files in the forums?

Thanks in advance.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Mon Mar 26, 2012 11:17 am
by 10049140
Dear Narcis.

Sorry, the links are currently not available.
I attached the files to this post.

Thanks and best regards.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Mon Mar 26, 2012 11:59 am
by narcis
Hi marder,

Thanks for the files. I see, fonts could be much better with PrintPartial. I have added the issue (TV52016107) to the bug list. In the meantime, I recommend you to use StretchDraw as explained here. I checked this works fine with your project.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Mon Mar 26, 2012 3:08 pm
by 10049140
Dear Narcis.

Thanks for your help!
Using StrechDraw() with a bitmap seems to work better.

I'm currently trying to include this to my existing code, which is not that easy since there is some other stuff printed beside the chart.
I will contact you again if I need additional help.

Thanks and best regards.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Tue Mar 27, 2012 10:04 am
by 10049140
Dear Narcis.

Ok, I managed to bring text and chart (bitmap) together on one printed export.

Anyway, when using your workaround the resolution of the printed export is not as good as when using PrintPartial.
This is because, when generating the bitmap, we use the dimensions of the TChart component. For printing the dimensions of the printer are used, since we want to use the whole page.
In case of using the dimensions of the printer also for exporting the bitmap, the hints and the legend are shown unreadable small (See attachment).

Best regards.

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Wed Mar 28, 2012 1:28 pm
by yeray
Hi marder,

You could try to increase the marks and legend fonts before generating the image to be printed.
I'd also suggest you to take a look at the printing better article here

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Posted: Wed Nov 07, 2012 12:18 pm
by yeray
Hi,

We've just checked it with the actual v2012.07 and the example you posted above now seems to produce nice fonts, using PrintPartial and GDI+
Could you please give it a try?