Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2012
    Thanked 0 Times in 0 Posts

    Best practice for printing from HTML

    I need some advice on printing HTML
    Is there a 'rule guide' somewhere?
    The output I'll be creating will be for printing purposes only - the display on screen won't really matter - it's the print that matters most

    The biggest concern I have is fitting to an A4 page size.

    - How can I print as close to the header and footer of a page as possible?

    - I will have x records, each of which will have an output of a page that needs to print out onto a single page only. How do I delimit my content and separate into several pages?

    - Small writing: this is a big requirement. I want to have small writing in places like the footer
    Will I have any problems printing small fonts?

    - Perfect quality graphics: how do I get this? Use PNG's?

    Only looking for pointers
    Any advice would be great



  2. #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Thanked 33 Times in 33 Posts
    There are just too many ways for printing HTML to get screwed up fot it to be considered reliable. If the printing is critical then you should be using a pdf, not HTML.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help


  3. #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 726 Times in 715 Posts
    The best control you can get for printing when using HTML is to specify all the requirements in a media=print stylesheet.

    This will allow you to define which way around it is to print on the page as well as font sizes using pt (the standard way to define fixed size text for printing).
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts