add preview

@maethu this pr would add the preview feature without the pdf preview.