Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ScaleToPage print options (Read 6236 times)
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 84
Joined: Jun 12th, 2007
ScaleToPage print options
Apr 25th, 2018 at 10:15am
Print Post  
Hello,

I have a problem with the ScaleToPage print option.
If the diagram is little, it works, but when it is a big diagram, it does not work.

Is there a limit ?
My diagram zipped takes 650kb so I can't sent it to you.

How do I know if the diagram can fits in one page?

Best regards
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2163
Joined: Oct 19th, 2005
Re: ScaleToPage print options
Reply #1 - Apr 25th, 2018 at 11:37am
Print Post  
Hi,

What are your diagram's top/left/right/bottom boundaries and MeasureUnit?

Regards,
Slavcho
  
Back to top
 
IP Logged
 
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 84
Joined: Jun 12th, 2007
Re: ScaleToPage print options
Reply #2 - Apr 25th, 2018 at 12:32pm
Print Post  
Hi,

Measureunit = 2 (pixel)

top = 0
bottom = 24359
left = 0
right = 157213

Regards

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2163
Joined: Oct 19th, 2005
Re: ScaleToPage print options
Reply #3 - Apr 26th, 2018 at 8:06am
Print Post  
Hi,

Code
Select All
fcx.MeasureUnit = uPixel
fcx.SetDocSize 0, 0, 157213, 24359
fcx.PrintOptions.ScaleToPage
 



above fits it on a single page in my test -


ScaleToPage only calculates a current PrintOptions.ScaleFactor value and does not update it automatically later, so maybe check if the diagram size isn't growing at some point after you call the method.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 84
Joined: Jun 12th, 2007
Re: ScaleToPage print options
Reply #4 - Apr 26th, 2018 at 8:14am
Print Post  
Hi,

The diagram does not grow.
I saved my graph with tour SaveToFile method.
When I load this file in you run demo application, I have the same problem when i click in Fit Page in the Print preview window.

Regards

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2163
Joined: Oct 19th, 2005
Re: ScaleToPage print options
Reply #5 - Apr 26th, 2018 at 10:28am
Print Post  
What's your printer's default paper size?
  
Back to top
 
IP Logged
 
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 84
Joined: Jun 12th, 2007
Re: ScaleToPage print options
Reply #6 - Apr 26th, 2018 at 10:34am
Print Post  
A4.

If I put the A0 format. It works.

I know that the display will be ugly, but the user will see that the printing of this graph in a single page will not be exploitable.
In fact, the problem is that the function does not work for large graphs. The graph remains the same as before fitting the page.
I would like to show him an error message if it's not good.

Here are the 3 files (remove .txt at the end of the filename) and use 7-zip on the .001 file
« Last Edit: Apr 26th, 2018 at 12:36pm by JR »  

essai_zip_001.txt ( 290 KB | 24 Downloads )
essai_zip_002.txt ( 290 KB | 26 Downloads )
essai_zip_003.txt ( 70 KB | 25 Downloads )
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2163
Joined: Oct 19th, 2005
Re: ScaleToPage print options
Reply #7 - May 1st, 2018 at 12:15pm
Print Post  
It actually calculates a ScaleFactor value close to zero for this graph, and since the property is of integer type the setter receives a truncated 0 value and refuses it -

Code
Select All
STDMETHODIMP PrintOptions::ScaleToPage()
{
	.....
	put_ScaleFactor(SHORT(100 * ratio));
}

STDMETHODIMP PrintOptions::put_ScaleFactor(SHORT newVal)
{
	if (newVal > 0)
	.....
 



The FP value is 0.533210039, which would print a pixel per 200-pixel large box, and that won't show anything legible anyway. I guess you could check if ScaleFactor remains unchanged by ScaleToPage() when the document is very large and show warning to user that it can't fit on a page.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
JR
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 84
Joined: Jun 12th, 2007
Re: ScaleToPage print options
Reply #8 - May 2nd, 2018 at 7:45am
Print Post  
Ok.

Thanks

Regards
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint