I'm creating a custom report using WPF. I'm using DocumentViewer with FixedDocument, and all apparently works, the document I'm creating is visible on the screen and it works on the printer too. But if I try to print using the Microsoft XPS Document Writer virtual printer, and I open the created file with the XPS document receiver I receive the "The Page cannot be displayed" error:
I did some rollback in the project history and apparently the error happens when the document pass from single page to multiple page. As another hint: the document contains images and fonts as embedded resource. No idea if this change the behavior or not.
EDIT I found the code causing the problem:
<Style TargetType="FixedPage">
<Setter Property="Width" Value="1122.24"/>
<Setter Property="Height" Value="793"/>
</Style>
These are dimensions for an A4 in landscape. If I specify a size different from default, teh xps viever seems go crazy, any idea ?