Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Print multiple FlowCharts (Read 1534 times)
sambalmueslie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Apr 12th, 2007
Print multiple FlowCharts
Jul 17th, 2007 at 2:32pm
Print Post  
Hi,
is it possible to print multiple FlowCharts on multiple Pages?
For each Page one FlowChart, scaled to Page?
I can do this with one FlowChart by using, PrintOptions.ScaleToPage() and Print().
But is it possible something like a container, where I add the pages and after that I call Print() ???

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print multiple FlowCharts
Reply #1 - Jul 18th, 2007 at 6:25am
Print Post  
Hi,

You could create a custom control to contain the flowchart pages, e.g. having the following methods:

Code
Select All
public FlowChart AddPage()
{
	AutoScroll = true;
	AutoScrollMargin = new Size(10, 10);

	FlowChart flowChart = new FlowChart();
	flowChart.DocExtents = new RectangleF(0, 0, 210, 297);
	flowChart.ShowScrollbars = false;
	flowChart.AutoScroll = false;
	flowChart.AutoSizeDoc = AutoSize.None;
	flowChart.BackColor = Color.White;

	int numFlowcharts = Controls.Count;
	Controls.Add(flowChart);

	Rectangle deviceBounds = flowChart.DocToClient(flowChart.DocExtents);
	flowChart.Location = new Point(
		10, 10 + numFlowcharts * (10 + deviceBounds.Height));
	flowChart.Size = new Size(deviceBounds.Width, deviceBounds.Height);

	return flowChart;
}

public void Print()
{
	// use the default printer (or call PrintDialog to get
	// a PrintDocument representing a printer selected by the user)
	PrintDocument doc = new PrintDocument();

	int page = 0;
	foreach (FlowChart flowChart in Controls)
	{
		flowChart.PrintOptions.HeaderFormat = (++page).ToString();
		flowChart.PrintOptions.ScaleToPage(doc);
		flowChart.Print(doc);
	}
}
 



Here is a sample project:
https://mindfusion.org/_samples/PageView.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint