pdfium viewer ב- עבור C# wpf
-
עריכה: אני משאיר את השאלה על מקומה בכל אופן התשובה הקצרה נמצאת בפוסט של @חגי האחרון.
מישהו יודע איך להשתמש בpdfium viewer ב- wpf
החבילות בנוגט עושות לי שגיאות בהתקנה
כגוןSeverity Code Description Project File Line Suppression State Error Could not install package 'PDFiumCore 123.0.6309'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
מצאתי בגיט משהו מוכן אבל גם זה לא עובד עושה שגיאות
System.DllNotFoundException HResult=0x80131524 Message=אין אפשרות לטעון את קובץ ה-DLL 'pdfium.dll'. The specified module could not be found. (חריג מ- HRESULT: 0x8007007E) Source=PdfiumViewer StackTrace: at PdfiumViewer.NativeMethods.Imports.FPDF_AddRef() at PdfiumViewer.NativeMethods.FPDF_AddRef() in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\NativeMethods.Pdfium.cs:line 25 at PdfiumViewer.PdfLibrary..ctor() in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfLibrary.cs:line 26 at PdfiumViewer.PdfLibrary.EnsureLoaded() in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfLibrary.cs:line 18 at PdfiumViewer.PdfFile..ctor(Stream stream, String password) in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfFile.cs:line 29 at PdfiumViewer.PdfDocument..ctor(Stream stream, String password) in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfDocument.cs:line 155 at PdfiumViewer.PdfDocument.Load(Stream stream, String password) in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfDocument.cs:line 129 at PdfiumViewer.PdfDocument.Load(String path, String password) in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfDocument.cs:line 42 at PdfiumViewer.PdfDocument.Load(String path) in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer\PdfDocument.cs:line 29 at PdfiumViewer.WPFDemo.MainWindow.LoadPDFButton_Click(Object sender, RoutedEventArgs e) in C:\Users\0533105132\Downloads\PdfiumViewer-master(1)\PdfiumViewer-master\PdfiumViewer.WPFDemo\MainWindow.xaml.cs:line 91 at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at PdfiumViewer.WPFDemo.App.Main()
אין לי מספיק ניסיון כדי לדעת ולהבין מה בדיוק הבעיה קראתי שצריך להוסיף את ה-dll של pdfium אבל לא הבנתי בדיוק איך
אשמח לקבל עזרהמצו"ב הלינק לגיט
https://github.com/pvginkel
https://github.com/bezzad/PdfiumViewerתודה מראש
-
אתה צריך את זה:
https://github.com/pvginkel/PdfiumViewer
https://www.nuget.org/packages/PdfiumViewerבמה שאתה שלחת אין תמיכה בגירסת דוטנט שאתה משתמש
https://www.nuget.org/packages/PdfiumViewer.WPF#supportedframeworks-body-tab -
-
@חגי
אין כמוך!
אני מצרף לינק לתשובה המדוייקת שם שעזרה לי
https://stackoverflow.com/a/67373337/23343154