View s3 amazon private docx file by using Google Docs View
Tue 02 Jul 2019

Below is Angular code but you can do it simple, just focusing on the encodeURIComponent. Read the link below to get to know the reason. 

get html() {
  return this.viewTrustDocx;

private get viewTrustDocx(): SafeHtml {
  return this.sanitizer.bypassSecurityTrustHtml(
      `<iframe src="${this.googleDocsViewUrl}" frameborder="0" width="100%" height="100%"></iframe>`

private get googleDocsViewUrl(): string {
  return `${encodeURIComponent(this.url)}&embedded=true`;
<div class="view-frame" [innerHtml]="html"></div>