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!
![]() |
stack fails in html text |
Post Reply
|
| Author | |
greenley
Beginner
Joined: 27 Oct 11 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: stack fails in html textPosted: 06 Nov 11 at 11:01PM |
|
Basically trying to create my own DrawHTMLTextBox that will space the lines to fit within a table, i.e. narrow the spacing between lines.
I am trying: void TForm1::DrawSizedHTMLText(int tableID, int row, int col, AnsiString text) { int cellLeft = QP.GetTableCellDblProperty(tableID,row,col,101); int cellTop = QP.GetTableCellDblProperty(tableID,row,col,102); int cellWidth = QP.GetTableCellDblProperty(tableID,row,col,103); int cellHeight = QP.GetTableCellDblProperty(tableID,row,col,104); int leftPadding = 6; int numLines = QP.GetHTMLTextLineCount(cellWidth-leftPadding,(const wstring &)WideString(text)); double lineHeight = cellHeight/(double)numLines; double linePos = 0; AnsiString text1 = (AnsiString)QP.DrawHTMLTextBox(cellLeft-leftPadding,cellTop+linePos,cellWidth-leftPadding,lineHeight*1.5,(const wstring &)WideString(text)).c_str(); //text1=L"<stack><!--0000000202A18E8000000010##000000 N0000000002A18E8000000012##000000 N00000000LN--></stack>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>"; text1=L"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>"; linePos += lineHeight; QP.DrawHTMLTextBox(cellLeft-leftPadding,cellTop+linePos,cellWidth-leftPadding,lineHeight*1.5,(const wstring &)WideString(text1)); } When I use text1 directly from the call to DrawHTMLTextBox, I get 'Access violation at address 026E6C00 in module 'QuickPDFDLL0812.dll'. Read of address A18E800C'. Process stopped. Text1 at this point contain the stack as shown in the first commented out assignment to text1 which I got from the debugger, if I delete the stack code and use the second commented assignment, the code runs, but of course the interupted HTML tags are lost. To be clear, I get the error if I use text1 directly from the call to DrawHTMLTextBox or using the assigned value that is commented out in this example. Suggestions? |
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 Nov 11 at 11:33PM |
|
This error has finally been fixed in the 8.13 beta 1 release which can be downloaded from
Andrew.
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 Nov 11 at 3:37AM |
|
As mentioned in another question I found that a <p spacing="-2pt" tag will allow you to control line spacing.
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. |
|
![]() |
|
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