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 error #362

Closed
enkodellc opened this issue Sep 18, 2014 · 4 comments
Closed

addHTML error #362

enkodellc opened this issue Sep 18, 2014 · 4 comments

Comments

@enkodellc
Copy link

I am attempting to convert my fromHTML code to the addHTML and I keep getting a js error

Error: g.setAttribute is not a function

http://plnkr.co/edit/1Z5Mj6?p=preview

Thanks for your support and work on this control

@diegocr
Copy link
Collaborator

diegocr commented Sep 18, 2014

The problem occurs into html2canvas, hence i guess you're passing an html-string rather than a DOM node/element?

@enkodellc
Copy link
Author

You are correct. Is there a solution to just passing in an html string?

I updated the plunker to load from a DOM element, doesn't look good, colors are wrong, lists are missing bullets, font is grainy...

The reason I am now trying to use addHTML instead of fromHTML as from HTML had random textspacing issues, just random lines would have weird characters and increased letterspacing...

@diegocr
Copy link
Collaborator

diegocr commented Sep 18, 2014

Damn, i thought html2canvas supported bullet lists, it doesn't yet apparently: niklasvh/html2canvas#177

Well, give rasterizeHTML a try, to make addHTML use that you have to provide a rstz option if html2canvas is still defined, basically:

addHTML( node, { rstz : true }, function() {...});

@enkodellc
Copy link
Author

I couldn't get rasterizeHTML to load... looking for other solutions and thinking I should just use pdfreactor at this point as I am wasting so much time. I need simple html to pdf, with very little css, some padding, lists, spacing and maybe a few images and links. I will want encryption and password protection and I don't see that anywhere else. Thanks for taking the time to manage this repo and answer my questions.

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