question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng2-pdf-viewer + angular 13

See original GitHub issue
Bug Report or Feature Request (mark with an x)
- [X] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

I’m unable to make a hello world app with angular 13 similar to this one. The application compile but the pdf don’t show. In the dom, the src field is incomplete:

image

Dependencies

  "dependencies": {
    "@angular/animations": "~13.1.0",
    "@angular/common": "~13.1.0",
    "@angular/compiler": "~13.1.0",
    "@angular/core": "~13.1.0",
    "@angular/forms": "~13.1.0",
    "@angular/platform-browser": "~13.1.0",
    "@angular/platform-browser-dynamic": "~13.1.0",
    "@angular/router": "~13.1.0",
    "ng2-pdf-viewer": "^7.0.2",
    "rxjs": "~7.4.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
}

App.ts

import { Component } from '@angular/core';

@Component({
  selector: 'example-app',
  template: `
  <pdf-viewer [src]="pdfSrc"
              [render-text]="true"
              [original-size]="false"
              style="style="width: 400px; height: 500px"
  ></pdf-viewer>
  `
})
export class AppComponent {
  pdfSrc = "https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf";
}

App.module.ts

import { PdfViewerModule } from 'ng2-pdf-viewer';

@NgModule({
  imports: [BrowserModule, PdfViewerModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
maxbalancommented, Dec 29, 2021

as a workaround for those facing the same issue, reverted back to last working version for me ^6.4.0, seems to be working fine with angular 13.1.1

4reactions
blakejacommented, Apr 8, 2022

This is still a problem with v9.0.0, reverting back to 6.4.0 fixed the issue with Angular 13.2.4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng2-pdf-viewer - npm
Angular 5+ component for rendering PDF. Latest version: 9.1.3, ... Start using ng2-pdf-viewer in your project by running `npm i ng2-pdf-viewer`.
Read more >
How to Build an Angular PDF Viewer with ng2-pdf-viewer
In this blog post, we'll provide step-by-step instructions on how to build a PDF viewer using the ng2-pdf-viewer package. In our example, we'll...
Read more >
Create PDF Viewer in Angular 14 with NG2 PDF Viewer
The ng2-pdf-viewer is an excellent package exclusively built for creating PDF viewer components in angular applications.
Read more >
ng2-pdf-viewer - StackBlitz
ng2 -pdf-viewer. A angular-cli project based on rxjs, tslib, webpack, zone.js, pdfjs-dist, @angular/core, worker-loader, @angular/forms, ng2-pdf-viewer, @angular ...
Read more >
VadimDez/ng2-pdf-viewer: PDF Viewer Component for Angular
PDF Viewer Component for Angular. Contribute to VadimDez/ng2-pdf-viewer development by creating an account on GitHub.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found