Page 1 of 2

Very long canvas - print fail

Posted: Wed Nov 15, 2017 10:28 am
by 16580506
Hi,

I have a problem when i want to print (in pdf throught PDFCreator in attachement) a chart with a very big height.
I use TeeCreateMetafile after having resize chart canvas with requested big height.
Then I use Printer.Canvas.StretchDraw to draw on pdf canvas.
In attached example, we can see that problem occurs on page 34.

Problem is that serie plot seems to be blocked at a certain Y, like if there is a limitation.
I use Delphi 2009 and TeeChart 8.08.

Thanks for your help

Anthony

Re: Very long canvas - print fail

Posted: Wed Nov 15, 2017 2:25 pm
by yeray
Hello Anthony,

It seems to work fine with TeeChart v2017.22, RAD XE and PdfCreator v2.5.2:
TestTChartLongCanvas__2017-11-15_15h20.zip
(225.98 KiB) Downloaded 471 times
Could you please try it with the latest version?

Re: Very long canvas - print fail

Posted: Wed May 06, 2020 12:34 pm
by 16588166
Hello everyone.
Back to this problem.
Printing fails again using version V2020.29.200113 and PDFCreator 2.4.1 neither with PDFCreator 4.0.4.
Any idea ?

Thanks for your help.

Re: Very long canvas - print fail

Posted: Mon May 18, 2020 7:32 am
by yeray
Hello,

It isn't failing for me with RAD Rio 10.3.3, TeeChart Pro v2020.29 and PDFCreator 4.0.4:
TestTChartLongCanvas__2020-05-18_09h30.zip
(224.19 KiB) Downloaded 412 times

Re: Very long canvas - print fail

Posted: Mon May 18, 2020 12:52 pm
by 16588166
Thanks for your reply Yeray.
Some thing's weird.
When I launch your attachment with Acrobat reader 2020.009.20063 .
The printing looks failed.

Re: Very long canvas - print fail

Posted: Tue May 19, 2020 8:03 am
by 16588166
Sorry, screen shot forgotten .

Re: Very long canvas - print fail

Posted: Fri May 22, 2020 5:53 am
by yeray
Hello,

I could reproduce that and it seems like a problem with the metafile generation.

Re: Very long canvas - print fail

Posted: Wed Jun 10, 2020 4:51 pm
by 16588166
Hello Yeray,

So, how can i fix it ?
Is this an internal TChart problem ?
If so, can we expect a patch ?

Thank you for your help.

Re: Very long canvas - print fail

Posted: Mon Jun 15, 2020 4:52 pm
by Marc
Hello,

This appears to be a size limit for a Windows Metafile of 32767 pixels.

Ref.
https://stackoverflow.com/questions/342 ... -metafiles

If the test is run at 33 pages a metafile of 1036x31317 pixels is created. It appears that one page more tips the file over the size limit.

Regards,
Marc Meumann

Re: Very long canvas - print fail

Posted: Wed Jun 17, 2020 8:38 am
by 16588166
Hello Marc,
Thank you for your investigation. It's interesting.

However we had already seen that it worked properly.

So, back to the 2018-24 version, we can see that it works well.
Then, I couldn't install 2018-25 version, cause the recompilation does not work,
then, after installation of the 2018-26 version, we can see that the problem of the canvas reappears.

Regards.

Re: Very long canvas - print fail

Posted: Tue Jun 23, 2020 10:39 am
by Marc
Hello,

If you export to metafile in both cases there may be a clue to the different behaviour.

Regards,
Marc

Re: Very long canvas - print fail

Posted: Tue Jul 21, 2020 9:27 am
by 16588166
Hi Marc,
Here are the two metafiles created with v24 and v30.
No difference was found.
Then I checked StretchDraw procedure in each v24 and v30, saw no difference.

What a mystery :(

Re: Very long canvas - print fail

Posted: Fri Jul 24, 2020 8:40 am
by Marc
Hello,

The metafiles don't seem to have saved correctly in the zip you posted, but we'll take another look at this to see if we can shed any light. With the current version of TeeChart the plot cuts the last data points in the metafile at exactly 32,767 pixels, the known limit for a metafile. The canvas continues to plot gridlines to the required size limit though (33,000+ pixels), that raises suspicions that some other factor is involved. I don't see any obvious cause, the TeeChart code relating to metafile generation hasn't changed for a very long time, but we will go through it again.

Regards,
Marc

Re: Very long canvas - print fail

Posted: Fri Jul 24, 2020 9:40 am
by Marc
Hi,

Found it. There is a maximum pixel limitation setting in TeeChart, used to control out-of-bound axis calculations, that we'll need to review. It's currently set to $7FFF (decimal 32767).

Whilst we check what to do, if you have the sourcecode version you can modify it as an interim workaround:

ie.
TeEngine.pas

In the initialization section at the end of the unit:

TeeMaxPixelPos:=$7FFF;

change to: (for example)

TeeMaxPixelPos:=34000;

We'll probably need to change this to an accessible variable so that it can adjust to unusual circumstances such as the case here in hand.

Sorry for the delay in finding this.

Regards,
Marc

Re: Very long canvas - print fail

Posted: Fri Jul 24, 2020 10:52 am
by yeray
Hello,

I've moved the TeeMaxPixelPos variable to interface section so from the next version you'd be able to set it as follows:

Code: Select all

  VCLTee.TeEngine.TeeMaxPixelPos:=34000;