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

Blank PDF in Ionic 4 #47

Closed
ravimallya opened this issue Dec 23, 2019 · 3 comments
Closed

Blank PDF in Ionic 4 #47

ravimallya opened this issue Dec 23, 2019 · 3 comments

Comments

@ravimallya
Copy link

Hello,

I've a ion-row element which has two columns, and inside of those, I have two tables. I've wrapped entire ion-row with a div and I'm trying to export to PDF. I'm getting a blank pdf with header/footer callback - which works fine.

Does this plugin will work with Ionic 4?

@ravimallya
Copy link
Author

ravimallya commented Dec 24, 2019

If I wrap the tables with plain div without using ion-grid layout, export works fine. Is there anyway to get it worked with ionic grid or such ionic components?

Also, I'm getting the error which user mentioned here: niklasvh/html2canvas#2058 .

@wnabil
Copy link
Owner

wnabil commented Dec 30, 2019

Yes it works, seems like a styling issue with html2pdf or html2canvas because ionic use flex layout now and i do not think the used libraries supports them, however the best thing to do is to render the table twice, one using the ionic structure and one without and completely hidden "just for the export".
to make the code even better you can create a shared component to handle the hidden one so you do not repeat the code every time.

for the second issue you mentioned i will keep an eye on it and directly update the library when its fixed, thanks for the details

@ravimallya
Copy link
Author

Thank you. @wnabil . I've updated the other one with my code to export to PDF.

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