SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Website screenshot using php script

    Hi All,

    I would like to take the screenshot of the website page using a php script. What I'm expecting is a command where I can provide the URL, and it will create a screenshot in png or jpg format.

    f.e php takescreenshot.php <url> <output_file> .

    If anyone knows please help me.

    Thanks in advance

  2. #2
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Last edited by TechnoBear; Jan 12, 2013 at 08:43. Reason: Duplicate URL deleted

  3. #3
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hi adolek17,

    Thank you for your reply.

    Is there any other way to take the screen shot using php in Linux ?

  4. #4
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,410
    Mentioned
    81 Post(s)
    Tagged
    3 Thread(s)
    I think you can do it with Imagemagick but you need an x-server whatever that is.

    There is a post on the Imagemagick forum and there may be others around.

  5. #5
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Rubble View Post
    I think you can do it with Imagemagick but you need an x-server whatever that is.

    There is a post on the Imagemagick forum and there may be others around.
    I think it means you need a server with a windowing environment (so not just command line). You need a server somewhere that actually runs the site in a web browser so that an image can be saved and you can then grab the image.

    I did this exact same thing about 4 years ago, and that's pretty much the process we had to go through.

  6. #6
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,410
    Mentioned
    81 Post(s)
    Tagged
    3 Thread(s)
    I think it means you need a server with a windowing environment (so not just command line).
    You could be correct as there is a way of doing it in windows which opens a browser window; which I mentioned in the link in my post.

  7. #7
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,551
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    You can do it with wkhtmltoimage which is a command line application that uses the webkit engine


Tags for this Thread

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
  •