Page 1 of 1

PurePDF - Get the number of lines printed by pdf_MultiCell

Posted: Sat Nov 20, 2010 1:04 pm
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!

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

Posted: Mon Nov 22, 2010 9:01 pm
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

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

Posted: Wed Nov 24, 2010 9:53 pm
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...

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

Posted: Wed Nov 24, 2010 11:46 pm
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

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

Posted: Mon Nov 29, 2010 8:31 pm
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...

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

Posted: Thu Dec 02, 2010 5:57 pm
by ABBKlaus
the new version should fix this, please redownload.

BR Klaus