Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Automatically resize table cells to fit content |
Post Reply ![]() |
Author | |
Davis ![]() Beginner ![]() ![]() Joined: 21 Mar 14 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 21 Mar 14 at 1:39AM |
Hello,
I'm trying to create tables based on input from a file. The problem is I don't know how long some of the text going into the cells will be. If the text is too long it won't all fit in the cell and some of it is covered up. Is there a way I can tell the table to automatically resize the cells based on the content inside? Thanks!
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi,
think your own algo should be the solution? Take the length of characterstrings, the fontheight, the fontwidth, the ... and calculate and test. Yes. It's difficult... think that's the reason why it's not yet implemented in the library ;-) If you've reach a good solution you should share it here at the samples... Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
![]() |
|
Aly ![]() Beginner ![]() Joined: 30 May 12 Location: Glasgow Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
If you use SetTableRowHeight and set it to 0 then it will automatically size the cell height so that the text will fit over multiple lines.
If you want to do something with the column width as well then you would need to write that yourself. Remember to take in to account the Cell Padding as well if you do this.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store