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

New release causing blank pdf #35

Closed
ShayShaked opened this issue Dec 6, 2016 · 5 comments
Closed

New release causing blank pdf #35

ShayShaked opened this issue Dec 6, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@ShayShaked
Copy link

Thank u very much for this useful plugin!!
Version 0.1.3 causing blank pdf to show.
version 0.1.2 works well.

@VadimDez
Copy link
Owner

VadimDez commented Dec 6, 2016

@ShayShaked, Could you provide more information?

@ShayShaked
Copy link
Author

Of course. I'm developing mobile app with Ionic 2 + Angular 2 using visual studio and ripple emulator on chrome. I installed the plugin about two weeks ago and it worked perfectly well. Until yesterday i had version 0.1.0 . Yesterday my team ran install for ng2-pdf-viewer for the first time on their machines and ran some troubles seeing the pdf, showed as blank sheet. I decide to remove my version on my machine and install the new one. same problem occurred. On chrome dev tools i saw svg's tags that assembles the pdf. Decided to rollback to version 0.1.0 and it worked well. To investigate more i Installed versions 0.1.1 - 0.1.2, and it worked (pdf showed without any problem).
BTW, when opening dev tools while the older versions installed i noticed that the pdf is wrapped inside acanvas..

@VadimDez
Copy link
Owner

VadimDez commented Dec 7, 2016

Just tried clean ionic2 project with pdf viewer - can see the pdf.
Do you have any errors in console ?
Any chance that the styles are overwritten?

@chunghha
Copy link

chunghha commented Dec 8, 2016

I see this (or similar) problem too after updating to 0.1.3. (with 0.1.2, don't see the problem with 0.1.3.)

Error I see on console is this,

TypeError: Cannot read property 'parentNode' of undefined

from this code
canvas.parentNode.insertBefore(_this.buildSVG(viewport, textContent), canvas);

But, more detail of my problem is that

  • only 1st page is not displayed (blank page without any error on console.)
  • when page goes to 2nd page, the above error on console but the page is displayed correctly.
  • From 3rd page to end of all pages, I no longer see my problem.

I am using angular-cli (beta 21) with bootstrap4 alpha5 and don't use ionic for my project FYI. @VadimDez, please let me know if you need more info.

@VadimDez VadimDez added the bug label Dec 8, 2016
@VadimDez VadimDez added this to the 0.1.4 milestone Dec 8, 2016
@VadimDez VadimDez self-assigned this Dec 8, 2016
@chunghha
Copy link

After updating to 0.1.4, the type error above has gone. But all pages are not displayed - all blank pages.

I believe this commit fixed - "when page goes to 2nd page, the above error on console but the page is displayed correctly."

But does not fix - only 1st page is not displayed (blank page without any error on console.) to begin with.

I got to set [render-text]="false" to pdf-viewer to display all pages and verified with 0.1.3 same workaround works - 1st page is displayed when [render-text]="false" is set.

([render-text]="false" is set, I see canvas only.)

image

([render-text]="true" is set, I see both svg text layer and canvas.)

image

So, I think real problem here is "textLayer" class on the svg element. For my project with angular-cli, I needed to include pdf_viewer.css either into index.html or angular-cli.json's styles array if I want see pages at least (I mean not a permanent fix) with [render-text]="true" .

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

No branches or pull requests

3 participants