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!
![]() |
Vertical Spacing of Text in a Table? |
Post Reply ![]() |
Author | |
Dan ![]() Team Player ![]() ![]() Joined: 21 Oct 11 Location: US Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() Posted: 26 Oct 11 at 10:41PM |
I am programatically creating a pdf that has a table. I'm running in to a problem with text wrapping. In cells where the text is wrapping to a 2nd line, only the first line is visible unless I SetTableRowHeight to a higher value or reduce the font size.
I'd need to be able to squeeze the text in if at all possible. I have set the bottom padding to 0 and it looks like there is enough vertical space for line 2 yet it doesn't render. Is it possible to set or reduce the space between the lines for text added with SetTableCellContent()? Thanks, Dan |
|
![]() |
|
greenley ![]() Beginner ![]() Joined: 27 Oct 11 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Did you ever find an answer to this, I have the same question?I think it could be done with an HTML equivalent of SetTextSpacing, but I can't find one.
Used GetHTMLTextHeight and got a height of 32, padding set to zero all around, cell border width = .1, two lines do not appear unless cell height is set to 38 or higher, that doesn't let me fit on a page what I need. Yes I could create the table as a series of boxes, and draw the text as separate lines of text, or maybe then use setTextSpacing, but that is a LOT more work, and this project was finally coming together. Lines of code I referred to are: QP.SetTableCellBorderWidth(tableID, 1,1,10,3,0, 0.2); QP.SetTableCellPadding(tableID,1,1,10,3,0,0); QP.SetTableRowHeight(tableID, 10, 10, 38); int junk1 = QP.GetHTMLTextHeight(131.4,L"<font size=\"12pt\"><b>Are there services this plan doesn't cover?</b></font>"); Thanks Edited by greenley - 06 Nov 11 at 3:47PM |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
I am no expert with HTML but after reviewing the QPL source code I found that the <p spacing= > tag is supported and after a little bit of testing found out that this works to control the line spacing. I will get this added to the documentation.
string text = "<p spacing=\"-2pt\">begins to pay for covered services you use. Check your policy to see when the <font color=\"#0775A8\">deductible</font> starts over (usually, but not always, January 1st). See the chart starting on page 2 for how much you pay for covered services after you meet the <font color=\"#0775A8\">deductible</font>.</font>"; QP.DrawHTMLTextBox(10 ,10, 300 , 200, text); Andrew. |
|
![]() |
|
Dan ![]() Team Player ![]() ![]() Joined: 21 Oct 11 Location: US Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
Excellent! I'll give this a try.
Thanks, Dan |
|
![]() |
|
greenley ![]() Beginner ![]() Joined: 27 Oct 11 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
While it is not in my understanding the way regular html would format it, for this usage it works great. Have just tested with 8.12 and it takes care of what I needed perfectly.
![]() |
|
![]() |
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