How to determine height for printing large wrapped text

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

How to determine height for printing large wrapped text

Post by sudip »

Hello Friends,

How to determine height for printing large wrapped text for a specific width?

Thanks in advance. :)

With best regards.

Sudip
With best regards,
Sudip
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to determine height for printing large wrapped text

Post by sudip »

Hello Friends,

I just tested PrintHeight() function with help of Rathi's code:

Code: Select all

function printLen( cString,fontsize,fontname)
return round(gettextwidth(Nil,cString,fontname)*0.072/72*25.4*fontsize,2)

Function PageWidth()
   return (GetPrintableAreaWidth() - 2*GetPrintableAreaHorizontalOffset())
   

Function printHeight(cString, fontsize, fontname, mWidth)
return ceiling(printLen(cString, fontsize, fontname)/mWidth)*NextRow(fontsize+1)


function NextRow(mPoint)
   return (mPoint/72*25.4)
Please test and send your comments.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to determine height for printing large wrapped text

Post by Rathinagiri »

Thanks a lot Sudip. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply