- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.Scheduling library for HTML5 & JavaScript.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
ScaleToPage print options
Read 1316 times

JR   Offline
Junior Member
**
Posts: 84
I love YaBB 1G - SP1!


   
     
 
ScaleToPage print options
Apr 25th, 2018 at 11:15am
 
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
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1511
Gender: male
tech.support


   
     
 
Re: ScaleToPage print options
Reply #1 - Apr 25th, 2018 at 12:37pm
 
Hi,

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

Regards,
Slavcho
 
 
 
IP Logged    
 
     

JR   Offline
Junior Member
**
Posts: 84
I love YaBB 1G - SP1!


   
     
 
Re: ScaleToPage print options
Reply #2 - Apr 25th, 2018 at 1:32pm
 
Hi,

Measureunit = 2 (pixel)

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

Regards

 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1511
Gender: male
tech.support


   
     
 
Re: ScaleToPage print options
Reply #3 - Apr 26th, 2018 at 9:06am
 
Hi,

Code:
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
 
 
 
IP Logged    
 
     

JR   Offline
Junior Member
**
Posts: 84
I love YaBB 1G - SP1!


   
     
 
Re: ScaleToPage print options
Reply #4 - Apr 26th, 2018 at 9:14am
 
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

 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1511
Gender: male
tech.support


   
     
 
Re: ScaleToPage print options
Reply #5 - Apr 26th, 2018 at 11:28am
 
What's your printer's default paper size?
 
 
 
IP Logged    
 
     

JR   Offline
Junior Member
**
Posts: 84
I love YaBB 1G - SP1!


   
     
 
Re: ScaleToPage print options
Reply #6 - Apr 26th, 2018 at 11:34am
 
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 1:36pm by JR »

essai_zip_001.txt (290 KB | 23 )
essai_zip_002.txt (290 KB | 22 )
essai_zip_003.txt (70 KB | 25 )
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1511
Gender: male
tech.support


   
     
 
Re: ScaleToPage print options
Reply #7 - May 1st, 2018 at 1:15pm
 
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:
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
 
 
 
IP Logged    
 
     

JR   Offline
Junior Member
**
Posts: 84
I love YaBB 1G - SP1!


   
     
 
Re: ScaleToPage print options
Reply #8 - May 2nd, 2018 at 8:45am
 
Ok.

Thanks

Regards
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print