#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    393
    Rep Power
    47

    Forcing maximum print area


    Hi:

    I have a application that needs to force print to a specified area, (name cards).

    Basically, what I now have is:
    PHP Code:
    echo  <<<EOT
    <div style='page-break-after: always' style = "center" >
    <h1><b>
    $employee_name</b></h1>
    <h2>
    $company_name</h2>
    <img class="center" src="
    $badge_logo_file" height="$logo_height" alt="" />
    <h3>
    $ah</h3>
    </div> 
    EOT; 
    which works fine except if a company name or an employee name is too long, it will wrap to another line, causing the card wrap to a second card.

    Can I force each line to shrink font size to maintain a single line of maximum width?
    Can I force the entire <div> to shrink proportionally to fit a maximum height?

    BTW, I am using an internal style sheet because I want to set values for text size programmatically from saved database values.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    393
    Rep Power
    47
    AH!

    Just found that "white-space:nowrap;" will keep the line from wrapping by simply truncating it.

    Is there another configuration that will reduce text height to fit all the text without truncating?
    Last edited by SeanF; August 6th, 2014 at 09:54 AM.

IMN logo majestic logo threadwatch logo seochat tools logo