fixedpage

Why am I losing my databinding when printing to an XpsDocument?

倖福魔咒の 提交于 2019-12-05 22:49:58
问题 Update! Binding works. The issue is that the XpsDocumentWriter doesn't properly write the first page of the first document of a FixedDocumentSequence. This seems to be an issue encountered by lots of people doing this sort of thing (i.e., five developers worldwide). The solution is slightly odd. I include it as an answer. Okay, its a bit more subtle than the question suggests. I've got a series of FixedPages, each has its DataContext set individually. Each FixedPage also has one or more

Adding Image to FixedPage in WPF

╄→гoц情女王★ 提交于 2019-12-02 07:13:25
I want to be able to print images with other UIElements. I have a FixedPage instance and trying to add image like so // Basic printing stuff var printDialog = new PrintDialog(); var fixedDocument = new FixedDocument(); fixedDocument.DocumentPaginator.PageSize = new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight); FixedPage page = new FixedPage(); page.Width = fixedDocument.DocumentPaginator.PageSize.Width; page.Height = fixedDocument.DocumentPaginator.PageSize.Height; Image img = new Image(); // PrintIt my project's name, Img folder var uriImageSource = new Uri(@"/PrintIt

Adding Image to FixedPage in WPF

烈酒焚心 提交于 2019-12-02 07:04:46
问题 I want to be able to print images with other UIElements. I have a FixedPage instance and trying to add image like so // Basic printing stuff var printDialog = new PrintDialog(); var fixedDocument = new FixedDocument(); fixedDocument.DocumentPaginator.PageSize = new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight); FixedPage page = new FixedPage(); page.Width = fixedDocument.DocumentPaginator.PageSize.Width; page.Height = fixedDocument.DocumentPaginator.PageSize.Height;