How to split text into pages?

Reply

Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

How to split text into pages?

 
0
  #1
May 23rd, 2009
Hi ,

I have a text field in a table and i would like to split it into pages for viewing pleasure. I know how to split it into set of pages if it is in rows. But i couldn't get clue how to split a lengthy text field into pages which is present in a single column of a table.
Any ideas or guidance will be very helpful to me.

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
1
  #2
May 23rd, 2009
well you could use a paginator
and count the number of words in the entire 'book' then each word i part of an array and you just output a certain number of array items per page.....specified in the paginator settings.
no dejes para mañana lo que puedes hacer hoy
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
0
  #3
May 23rd, 2009
Originally Posted by sacarias40 View Post
well you could use a paginator
and count the number of words in the entire 'book' then each word i part of an array and you just output a certain number of array items per page.....specified in the paginator settings.
Thank you for the quick reply.
What actually is a paginator? Is it a set of code lines? i googled little after seeing your post about it.
Do you recommend any specific paginators?
OR
shall i make use of some string syntax to count total words in a text and split it into number of words resulting in a page? If i follwo this method, then it might result in awkward splitting where it might break a sentence even before it ends.
So.. if i use somthing like display till a full stop is encountered , then if a code is present then again its a problem.

Please suggest something. Thank you.
Last edited by csharplearner; May 23rd, 2009 at 11:19 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
0
  #4
May 23rd, 2009
you could go like this.....
  1. $string = 'this is a small sample sentence that should be split up';
  2. $words = explode(' ', $string);
  3.  
  4. for($i = 0; $i = count($words); $i++){
  5. echo $words[$i] . '<br />';
  6. }

you could even split it up by sentences. by using the delimiter in the explode function as '.'
Last edited by sacarias40; May 23rd, 2009 at 11:34 pm. Reason: forgot something
no dejes para mañana lo que puedes hacer hoy
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
0
  #5
May 23rd, 2009
Thanks! I shall work on this and post back
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
0
  #6
May 23rd, 2009
if you would like i can send you a paginator class that i made if that would help you.
no dejes para mañana lo que puedes hacer hoy
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
0
  #7
May 23rd, 2009
Originally Posted by sacarias40 View Post
if you would like i can send you a paginator class that i made if that would help you.
Thanks a Ton sacarias40. I really appreciate it.
I would like to give it a try first with the hints you have given and later if unsuccessful i shall certainly ask your help again for the class file you made.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: How to split text into pages?

 
0
  #8
May 23rd, 2009
alright that sounds fair. im here if you need me.
no dejes para mañana lo que puedes hacer hoy
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC