[英]C# XPS FixedDocument fails to save, width and height must be non-negative
I am having a problem with a XAML report that needs to be saved to XPS. 我的XAML报告有问题,需要将其保存到XPS。 Whenever the save is called the XPS Writing failed due to, "Height and Width must be non-negative".
每当调用保存时,由于“高度和宽度必须为非负数”,XPS写入失败。
When I inspect the object, most heights and widths are set to NaN. 当我检查对象时,大多数高度和宽度都设置为NaN。 I am assuming this is ok and is used as an auto value.
我假设这是可以的并用作自动值。 I have 2 reports built the same way and one saves and one doesn't.
我以相同的方式构建了2个报告,一个保存了,一个没有。
Is it possible that the problem is in the XAML usercontrols rather than in the way the document is constructed? 问题是否可能出在XAML用户控件中,而不是文档的构造方式中? The page size is set as follows.
页面尺寸设置如下。
fixedDocument = new FixedDocument();
fixedDocument.DocumentPaginator.PageSize = new Size(fixedDocumentWidth, fixedDocumentHeight);
Any ideas would be much appreciated! 任何想法将不胜感激!
问题已解决,制图软件出错导致图层问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.