【问题标题】:Blazor w/Syncfusion - Microsoft.JSInterop.JSException: Could not find 'sfBlazor.methodCall' ('methodCall' was undefined)Blazor w/Syncfusion - Microsoft.JSInterop.JSException:找不到“sfBlazor.methodCall”(“methodCall”未定义)
【发布时间】:2021-09-22 17:18:30
【问题描述】:

尝试使用 PDF 查看器(服务器)并在浏览器控制台中不断收到上述错误。它一直工作到今天,并且没有很多代码与之配套。有没有人遇到过这种情况?

<SfPdfViewerServer @ref="pdfViewer" ToolbarSettings="@ToolbarSettings" EnableFormFields="false" DocumentPath="@DocumentPath" EnableNavigationToolbar="false" EnableAnnotationToolbar="false" EnableToolbar="true" Height="100%" Width="100%">
     <PdfViewerCustomStampSettings EnableCustomStamp="true" IsAddToMenu="true" Width="194" Height="75" MaxHeight="75" MaxWidth="194" MinHeight="75" MinWidth="194" CustomStamps="@CustomStamps"></PdfViewerCustomStampSettings>
     <PdfViewerContextMenuSettings EnableContextMenu="false" />
     <PdfViewerAnnotationSettings IsLock="false" />
     <PdfViewerEvents AnnotationAdded="@AnnotationAdded" DocumentLoaded="@DocumentLoaded" AnnotationRemoved="@AnnotationRemoved" AnnotationSelected="@AnnotationSelected" />
</SfPdfViewerServer>

上面的代码是加载查看器的简单代码。以下代码是加载文档的内容。

byte[] byteArray = await webClient.DownloadDataTaskAsync(new Uri(docpath));
DocumentPath = "data:application/pdf;base64," + Convert.ToBase64String(byteArray);

【问题讨论】:

    标签: blazor syncfusion syncfusion-blazor


    【解决方案1】:

    该站点需要在 https 中运行。一旦我将其更改为安全运行,它就开始工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-31
      • 1970-01-01
      • 2021-04-21
      • 1970-01-01
      • 2012-07-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多