SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast ndtoan13's Avatar
    Join Date
    Dec 2004
    Location
    VietNam
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to draw a table content

    I have a table (like an Excel data) and i wonder if there is anyway to draw that table or create an image with the table's content on it

    For example:
    i have a table:
    <table width=300 border=1>
    <tr>
    <td>abc</td>
    <td>cde</td>
    </tr>
    <tr>
    <td>qwe</td>
    <td>asd</td>
    </tr>
    </table>

    how to have that content on an image? I mean how to create an image by coding which should be same as you put that table through web and take a screen shot.

    Thanks in advanced.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think imagemagik has a way to transform html into an image if some other librarys are present. Rendering html is complex. If you just need some simple grid like functionality for text, and only need to support basic things like width and a simple border, you could do it yourself without too much effort by using gd and stuff like imageline() and imagegetftext().

    You could also use a web browser to take a screen shot, utilizing its rendering engine to give you great rendering support. Automated ways to do this do exist, and theres even paid services which make it simple.

    There's programs to convert html to image too, and you could call it via the command line.

  3. #3
    SitePoint Enthusiast ndtoan13's Avatar
    Join Date
    Dec 2004
    Location
    VietNam
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply.

    I know with some desktop tool i can do it easily. What i want here is i want to render my web's content as an image.

    I'm trying to write each line into the image.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Start by using the functions I mentioned.


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
  •