0

I am using an iframe in my component.html which render a src from a sanitizer url as follows.

 <iframe name="iframe1" id="iframe1"  [attr.src]="dataLocalUrl" width="100%" height="80%" type="application/pdf">
content...
  </iframe>

and in my component.ts has passed the url as follows.

loadPdf() {
    this.myService
      .downloadMyPdf(sessionStorage.getItem('selectedTemplateId'), this.dataShareService.getmyData())
      .subscribe(
        (res) => {
          this.dataLocalUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(res));
        },
      )

I need to hide the tool bar or the print / download options showing in the iframe. I have tried #toolbar=0 but it does not work.

Any idea how to do that? (Using CSS or attributes also fine)

SMash
  • 345
  • 2
  • 7
  • 23
  • https://stackoverflow.com/questions/65034/remove-border-from-iframe?rq=1 – Majid Nayyeri May 09 '20 at 09:03
  • @MajidNayyeri this is about the frame and this not works. I want to hide the toolbar which has zoom, print and download options – SMash May 09 '20 at 10:42
  • Does this answer your question? [How to apply CSS to iframe?](https://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe) – mr. pc_coder May 09 '20 at 13:20

0 Answers0