Problem with VpeTextBlockGetLineCount

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Problem with VpeTextBlockGetLineCount

Postby JudgeTerry » Fri Mar 17, 2017 7:44 pm

I have just started to work with the TextBlock functions, and have a question about the 'VpeTextBlockGetLineCount' function. The documentation seems to indicate that the function should report the lines remaining in the block, not the original total of lines. Am I missing something here?? (Using VPE Professional version 7.10)

Code: Select all
text := 'Long lines of text....'

hTextBlock := VpeCreateTextBlock(hDoc, text)
? VpeTextBlockSetWidth(hTextBlock, 4.0)    <-- returns 37

VpeWriteTextBlock(hDoc, hTextBlock, 1.0, 2.0, 5)    <-- Writes 5 lines as expected
VpeWriteTextBlock(hDoc, hTextBlock, 5.5, 2.0, 5)    <-- Writes 5 more lines as expected
VpeWriteTextBlock(hDoc, hTextBlock, 10.0, 2.0, 5)   <-- Writes 5 more lines as expected

? VpeTextBlockGetLineCount(hTextBlock)     <-- Still returns 37, shouldn't this be 22??
VpeTextBlockRelease(hTextBlock)
JudgeTerry
 
Posts: 30
Joined: Thu Jan 22, 2009 10:56 pm

Re: Problem with VpeTextBlockGetLineCount

Postby IDEAL Software Support » Mon Mar 20, 2017 2:23 pm

VpeTextBlockSetWidth() is declared as void, so it does not return a value.

Regarding the problem that VpeTextBlockGetLineCount() does not return updated values, this seems to be a bug. We are currently investigating it. For Rich Text (RTF) it is working as documented.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: Problem with VpeTextBlockGetLineCount

Postby JudgeTerry » Mon Mar 20, 2017 5:18 pm

Sorry, I posted the incorrect code.

I knew VpeTextBlockSetWidth returns a void
The line for VpeTextBlockGetLineCount was missing

Code: Select all
    text := 'Long lines of text....'

    hTextBlock := VpeCreateTextBlock(hDoc, text)
    VpeTextBlockSetWidth(hTextBlock, 4.0)   
    ? VpeTextBlockGetLineCount(hTextBlock)     <-- returns 37

    VpeWriteTextBlock(hDoc, hTextBlock, 1.0, 2.0, 5)    <-- Writes 5 lines as expected
    VpeWriteTextBlock(hDoc, hTextBlock, 5.5, 2.0, 5)    <-- Writes 5 more lines as expected
    VpeWriteTextBlock(hDoc, hTextBlock, 10.0, 2.0, 5)   <-- Writes 5 more lines as expected

    ? VpeTextBlockGetLineCount(hTextBlock)     <-- Still returns 37, shouldn't this be 22??
    VpeTextBlockRelease(hTextBlock)


I will wait to hear what you find from your investigation into the non-RTF text blocks.
Thank you,
JudgeTerry
 
Posts: 30
Joined: Thu Jan 22, 2009 10:56 pm

Re: Problem with VpeTextBlockGetLineCount

Postby IDEAL Software Support » Tue Mar 21, 2017 9:41 am

We fixed the problem. The bugfix will be released with the next official release of VPE. As a workaround, retrieve the line count at the beginning and subtract inserted lines yourself by code.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 10 guests