Signed url from S3 to display PDF in Angular using ng2-pdfjs-viewer

1.1k Views Asked by At

Succesfully receiving a signed URL from S3, and using the ng2-pdf-viewer the pdf is displaying, however using ng2-pdfjs-viewer with the extra features does not work as expected.

with ng2-pdf-viewer the src attribute works as expected

my issue is that the pdfSrc attribute on ng2-pdfjs-viewer is maniuplating my signed url and cutting the string and then not displaying anything in the view

  <pdf-viewer id="to-print"  src="{{pdfSrc}}"   style="height: 500px; width: 1000px;"></pdf-viewer>
  <ng2-pdfjs-viewer [pdfSrc]="pdfSrc" style="height: 500px; width: 1000px;"></ng2-pdfjs-viewer>

any ideas why the second one is changing the pdfSrc url provided to it?

tested with ng2-pdfjs-viewer versions 6.0.2 and 13.2.2

angular 11.0.5 and 13.0.3

thank you in advance!

1

There are 1 best solutions below

0
On

https://github.com/intbot/ng2-pdfjs-viewer/issues/8 never mind guys found the answer ! run encodeURIComponent(url) on the url