Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Print Dialogue (Read 3093 times)
srlevitt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Mar 27th, 2007
Print Dialogue
Jul 20th, 2007 at 11:21am
Print Post  
I have a fussy user who is really hung up about the page range in the print dialogue. Why does the range go from 1..100 when there are only one or two pages in the document?
Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Dialogue
Reply #1 - Jul 20th, 2007 at 1:18pm
Print Post  
You can use your own print dialog:

PrintDialog dlg = new PrintDialog();
dlg.Document = new PrintDocument();
dlg.Document.PrinterSettings.FromPage = 1;
dlg.Document.PrinterSettings.ToPage = 100;
if (dlg.ShowDialog(this) == DialogResult.OK)
     fc.Print(dlg.Document);

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
srlevitt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Mar 27th, 2007
Re: Print Dialogue
Reply #2 - Jul 20th, 2007 at 1:50pm
Print Post  
Thanks,
Thats certainly good, but is there a property somewhere in the flow chart which tells me how many pages the print will run to, i.e. the last page number?

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Dialogue
Reply #3 - Jul 21st, 2007 at 12:47pm
Print Post  
Set docRect = FlowChart.GetContentRect(true, true) to find out the size of the printable area. The A4 paper size is 210 mm by 297 mm. Subtract the margin size from the paper size and assign the result to pageRect. Make sure all values used in the calculation are measured in the same unit. Finally

int xPages = (int)Math.Ceiling(docRect.Width / pageRect.Width);
int yPages = (int)Math.Ceiling(docRect.Height / pageRect.Height);

The last page number is xPages * yPages.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
srlevitt
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Mar 27th, 2007
Re: Print Dialogue
Reply #4 - Jul 21st, 2007 at 4:24pm
Print Post  
Stoyan,
your help, as always is spot-on. Thanks. Grin
Steve.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint