jsPDF-AutoTable icon indicating copy to clipboard operation
jsPDF-AutoTable copied to clipboard

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

Open ruhijain opened this issue 11 years ago • 11 comments

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 avatar Jul 27 '15 08:07 ruhijain

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?

ruhijain avatar Jul 30 '15 09:07 ruhijain

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.

simonbengtsson avatar Aug 06 '15 23:08 simonbengtsson

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.

ruhijain avatar Aug 07 '15 04:08 ruhijain

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.

simonbengtsson avatar Aug 07 '15 08:08 simonbengtsson

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

ruhijain avatar Aug 07 '15 08:08 ruhijain

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 avatar Aug 14 '15 07:08 ruhijain

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?

ruhijain avatar Aug 19 '15 04:08 ruhijain

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.

simonbengtsson avatar Aug 19 '15 10:08 simonbengtsson

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?

ruhijain avatar Aug 19 '15 10:08 ruhijain

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 avatar Aug 19 '15 10:08 simonbengtsson

Closing as duplicate of #53

simonbengtsson avatar Aug 21 '15 12:08 simonbengtsson