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 - Vertical Spacing of Text in a Table?
  FAQ FAQ  Forum Search   Register Register  Login Login

Vertical Spacing of Text in a Table?

 Post Reply Post Reply
Author
Message
Dan View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Oct 11
Location: US
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan Quote  Post ReplyReply Direct Link To This Post Topic: Vertical Spacing of Text in a Table?
    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
Back to Top
greenley View Drop Down
Beginner
Beginner


Joined: 27 Oct 11
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote greenley Quote  Post ReplyReply Direct Link To This Post Posted: 06 Nov 11 at 3:19PM
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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 08 Nov 11 at 3:35AM
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.


Back to Top
Dan View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Oct 11
Location: US
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan Quote  Post ReplyReply Direct Link To This Post Posted: 08 Nov 11 at 2:42PM
Excellent! I'll give this a try.

Thanks,
Dan
Back to Top
greenley View Drop Down
Beginner
Beginner


Joined: 27 Oct 11
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote greenley Quote  Post ReplyReply Direct Link To This Post Posted: 08 Nov 11 at 4:43PM
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.Smile
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