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 - DrawHTMLTextBox and   and text align
  FAQ FAQ  Forum Search   Register Register  Login Login

DrawHTMLTextBox and   and text align

 Post Reply Post Reply
Author
Message
Jan View Drop Down
Beginner
Beginner


Joined: 24 May 10
Location: Czech Republic
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jan Quote  Post ReplyReply Direct Link To This Post Topic: DrawHTMLTextBox and   and text align
    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 &nbsp; 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);

int iFontID = qp.AddTrueTypeFont("Times New Roman", 0);

qp.SetHTMLNormalFont("Default", iFontID);

// 1) DrawHTMLTextBox trim start spaces

string textHTML = "      text with spaces over two lines<br>     two line text";

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(" ", "&nbsp;");

qp.DrawHTMLTextBox(0, 60, 50, 500, "<font size=\"10pt\"><p spacing=\"-1.2\">" + pomHTML + "</p></f>");

// 3)
textHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text with spaces over two lines<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two line text";

qp.DrawHTMLTextBox(0, 140, 50, 500, "<font size=\"10pt\"><p spacing=\"-1.2\">" + textHTML + "</p></f>");

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: 13 Apr 12 at 12:34PM
Just for comparison, here is the output from QPL 8.15 Beta 2.  There were some changes in the way &nbsp 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
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