使用NG2-PDFJS-Viewer从S3签名的URL以在Angular中显示PDF

发布于 2025-01-29 06:43:04 字数 561 浏览 4 评论 0原文

成功地从S3接收签名的URL,并使用NG2-PDF观看器PDF正在显示,但是使用NG2-PDFJS-Viewer具有额外功能无法正常工作。

使用ng2-pdf-ciewer,src属性可以按预期工作,

我的问题是,ng2-pdfjs-viewer上的pdfsrc属性正在管理我的签名URL并切割字符串,然后在视图中不显示任何

  <pdf-viewer id="to-print"  src="{{pdfSrc}}"   style="height: 500px; width: 1000px;"></pdf-viewer>
  <ng2-pdfjs-viewer [pdfSrc]="pdfSrc" style="height: 500px; width: 1000px;"></ng2-pdfjs-viewer>

想法的任何想法,为什么第二个变化在视图中不显示任何想法。 PDFSRC URL提供了吗?

使用NG2-PDFJS-Viewer版本6.0.2和13.2.2

Angular 11.0.5和13.0.3

测试。

Succesfully receiving a signed URL from S3, and using the ng2-pdf-viewer the pdf is displaying, however using ng2-pdfjs-viewer with the extra features does not work as expected.

with ng2-pdf-viewer the src attribute works as expected

my issue is that the pdfSrc attribute on ng2-pdfjs-viewer is maniuplating my signed url and cutting the string and then not displaying anything in the view

  <pdf-viewer id="to-print"  src="{{pdfSrc}}"   style="height: 500px; width: 1000px;"></pdf-viewer>
  <ng2-pdfjs-viewer [pdfSrc]="pdfSrc" style="height: 500px; width: 1000px;"></ng2-pdfjs-viewer>

any ideas why the second one is changing the pdfSrc url provided to it?

tested with ng2-pdfjs-viewer versions 6.0.2 and 13.2.2

angular 11.0.5 and 13.0.3

thank you in advance!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若能看破又如何 2025-02-05 06:43:04

https://github.com/intbot/ng2-pdfjs-viewer/issues/ 8 没关系的家伙找到了答案!在URL上运行Encodeuricomponent(URL)

https://github.com/intbot/ng2-pdfjs-viewer/issues/8 never mind guys found the answer ! run encodeURIComponent(url) on the url

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文