Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Size scale Error #226

Closed
snovos opened this issue Dec 13, 2017 · 3 comments
Closed

Update Size scale Error #226

snovos opened this issue Dec 13, 2017 · 3 comments
Milestone

Comments

@snovos
Copy link

snovos commented Dec 13, 2017

On page render getting error PDFViewer._setScale: '0' is an unknown zoom value, caused by method getScale, since offsetWidth returns 0 even though viewport is visible.

  <button (click)="onPreviewHide()" class="preview-close-btn" mat-mini-fab>
    <mat-icon>close</mat-icon>
  </button>
  <pdf-viewer [src]="pdfDoc" [original-size]="false" (after-load-complete)="onPdfLoadComplete($event)"></pdf-viewer>
</div>

Any thoughts?

@VadimDez
Copy link
Owner

Can you provide any steps to reproduce this error?

@snovos
Copy link
Author

snovos commented Dec 22, 2017

@VadimDez Just pass invalid url to component [src] property and you will get console error. Make sure zone.js is imported to main module.

P.S - There is pending PR in angular/zone repo, because I dont think there is any workaround on your side. You can close issue I think.

VadimDez added a commit that referenced this issue Dec 29, 2017
#226 Prevent throwing error: "PDFViewer._setScale: '0' is an unknown zoom value"
@VadimDez VadimDez added this to the 3.0.4 milestone Dec 29, 2017
@VadimDez
Copy link
Owner

I did some fix for this in 3.0.4, get that version
you can try to add this to your CSS as well:

pdf-viewer {
    display: block;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants