title: Refused to display 'URL' in a frame because it set 'X-Frame-Options' to 'sameorigin' to display PDF
body: <p>I referred <a href="https://angular.io/guide/security#xss" rel="nofollow noreferrer">https://angular.io/guide/security#xss</a> and trying to display a PDF on our intranet sharePoint site on a web page </p>
  
  <p>Here is template:
  help.component.html:</p>
  
  <pre><code>&lt;iframe class="e2e-iframe-trusted-src" width="640" height="390" [src]="trustedUrl" &gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>and component:
  help.component.ts</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { SessionResetService } from '../../services/session-reset.service';
  import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
  
  @Component({
    selector: 'app-help',
    templateUrl: './help.component.html',
    styleUrls: ['./help.component.scss']
  })
  export class HelpComponent implements OnInit {
      public trustedUrl: SafeUrl;
      public helpUrl: string;
      constructor(private _resetSession: SessionResetService,
          private sanitizer: DomSanitizer) {
          this.helpUrl = "https://website Url/Tool.pdf";
          this.trustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.helpUrl);
      }
  
      ngOnInit() {
          this._resetSession.CallResetSession();
    }
  }
  </code></pre>
  
  <p>I tried appending &amp;embedded=true as suggested:
  <a href="https://stackoverflow.com/questions/56391081/how-to-fix-refused-to-display-in-a-frame-because-it-set-x-frame-options-to-sa">How to fix Refused to display in a frame because it set &#39;X-Frame-Options&#39; to &#39;sameorigin</a></p>
  
  <p>but that didn't work as well. Please guide</p>