【发布时间】:2018-11-10 10:27:56
【问题描述】:
这是我的组件.html
<iframe [src]="frameSrc | safe" class="frameSet" type="application/pdf"
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>
This browser does not support PDFs. Please download the PDF to view it:
<a href="frameSrc | safe">Download PDF</a>
</iframe>
当此组件在我的浏览器 (Chrome) 中打开时,会下载 pdf 而不是显示。 frameSrc 来自我指定为[src] 的父组件。我想显示 pdf 而不是下载。我做了一些研究,发现Content-Disposition 在我的浏览器默认设置中是attachment。我怎样才能改变它,以便它适用于每个浏览器?
【问题讨论】:
标签: angular pdf iframe display content-disposition