PurePDF - Get the number of lines printed by pdf_MultiCell

Everything else that doesn't fall into one of the other PB categories.
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

PurePDF - Get the number of lines printed by pdf_MultiCell

Post by merendo »

Cheers everybody!

Subject tells it. In my app, which uses PurePDF, I need to know precisely how many lines were actually printed by the pdf_MultiCell cmd. I tried dividing pdf_GetStringWidth() by the cell width, but this result is inaccurate with longer strings.

Any help is appreciated! Thanks!
The truth is never confined to a single number - especially scientific truth!
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF - Get the number of lines printed by pdf_MultiCe

Post by ABBKlaus »

you can use nl as it counts the newlines inside ipf_MultiCell(), except the last chunk where you have to add one nl + 1 ;-)

BR Klaus
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Re: PurePDF - Get the number of lines printed by pdf_MultiCe

Post by merendo »

Sorry, I don't follow. Which command can I use to count the number of lines in the pdf? nl() doesn't exist on my PB...
The truth is never confined to a single number - especially scientific truth!
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF - Get the number of lines printed by pdf_MultiCe

Post by ABBKlaus »

merendo wrote:Sorry, I don't follow. Which command can I use to count the number of lines in the pdf? nl() doesn't exist on my PB...
I understand, what i meant was the variable called nl.l inside the procedure ipf_MultiCell().
I have already implemented something for you, please see if it works for you.

PurePDF v2.20
new command

Code: Select all

pdf_GetMultiCellNewLines()
Download from here :
http://www.purebasicpower.de/downloads/ ... B45X86.zip

BR Klaus
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Re: PurePDF - Get the number of lines printed by pdf_MultiCe

Post by merendo »

It works, but it always returns one too many. So when there was only one line printed, I get 2, and so forth...
The truth is never confined to a single number - especially scientific truth!
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF - Get the number of lines printed by pdf_MultiCe

Post by ABBKlaus »

the new version should fix this, please redownload.

BR Klaus
Post Reply