Ive found out that you can serialize a wpf component, in my example a FixedDocument, using the XamlWriter and a MemoryStream:
FixedDocument doc = GetDocument();
MemoryStream stream = new MemoryStream();
XamlWriter.Save(doc, stream);
And then to get it back:
stream.Seek(0, SeekOrigin.Begin);
FixedDocument result = (FixedDocument)XamlR...
Im working on a reporting system, a series of DocumentPage are to be created through a DocumentPaginator. These documents include a number of WPF components that are to be instantiated so the paginator includes the correct things when later sent to the XpsDocumentWriter (which in turn is sent to the actual printer).
My problem now is th...
I'm trying to print a WPF canvas over multiple pages.
I'm perfectly happy with scaling it to fit on the page width, then clipping and translating the canvas for each page; all pretty simple maths.
What I don't understand is how I get the dimensions of the printable area, and how to tell the printer where to print to. Whatever I try it ...