I have installed the necessary nuget packages for pdf processing in an exisiting Asp.Net Core (.Net 7.0) Blazor project.
- Telerik.Windows.Documents.Core 2023.1.104
- Telerik.Windows.Documents.Fixed 2023.1.104
- Telerik.Windows.Zip 2023.1.104
In the OnClick handler of a button, the first line of code throws an exception:
public void EditPdfDocument(MouseEventArgs args)
{
var provider = new PdfFormatProvider(); // exception is thrown here
var doc = provider.Import(File.ReadAllBytes(@"path-to-file.pdf"));
// ...
}
Exception details:
System.TypeLoadException
HResult=0x80131522
Message=Could not load type 'System.Windows.Rect' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Source=Telerik.Windows.Documents.Fixed
StackTrace:
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider..ctor()
...