我在我的 component.html 中使用了一个 iframe,它从 sanitizer url 中渲染了一个 src,如下所示。
<iframe name="iframe1" id="iframe1" [attr.src]="dataLocalUrl" width="100%" height="80%" type="application/pdf">
content...
</iframe>
并在我的 component.ts 中传递了如下网址。
loadPdf() {
this.myService
.downloadMyPdf(sessionStorage.getItem('selectedTemplateId'), this.dataShareService.getmyData())
.subscribe(
(res) => {
this.dataLocalUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(res));
},
)
我需要隐藏iframe中显示的工具条或打印下载选项。我试过 #toolbar=0
但它不工作。
有什么办法吗?(用CSS或属性也行)