Very long canvas - print fail

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
athely
Newbie
Newbie
Posts: 10
Joined: Mon Mar 13, 2017 12:00 am

Very long canvas - print fail

Post by athely » Wed Nov 15, 2017 10:28 am

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
Attachments
TestTChartLongCanvas.zip
(11.59 KiB) Downloaded 1772 times

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

Re: Very long canvas - print fail

Post by Yeray » Wed Nov 15, 2017 2:25 pm

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 1798 times
Could you please try it with the latest version?
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

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Very long canvas - print fail

Post by odaumas » Wed May 06, 2020 12:34 pm

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.

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

Re: Very long canvas - print fail

Post by Yeray » Mon May 18, 2020 7:32 am

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 1626 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

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Very long canvas - print fail

Post by odaumas » Mon May 18, 2020 12:52 pm

Thanks for your reply Yeray.
Some thing's weird.
When I launch your attachment with Acrobat reader 2020.009.20063 .
The printing looks failed.

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Very long canvas - print fail

Post by odaumas » Tue May 19, 2020 8:03 am

Sorry, screen shot forgotten .
Attachments
Print.png
Print.png (16.57 KiB) Viewed 38086 times

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

Re: Very long canvas - print fail

Post by Yeray » Fri May 22, 2020 5:53 am

Hello,

I could reproduce that and it seems like a problem with the metafile generation.
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

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Very long canvas - print fail

Post by odaumas » Wed Jun 10, 2020 4:51 pm

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.

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Very long canvas - print fail

Post by Marc » Mon Jun 15, 2020 4:52 pm

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
Steema Support

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Very long canvas - print fail

Post by odaumas » Wed Jun 17, 2020 8:38 am

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.
Attachments
TestTChartLongCanvas_V2018-26.zip
(224.17 KiB) Downloaded 1606 times
TestTChartLongCanvas_V2018-24.zip
(225.75 KiB) Downloaded 1589 times

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Very long canvas - print fail

Post by Marc » Tue Jun 23, 2020 10:39 am

Hello,

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

Regards,
Marc

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Very long canvas - print fail

Post by odaumas » Tue Jul 21, 2020 9:27 am

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 :(
Attachments
MetaFiles.zip
(338 Bytes) Downloaded 1499 times

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Very long canvas - print fail

Post by Marc » Fri Jul 24, 2020 8:40 am

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
Steema Support

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Very long canvas - print fail

Post by Marc » Fri Jul 24, 2020 9:40 am

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

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

Re: Very long canvas - print fail

Post by Yeray » Fri Jul 24, 2020 10:52 am

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;
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

Post Reply