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 - stack fails in html text
  FAQ FAQ  Forum Search   Register Register  Login Login

stack fails in html text

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


Joined: 27 Oct 11
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote greenley Quote  Post ReplyReply Direct Link To This Post Topic: stack fails in html text
    Posted: 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?
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: 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.
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: 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.

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