Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Print Preview (Read 2470 times)
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Print Preview
Apr 24th, 2008 at 10:10am
Print Post  
Hi,

I'm looking to provide a print preview facility for my diagram - but I can only see how to print.

The programmers guide documentation indicates that print and print preview are supported, but the example only shows PrintDocument, and I can't find a corresponding PrintPreview.

Does such a thing exist?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Preview
Reply #1 - Apr 24th, 2008 at 11:02am
Print Post  
Apparently you must use DocumentViewer for print-preview in WPF. I got the following working with much help from this blog:
http://blogs.microsoft.co.il/blogs/tamir/archive/2008/01/29/printing-more-then-o...

Code
Select All
private void diagram_DoubleClicked(object sender, DiagramEventArgs e)
{
	MemoryStream ms = new MemoryStream();
	Package pkg = Package.Open(ms, FileMode.Create, FileAccess.ReadWrite);
	string pack = "pack://temp.xps";
	PackageStore.AddPackage(new Uri(pack), pkg);
	XpsDocument doc = new XpsDocument(pkg, CompressionOption.NotCompressed, pack);
	XpsSerializationManager rsm = new XpsSerializationManager(new XpsPackagingPolicy(doc), false);
	rsm.SaveAsXaml(diagram.DocumentPaginator);
	documentViewer1.Document = doc.GetFixedDocumentSequence(); ;
}
 



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