I'm trying to print the contents of a canvas with some other UI elements but having very limited success. Is there any way to construct the elements to a Grid for example instead, then print the contents rendered at a desired page size?

This was, I could get the benefit of databinding and vastly easier layout without using System.Windows.Documents.

有帮助吗?

解决方案

Take a look at this good short article called Printing WPF window(visual) to printer and fit on a page. It shows the basics of printing in WPF, but also how to size the visual to fit the page.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top