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

    print paper size

    Hey guys i have a challenge on my hands and i can't seem to settle it...

    see i made a car dealership script for my body and he needs to print out window stickers(window regular paper with car info)

    so i made a litle script that echo's the info(from MySQL DB) on to an image.

    all good.But when it comes to print a get a super small image on a paper..lol

    so i re did the background image to fit printer size...but man is it big and i cant get the info on it..

    is there a way to make a page with a background image that prints ok...

    like this
    http://www.autoplusnet.com/Graphics/...EMO_562_QR.jpg

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Find out what DPI you are printing at and render the image at the correct size. That info is for A4, so if you are using a different paper size you'll need to find the pixels for that.
    Last edited by Inigoesdr; 05-25-2011 at 12:16 AM.

  • #3
    New Coder
    Join Date
    Sep 2005
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts
    so how wold this work?lets say i want it at

    300 dpi (print) = 2480 X 3508 pixels

    how can i make a php page with the info to print on it?

    cant make a table of 2480 * 3508 and put the pic in background?

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Show your code that generates the image and someone can help you out.

  • #5
    New Coder
    Join Date
    Sep 2005
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts
    the image is already done.

    i need to but it as background a make the code on top of it to echo the car' s info..

    see this is the image.

    http://www.autosspeedy.ca/window2.gif

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Load your image in to GD using imagecreatefromgif(), then write the text to the image using imagettftext(), and finally write out the result using imagegif().

  • #7
    New Coder
    Join Date
    Sep 2005
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts
    wow..lol ok i will look it up.thx!

  • #8
    New Coder
    Join Date
    Sep 2005
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts
    how im i going to add all my echo's with mysql with this?and ow do i specify were to put the image and txt??

    PHP Code:
    <?php
    // Définition du content-type
    header('Content-Type: image/png');

    // Création de l'image
    $im imagecreatetruecolor(40030);

    // Création de quelques couleurs
    $white imagecolorallocate($im255255255);
    $grey imagecolorallocate($im128128128);
    $black imagecolorallocate($im000);
    imagefilledrectangle($im0039929$white);

    // Le texte à dessiner
    $text 'Test...';
    // Remplacez le chemin par votre propre chemin de police
    $font 'arial.ttf';

    // Ajout d'ombres au texte
    imagettftext($im2001121$grey$font$text);

    // Ajout du texte
    imagettftext($im2001020$black$font$text);

    // Utiliser imagepng() donnera un texte plus claire,
    // comparé à l'utilisation de la fonction imagejpeg()
    imagepng($im);
    imagedestroy($im);
    ?>


  •  

    Posting Permissions

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