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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Automatically resize table cells to fit content
  FAQ FAQ  Forum Search   Register Register  Login Login

Automatically resize table cells to fit content

 Post Reply Post Reply
Author
Message
Davis View Drop Down
Beginner
Beginner
Avatar

Joined: 21 Mar 14
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Davis Quote  Post ReplyReply Direct Link To This Post Topic: Automatically resize table cells to fit content
    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!
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Aly View Drop Down
Beginner
Beginner


Joined: 30 May 12
Location: Glasgow
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aly Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store