简体   繁体   English

使用PDFTron导航到页面时引发异常

[英]Exception thrown when navigating to a page with PDFTron

I have to say this exception is really weird. 我不得不说这个例外真的很奇怪。 In Windows 10, universal C#-XAML app. 在Windows 10中,通用C#-XAML应用程序。 I have two monitors (the one from the laptop, and a 2nd screen) and a surface. 我有两个监视器(一个来自笔记本电脑,一个第二个屏幕)和一个表面。 I have a very simple app, with 2 pages, PageA and PageB. 我有一个非常简单的应用程序,有2页,分别是PageA和PageB。 If I put the the PDFTron logic from the samples provided in PageA, it works in all 3 screens. 如果从PageA中提供的示例中放入PDFTron逻辑,则它可在所有3个屏幕中使用。 If I put the PDFTron logic in PageB and use the laptop monitor WITHOUT having changed anything it breaks and throws a helpful "Unknow error!". 如果我将PDFTron逻辑放在PageB中,并且使用笔记本电脑显示器而未做任何更改,则会中断并抛出一个有用的“未知错误!”。 If I use the same app in my 2nd monitor or the surface it works!! 如果我在第二台显示器或地面上使用相同的应用程序,则可以正常运行!!

I call 我打电话

 pdftron.PDFNet.Initialize();

In the App.xaml.cs and build PDFViewCtrl = new PDFViewCtrl(); 在App.xaml.cs中,构建PDFViewCtrl = new PDFViewCtrl(); in the UI thread in the constructor of PageB. 在PageB构造函数的UI线程中。

any help please? 有什么帮助吗?

PDFTron sample PDFTron示例

Be aware that the sample works in certain conditions as a Surface. 请注意,该示例在某些条件下可以作为Surface工作。 But in a 3840x2160 Dell laptop screen puting the logic in PageB it does not work. 但是,在3840x2160的戴尔笔记本电脑屏幕中,将逻辑放在PageB中无法正常工作。

First, there is most likely an actually useful exception message, but you have to retrieve it from PDFNet using the exception you got. 首先,最有可能是一条实际上有用的异常消息,但是您必须使用获得的异常从PDFNet检索它。 See this blog post. 请参阅此博客文章。 This is a limitation of how Microsoft implemented their latest mobile technology (COM API boundary). 这是Microsoft如何实现其最新移动技术(COM API边界)的限制。

As for the error, most likely this has already been fixed. 至于错误,很可能已经解决了。 Windows 10 introduced pixel densities that are not recognized in the Windows.Graphics.Display.DisplayProperties.ResolutionScale enumerator from Windows 8.1. Windows 10引入了Windows 8.1中Windows.Graphics.Display.DisplayProperties.ResolutionScale枚举器无法识别的像素密度。

This is why certain devices would fail, and others would not, using older versions of PDFNet. 这就是为什么使用旧版本的PDFNet某些设备会失败而其他设备不会失败的原因。

Please contact PDFNet support to get the latest version. 请联系PDFNet支持以获取最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM