在新标签中打开外部链接到PDF的外部链接

发布于 2025-01-20 09:32:10 字数 588 浏览 4 评论 0原文

我正在尝试在新标签中打开一个链接(从Blazor Server应用程序)到PDF,但没有成功。 PDF没有下载,也不知道为什么...应该那么简单。

尝试不同的解决方案。这是用于JSRuntime解决方案的代码。另一个是一个简单的“ a”标签链接

await JSRuntime.InvokeAsync<object>("open", url, "_blank");

打开一个简单的链接,但打开下载pdf的链接。 它是带有参数“格式= PDF”的ReportingServices服务器的链接。

链接如下: myServerurl/deventerver/pages/reportViewer.aspx?%2FReportTools%2FMyReportName&amp; rs:format = pdf = pdf

我看到人们对PDF有同样的问题。 在新标签中打开PDF-Blazor

有人知道我在做什么错还是有解决方案?

I'm trying to open a link (from a Blazor server app) to a pdf in a new tab but with no success.
The pdf isn't downloading and don't know why...is should be that simple.

Tryied different solutions. This is the code used for jsruntime solution. The other is a simple "a" tag link

await JSRuntime.InvokeAsync<object>("open", url, "_blank");

Opening a simple link is working but opening a link that downloads a pdf isn't.
It's a link to a ReportingServices server with the parameter "Format=PDF".

The link is as follows:
myserverURL/ReportServer/Pages/ReportViewer.aspx?%2fReportTools%2fMYREPORTNAME&rs:Format=PDF

I've saw that people are having same issue with pdfs.
Open PDF in new Tab - Blazor

Does anyone know what I'm doing wrong or have a solution to this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文