Take the 2-minute tour ×

In my web application, a user may make a post with images, embed videos and text with different styles. I want to generate a preview for the post to show it on the front page of the web application. It demands that it doesn't take too much space and as clear as possible.

I know that I need to parse the post html first and may extract image elements first. My consideration for the text is simply to extract all plain texts and show part of them.

Could someone provide other advice, methods or resource about this problem?

share|improve this question
There is no data-mining in this question (parsing web files is not data-mining). Please tag more carefully. You might also want to improve your accept rate. –  Anony-Mousse Jun 25 '12 at 20:07
add comment

1 Answer

As I understand, you want to render a HTML page into an image? You should use some layout engine, such as WebKit or Gecko on server side.

Another option is to use some third-party online tool for these previews. But rendering the page is pretty hard process, because of it's time complexity and memory space requirements for storing images. I have found these services:

share|improve this answer
sorry, maybe my english mislead you, what i want to do is to generate a preview of a blog post by parsing the html structure of the post, such that a visitor can know sth about the post only with the generated preview. –  zuo Jun 25 '12 at 14:58
add comment

Your Answer


