Solved

page-break/form-feed possible?

Posted on 1997-08-30
13
186 Views
Last Modified: 2013-12-25
I will upgrade the number of points for this question if I get a YES, but am not inclined to offer a lot of points for a simple 'no'.

Is there any way that I can insert a 'form-feed' or 'page eject' into a page so that when I print it I can control where the page breaks happen.

I need something that will work with the Browsers that are out now, not something that relies on a future mark-up language feature.
0
Comment
Question by:jhurst
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 2

Expert Comment

by:theTerabyte
ID: 1854871
Unfortunatly, the only way to do this is with <br> tag after <br> tag until you get to the next page(i.e. teh equivalent of pressing enter untill you get to the bottom of the page).

it's not very clean, but it works.

HOPE THIS HELPS!  Terabyte
0
 
LVL 8

Author Comment

by:jhurst
ID: 1854872
This is not really a solution since we can not use the <BR>s since the number required would be different depending on how the driver happens to allocate space.  I am therefore going to leave it open for a little longer.



I do appreciate the reply however and would like to give you the points.  I will in a few days if nothing else comes.

0
 
LVL 2

Expert Comment

by:theTerabyte
ID: 1854873
Thanks, I appreciate the points even though it didn't solve your problem.

I will keep thinking about a solution, though a doubt there is one.  looks like this is one for netscape naviagtor V5.1
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Expert Comment

by:s2man11
ID: 1854874
Why don't you just create different HTML pages.  Each being the only text/images that will be printed on that page. It's a little  cumbersome but....

Or allow users to down load MS WORD, Wordperfect,... docs for a variety of platforms.  Then they can print them out.

Or create .PDF files with Adobe Pagemaker.
0
 
LVL 8

Author Comment

by:jhurst
ID: 1854875
unfortunately this does not work.  The problem is that the <BR> does a blank line as you say however, the number of lines that are allowed on a page varies from printer driver to printer driver.

With normal software we restrinct the number of lines on a page to 60 and do a dorm-feed knowing that this will work on the 60, 63 and 66 line per page printers this will not work here!

Thanks for the try, but sorry!

PS: I hate having to use the 'reject' key here.  Thaks but not quite would be much better.
0
 
LVL 5

Accepted Solution

by:
Trevor013097 earned 50 total points
ID: 1854876
Okay there is no way to include a page break and as I think we have all established the only way is to try and force a page break.  One method would be to find out how many pixels make up your 60 lines and then have an image (1 pixel x pixels in 60 lines) running down the side of the page.  Set up in a table like this:-

<TABLE BORDER=0>
  <TR>
      <TD><IMG SRC="image.gif" WIDTH=1 HEIGHT=600></TD>
      <TD>The contents of your page 1</TD>
  </TR>

  <TR>
      <TD><IMG SRC="image.gif" WIDTH=1 HEIGHT=600></TD>
      <TD>The contents of your page 2</TD>
  </TR>
</TABLE>

Your page should now print with breaks where the image ends and the new one starts.

0
 
LVL 8

Author Comment

by:jhurst
ID: 1854877
why does the image help?  Does the image not get broken by a page  when the page is printed?

0
 

Expert Comment

by:s2man11
ID: 1854878
Trevor has a good idea.

Actually, you won't see the image if you make it the same color as your background.  Make sure you sent borders to 0 and cell padding to 0 in your tables.

That way no one will know the page is actually a table.
0
 
LVL 8

Author Comment

by:jhurst
ID: 1854879
OK.  I agree, I can make the image impossible to see, probably I would make it transparent.  Howevere, I still come back to my other comment:  'why does the image help me?'

0
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1854880
The image helps because the browser by default will print images whole on a page.  If it cannot fit the image on a page it will print it on the next.  So providing you make your image the right height your pages will break at the right point.


0
 
LVL 8

Author Comment

by:jhurst
ID: 1854881
if you look at http://realestate.org/test/testbar.htm you will find an example of what you suggested.  When I print this document it does as you suggest the two page print.  You will note however that the gif image is divided over the pages.  To make it easier to see I have made the image a little wider that you suggest and left it black.  Am I doing something wrong, or does your method not work?
0
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1854882
okay jhurst,

I was wrong, but I was sure I had done it before, but hey must be wrong.

Please reject this answer and open it up for someone else.

My appologies for the error.

Just a thought, had you ruled out a .pdf file (Adobe Acrobat) this would give you perfectly formatted pages with standard word processor page breaks, or how about a word doc.


0
 
LVL 1

Expert Comment

by:LarryAndro
ID: 20111472
I had the same question as the original author.  Since the question was asked in 1997, probably browser changes were made.  Who knows.  But, an adequate answer for me, a way to force an html page to form-feed at a specific place is...

Using StyleSheet, it's easy to force a page break when printing a page.

   <table>
     <tr><td>Page 1</td></tr>
   </table>

   <table style="page-break-before: always">
     <tr><td>Page 2</td></tr>
   </table>
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
move widget title down 4 26
Shopping Cart 2 84
ebay api to see some data about my customers 2 40
Sending an input value from a view to a controller in MVC 3 23
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question