简体   繁体   中英

create an image from table

I have following problem. I have txt file here : http://ch1zra.com/d2/runes.txt

I use PHP to loop throgh the file and generate this table : http://ch1zra.com/d2/runes.php

Table uses some basic styles and I like it that way.

txt file is generated and uploaded via python. I would like to create an image that looks like that table. Is there any way using python or PHP to do so ?

Any image format that is acceptable on the web is good, PNG being even quite welcome. I've read somewhere that python reportlab can make styled tables with alignments and so on, so that could be a good start, but reportlab generates PDF. Of course, if that is just a step between it is also acceptable (if I could do the PDF > img conversion on my machine). ALso, IIRC every PDF contains a "screenshot" of each page for fast browsing, so that would also be cool.

All in all, I have this txt file and this HTML table that I want as image. If any1 can help that would be great :)

thanx in advance!

I can only speak for PHP.

You could try to build the image by hand with PHP's image functions http://www.php.net/manual/en/book.image.php

Or you could try executing a external script like: http://marginalhacks.com/Hacks/html2jpg/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM