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 text height |
Post Reply ![]() |
Author | |
Jan ![]() Beginner ![]() Joined: 24 May 10 Location: Czech Republic Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() Posted: 14 Mar 12 at 9:10AM |
Hi, I have a file in XSL-FO format and I want convert it into PDF. Example XSL-FO: Inserting into PDF: pdf.SetMeasurementUnits(0); // 0 = 1/72 inch "per unit" int idFont = pdf.AddTrueTypeFont("Times New Roman", 0); string textHTML = "<p><font size=\"12pt\">Test text, test text, test text .... </font></p>"; int _height = pdf.GetHTMLTextHeight(434, textHTML); Height of text at C# drawing/printing is lower than 15 pt, Difference in this case is about 6%. Can you help me? |
|
![]() |
|
Jan ![]() Beginner ![]() Joined: 24 May 10 Location: Czech Republic Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
I found, that value returned by GetHTMLTextHeight depends on value spacing parameter HTML text. Same single-line HTML text, same font, different spacing and different text height:
int iFontID = qp.AddTrueTypeFont("Times New Roman", 0);
qp.SetHTMLNormalFont("Times New Roman", iFontID);
string textHTML = "<p spacing=\"-2pt\" align=\"left\"><font size=\"11pt\">Test text test text</font></p>";
qp.DrawHTMLTextBox(10, 350, 300, 200, textHTML);
double height = qp.GetHTMLTextHeight(300, textHTML);
textHTML = "<p spacing=\"2pt\" align=\"left\"><font size=\"11pt\">Test text test text</font></p>";
qp.DrawHTMLTextBox(10, 400, 300, 200, textHTML);
height = qp.GetHTMLTextHeight(300, textHTML);
|
|
![]() |
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