Gossamer Forum
Home : General : Perl Programming :

Content-Length Problem.

Quote Reply
Content-Length Problem.
I am facing a problem here.
I am writing a script which will produce HTML output for printing.
I want to introduce "page-break" after a specified "Content-Length" and then it continues printing the remaining input. Lets suppose after EVERY 130 characters, how can I insert <DIV style="page-break-after:always"></DIV>
and then continue printing the remaining part? I tried to use 'while' statement but could not think of any good solution. Thanks in advance for any help. Sara. ################### CODE #######################
$text = qq|
This is line no 1 and then it continues ..... and then a line break
This is line no 2 and then it continues ..... and then a line break
This is line no 3 and this is a long line and then it continues ..... and then a line break
This is line no 4 and then it continues ..... and then a line break
|;

$length = length ($text);

print qq|
<div align="center">
<center>
<table>
<tr>
<td width="500" style="text-align: Justify" valign="middle" align="right">
$text
</td>
</tr>
</table>
</center>
</div>
|;

Subject Author Views Date
Thread Content-Length Problem. samsara 4684 Nov 3, 2003, 5:45 PM
Post Re: [samsara] Content-Length Problem.
Andy 4533 Nov 4, 2003, 2:43 AM
Post Re: [samsara] Content-Length Problem.
Watts 4531 Nov 4, 2003, 7:48 AM