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

addHTML() and fromHTML() is not populating in angular version >8 #2945

Closed
swarup-bhol opened this issue Oct 5, 2020 · 8 comments
Closed

Comments

@swarup-bhol
Copy link

swarup-bhol commented Oct 5, 2020

addHTMl() and fromHTML() is not populating on angular vesion > 8

@ncioj10
Copy link

ncioj10 commented Oct 5, 2020

Same problem here in React

@swarup-bhol
Copy link
Author

swarup-bhol commented Oct 5, 2020

Same problem here in React
Yeah I solve the problem, instead of using addHTML() , you can use directly use html() a callback function.
e.g

`var doc = new jsPDF();

doc.html(document.body, {
callback: function (doc) {
doc.save();
}
});`

@HackbrettXXX
Copy link
Collaborator

addHTML and fromHTML were replaced with html in 2.x. The typings still contain them, but this is a bug we will fix with the next version.

@SwissMaWi
Copy link

Thanks for pointing to the html function. How can I add the typings for it?

@HackbrettXXX
Copy link
Collaborator

The typings are located at types/index.d.ts. The TypeScript compiler should pick them up automatically, when using node resolving/npm.

@SwissMaWi
Copy link

Thanks @HackbrettXXX but the typings are wrong. I thought I can get them right myself to reflect the new .html method.

@HackbrettXXX
Copy link
Collaborator

What exactly is wrong with the typings? Note that there are some issues with the margins and positioning currently (e.g. #2924). If you want to correct them a pull request would be very welcome :)

@CurryPaste
Copy link

What exactly is wrong with the typings? Note that there are some issues with the margins and positioning currently (e.g. #2924). If you want to correct them a pull request would be very welcome :)

I finally know why I added the margin attribute, but it didn't work. 😅So if I want to use the margin attribute, which version should I reduce to?

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

5 participants