0

Using Angular 10 and the library ngx-doc-viewer : https://www.npmjs.com/package/ngx-doc-viewer.

I am getting this error: "400. That’s an error.The server cannot process the request because it is malformed. It should not be retried. That’s all we know."

HMTL: <ngx-doc-viewer [url]="url?.href"[viewer]="google"> </ngx-doc-viewer>

In my component I have: this.url.href = (window.URL ? URL : webkitURL).createObjectURL(file); File is a blob that I converted from base64.

This is the url I am getting the error with: https://docs.google.com/gview?url=blob%3Ahttp%3A%2F%2Fcompanyurl%2F7d5d56ac-4b09-4ba7-ab7c-8246d5c96aa1&embedded=true

Does Google Doc Viewer / ngx-doc-viewer handle blob urls?

1 Answers1

0

After doing some research, I learned that ngx-doc-viewer does not support blob urls or base64. It will only take a publicly available url. For example, https://docs.google.com/gview?url=http://africau.edu/images/default/sample.pdf&embedded=true

Here are some resources that explains in further detail:

  1. https://github.com/Marcelh1983/angular-document-viewer/issues/85
  2. https://github.com/Marcelh1983/document-viewer/issues/22
  3. https://github.com/Marcelh1983/document-viewer/issues/10