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!
![]() |
DrawHTMLTextBox and and text align |
Post Reply ![]() |
Author | |
Jan ![]() Beginner ![]() Joined: 24 May 10 Location: Czech Republic Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() Posted: 11 Apr 12 at 4:25PM |
DrawHTMLTextBox have (I know only 7.26 version) a special behavior with using
1) When I don't use , DrawHTMLTextBox trim start space.
2) When I use , DrawHTMLTextBox wrong divide text between lines.
3) When I use instead of start (and after <br>) spaces DrawHTMLTextBox
work OK,
but in case "one line text box" for HTML text I prefer draw maximum text in this text box.
May problem is how recognize this case :-)
I do not expect answer, may be this sample will be useful for someone.
qp.SetOrigin(1);
qp.SetMeasurementUnits(0);
qp.SetPageDimensions(598.0, 845.0);
// 1) DrawHTMLTextBox trim start spaces
string textHTML = " text with spaces over two lines<br> two line text";
int iFontID = qp.AddTrueTypeFont("Times New Roman", 0);qp.SetHTMLNormalFont("Default", iFontID); qp.DrawHTMLTextBox(0, 0, 50, 500, "<font size=\"10pt\"><p spacing=\"-1.2\">" + textHTML + "</p></f>"); // 2) DrawHTMLTextBox don't trim start spaces (OK), maximum use box width (OK when I have one line text), wrong divide word at end of line string pomHTML = textHTML.Replace(" ", " ");qp.DrawHTMLTextBox(0, 60, 50, 500, "<font size=\"10pt\"><p spacing=\"-1.2\">" + pomHTML + "</p></f>");// 3)
textHTML = " text with spaces over two lines<br> two line text";
qp.DrawHTMLTextBox(0, 140, 50, 500, "<font size=\"10pt\"><p spacing=\"-1.2\">" + textHTML + "</p></f>"); |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Just for comparison, here is the output from QPL 8.15 Beta 2. There were some changes in the way   characters were handled in QPL 8. text with spaces over two lines two line text text wit h spaces ov er two lines two line text text with spaces over two lines two line text Andrew.
Edited by AndrewC - 13 Apr 12 at 12:35PM |
|
![]() |
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