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

Table header is wrapping the text, but its not the word wrap #57

Closed
ruhijain opened this issue Jul 27, 2015 · 11 comments
Closed

Table header is wrapping the text, but its not the word wrap #57

ruhijain opened this issue Jul 27, 2015 · 11 comments

Comments

@ruhijain
Copy link
Contributor

In my table in the PDF, The Table header does wrap the text after version 1.3.2 but still it is not the complete word wrap. I would really appreciate if some assistance can be provided for this at the earliest.

For example the problem is , If Table column is "Record No." , Its shows Reco in one line and the rest in other. If "Manufacturer" is the text than it show Manufac in one line, rest in other line.

@ruhijain
Copy link
Contributor Author

I managed to do it for now, I do encounter another problem though.

When a particular cell data has long string into it, the row height dynamically increases but it then goes out of the page crossing the footer.

Even when the bottom margin is specified, why this happens? Whats the solution?

@simonbengtsson
Copy link
Owner

I think the issue you describe is the same as in #53? If so, it is fixed in v2.0 which I will release the coming week. Sorry for the late reply.

@ruhijain
Copy link
Contributor Author

ruhijain commented Aug 7, 2015

Well, Yes it looks like the same issue. I will wait for v2.0 then. Will it be backward compatible? Just worried if i have to change my code a lot. I have used it the library at many places.

@simonbengtsson
Copy link
Owner

There is no big API changes and your code should probably be fine. It will not be 100% backwards campatible unfortunately however. I have added better styling support which meant that I had to make some changes to the renderCell and renderHeaderCell methods.

@ruhijain
Copy link
Contributor Author

ruhijain commented Aug 7, 2015

ohh okay. I guess i would have to change my code then. Anyways will wait for the update, :)

@ruhijain
Copy link
Contributor Author

Can you provide a quick fix for this. I really need some urgent fix for this issue.

Any alternative, if not the upgrade to 2.0?

@ruhijain
Copy link
Contributor Author

Trying to find some workaround on this issue. In renderCell i check for autoTableEndPosY and compare it with doc.internal.pageSize.height, if autoTableEndPosY exceeds a specific value i want to change page and move the records from then onwards to new page. I did addPage() , But how do i make it to add next all records to this new page?

@simonbengtsson
Copy link
Owner

Unfortunately I can't see a way to do this without modifying the source so that would be your best option for now. If you do fix it, make sure you send a pull request. The 2.0 release got a bit delayed, but hopefully I can release it today.

@ruhijain
Copy link
Contributor Author

I fixed it my just doing a small change in jspdf.plugin.autotable.js :)

Btw, just curious to know, Can i put links in PDF file?

@simonbengtsson
Copy link
Owner

Sweet! There is an annotations plugin for jspdf that makes it possible to add links. It is included in version 1.1 of jspdf, but I think you can add it to earlier versions as well.

@simonbengtsson
Copy link
Owner

Closing as duplicate of #53

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