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

Use doc.getLineHeightFactor() instead of FONT_ROW_RATIO constant in autoTableText() #753

Closed
gpbmike opened this issue Dec 22, 2020 · 1 comment

Comments

@gpbmike
Copy link

gpbmike commented Dec 22, 2020

When using autoTableText with an array of text strings, it would be nice for a previously set lineHeightFactor to be used.

Documentation for getLineHeightFactor: http://raw.githack.com/MrRio/jsPDF/master/docs/jsPDF.html#getLineHeightFactor
Fix would go here: https://github.com/simonbengtsson/jsPDF-AutoTable/blob/master/src/autoTableText.ts#L15

Use case:

doc.setLineHeightFactor(2);
doc.autoTableText(['First Line', 'Second Line'], 0, 0);

I would expect more space between the first and second line, but a value of 1.15 is hardcoded.

@simonbengtsson
Copy link
Owner

Looks great! Let's continue discussion in the pull request.

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

Successfully merging a pull request may close this issue.

2 participants