Print Page | Close Window

Automatically resize table cells to fit content

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2851
Printed Date: 06 May 25 at 7:20AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Automatically resize table cells to fit content
Posted By: Davis
Subject: Automatically resize table cells to fit content
Date 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!



Replies:
Posted By: Ingo
Date Posted: 21 Mar 14 at 8:11AM
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



Posted By: Aly
Date Posted: 28 Mar 14 at 10:22AM
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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk