Print Page | Close Window

DrawHTMLTextBox not rendering ol/ul/li

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2709
Printed Date: 22 Nov 24 at 1:30PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DrawHTMLTextBox not rendering ol/ul/li
Posted By: equick
Subject: DrawHTMLTextBox not rendering ol/ul/li
Date Posted: 18 Aug 13 at 3:53AM
ol/ul/li code are not rendering with DrawHTMLTextBox. The other supported HTML tags (e.g., b, i, em, sup, sub, etc) in http://www.debenu.com/docs/pdf_library_reference/AppendixA.php" rel="nofollow - Appendix A are working. Here's the snippet of code that I'm trying to work with:
With objPDF
strHTML = "<ul><li>item 1</li><li>item 2</li><li>item 3</li></ul>"
Call .SetTextAlign(intAlignment)
Call .SetHTMLNormalFont("Default", intFont)
Call .SetHTMLBoldFont("Default", intFontBold)
Call .SetHTMLItalicFont("Default", intFontItalic)
Call .DrawHTMLTextBox(intX, intY, intWidth, intHeight, strHTML)
End With
Am I missing something? Any help would be appreciated. Thank you in advance!



Replies:
Posted By: AndrewC
Date Posted: 19 Aug 13 at 1:15AM
equick,

The following code is working correctly for me in QPL 8.16, 9.12 and 9.15.

        QP.SetOrigin(1);   // Added

        string strHTML = "<ul><li>item 1</li><li>item 2</li><li>item 3</li></ul>";
        QP.SetTextAlign(0);
QP.SetHTMLNormalFont("Default", 4);
        QP.SetHTMLBoldFont("Default", 5);
QP.SetHTMLItalicFont("Default", 6);
QP.SetHTMLBoldItalicFont("Default", 7);
        QP.DrawHTMLTextBox(20, 20, 200, 200, strHTML);

        QP.SaveToFile("out.pdf");

Andrew.



Posted By: equick
Date Posted: 19 Aug 13 at 4:17AM
Thank you for the response Andrew. Is there a known old bug for the <ol> or the <ul> tags? Could the bug be specific to VBScript ASP? I tried using your code but the <ol> and <ul> tags still do not render properly. It looks like the <li> tags are rendering but I don't get the numbers or bullet points for <ol> and <ul>, respectively. I'm using QPL 5.11. I currently can't upgrade as I'm managing an existing system.

Sample output (notice the lack of numbers for <ol> or bullet points for <ul>):
Item 1
Item 2
Item 3


Posted By: AndrewC
Date Posted: 19 Aug 13 at 5:21AM

equick,

QPL 5.11 is very, very old and way before my time.  I suspect there could have been bugs in that part of the library as there have been a few changes in QPL 7 and 8 in the HTML functions.

The library has evolved a lot over the last few years and it would be too difficult to track down a bug that is this old.

Andrew.


Posted By: equick
Date Posted: 19 Aug 13 at 5:24AM
OK, but you don't see anything majorly wrong with how I'm doing this right? Is there an alternate way of rendering the HTML that I might be overlooking, which may render the <ol> and <ul> properly? If I'm not using it wrong, then I'll agree with you and assume it is because we are running a very old version of the QPL.


Posted By: AndrewC
Date Posted: 20 Aug 13 at 7:32AM
equick,

I don't think there would be any other way to achieve this.  The code is as simple as it gets and the QPL HTML parser is pretty basic so it is unlikely there would be any type of workaround.  QPL 5.11 was back in the early days of Quick PDF library development.

Andrew.


Posted By: equick
Date Posted: 20 Aug 13 at 3:26PM
OK, thank you for your help Andrew.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk