C# XPS FixDocument保存失败,宽高必须非负

发布于 2024-09-17 00:56:39 字数 372 浏览 13 评论 0原文

我在需要将 XAML 报告保存到 XPS 时遇到问题。 每当调用保存时,XPS 写入都会因“高度和宽度必须为非负数”而失败。

当我检查对象时,大多数高度和宽度都设置为 NaN。我假设这是可以的并且被用作自动值。我有两份以相同方式构建的报告,一份保存,一份不保存。

问题是否可能出在 XAML 用户控件中,而不是文档的构造方式中?页面尺寸设置如下。

fixedDocument = new FixedDocument();
fixedDocument.DocumentPaginator.PageSize = new Size(fixedDocumentWidth, fixedDocumentHeight);

任何想法将不胜感激!

I am having a problem with a XAML report that needs to be saved to XPS.
Whenever the save is called the XPS Writing failed due to, "Height and Width must be non-negative".

When I inspect the object, most heights and widths are set to 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.

Is it possible that the problem is in the XAML usercontrols rather than in the way the document is constructed? The page size is set as follows.

fixedDocument = new FixedDocument();
fixedDocument.DocumentPaginator.PageSize = new Size(fixedDocumentWidth, fixedDocumentHeight);

Any ideas would be much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

战皆罪 2024-09-24 00:56:39

问题已解决,绘图软件的错误导致了图层问题。

Problem fixed, an error with the graphing software caused the problem with the layers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文