C# 如何使用此wpfpdfviewer?
内部异常 {“类未注册(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG))” 找到免费pdf查看器后,出现错误,还有其他更好的免费pdf查看器吗?如果没有,如何正确使用 '对与指定绑定约束匹配的类型'WPFPdfViewer.WinFormPdfHost'调用构造函数时引发异常。'行号'10'和行位置'14' 无法加载文件或程序集“Interop.AcroPDFLib”C# 如何使用此wpfpdfviewer?,c#,wpf,pdf-viewer,C#,Wpf,Pdf Viewer,内部异常 {“类未注册(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG))” 找到免费pdf查看器后,出现错误,还有其他更好的免费pdf查看器吗?如果没有,如何正确使用 '对与指定绑定约束匹配的类型'WPFPdfViewer.WinFormPdfHost'调用构造函数时引发异常。'行号'10'和行位置'14' 无法加载文件或程序集“Interop.AcroPDFLib” public partial class MainWindow : Window
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var location = System.Reflection.Assembly.GetExecutingAssembly().Location;
var path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), "sample.pdf");
pdfViewer.LoadFile(path);
//pdfviwer.LoadFile(@"C:\Users\LAB-User2\Downloads\PdfViewer");
}
}
<Window x:Class="testPDFwpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WPFPdfViewer="clr-namespace:WPFPdfViewer;assembly=WPFPdfViewer"
Title="MainWindow" Height="350" Width="525">
<Grid>
<WPFPdfViewer:PdfViewer x:Name="pdfViewer">
</WPFPdfViewer:PdfViewer>
</Grid>
</Window>
公共部分类主窗口:窗口
{
公共主窗口()
{
初始化组件();
var location=System.Reflection.Assembly.getExecutionGassembly().location;
var path=System.IO.path.Combine(System.IO.path.GetDirectoryName(位置),“sample.pdf”);
pdfViewer.LoadFile(路径);
//加载文件(@“C:\Users\LAB-User2\Downloads\PdfViewer”);
}
}
然后我发现在将UserControl1复制到自己的项目中并遵循示例中的所有代码后,出现了错误
"找不到任何适用于指定区域性或中性区域性的资源。对与指定绑定约束匹配的类型“testPDFwpf.MainWindow”调用构造函数时引发异常。“行号“3”和行位置“9”。调用堆栈仅包含外部代码。您正在尝试使用wpfpdviewer.dll此dll需要在您的电脑上安装一个adobe acrobat产品。请尝试安装,并让我们知道查看内部异常。{“找不到适合指定区域性或非特定区域性的任何资源。请确保\“testPDFwpf.UserControl1.resources\”已正确嵌入或链接到程序集\“testPDFwpf”\“在编译时,或者所需的所有附属程序集都是可加载和完全签名的。”}{“类未注册(HRESULT的例外:0x80040154(REGDB_E_CLASSNOTREG))”