SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    453
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Reference forconverting html into to jpg with php?

    Do you have a reference for converting html into a jpg? If so please post it.

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2009
    Location
    South Carolina
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nichemtktg View Post
    Do you have a reference for converting html into a jpg? If so please post it.
    Google is your friend php convert html to image
    Each day is a learning experience.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    453
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks. You gave me what I requested.

    Please confirm, if you can, that php does not have a function that converts a saved html file into a jpg, or png. If not, and you know of such a function, what is it?

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    There is no such function. It would first require a GUI (Graphical User Interface) which can be manipulated, a browser that can also be manipulated, a series of functions that would then take a screenshot of a predefined area...and so on. This is not something you just do.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    453
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I his to create a saved html file
    PHP Code:
    ob_start();
                 
                include 
    'display_print_bop.php';
                 
                
    file_put_contents('yourpage.html'ob_get_contents()); 
    Surely, there's a relatively easy way to convert it to a jpg or png with php?

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    No.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,129
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nichemtktg View Post
    Surely, there's a relatively easy way to convert it to a jpg or png with php?
    I can't really say it better than @logic_earth ;, so I quote:

    Quote Originally Posted by logic_earth View Post
    No.
    In essence you are asking PHP to do something it has no need of doing. Searching will show you solutions in other languages, ruby, bash, coldfusion. You can try and take those techniques and make them in PHP, but you will have your work cut out for you.


Bookmarks

Posting Permissions

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