1

I have text files in txt and md format. How can I create thumbnail images from these files? This conversion should work similar as in Google Docs or Google Drive. See screenshot attached.enter image description here

mega6382
  • 9,211
  • 17
  • 48
  • 69
user652061
  • 303
  • 3
  • 4
  • 14
  • See this [link](https://stackoverflow.com/questions/15772299/generate-thumbnail-for-text-file) Has a similar question with some answers. – AlexCode Oct 10 '17 at 12:32
  • Maybe this post can help you: [generate thumbnail for text file](https://stackoverflow.com/questions/15772299/generate-thumbnail-for-text-file) – LenglBoy Oct 10 '17 at 12:33
  • Possible duplicate of [Generate thumbnail for text file](https://stackoverflow.com/questions/15772299/generate-thumbnail-for-text-file) – teeyo Oct 10 '17 at 12:33
  • Possible duplicate of https://stackoverflow.com/questions/15772299/generate-thumbnail-for-text-file – teeyo Oct 10 '17 at 12:33
  • Thanks, guys, I saw that answer, but I suspect that quality of a thumbnail obtained by the recommended method (imagettftext) is not going to be good. The example provided here - http://php.net/manual/en/function.imagettftext.php shows the text to be too big and not well positioned. I might be wrong as I did not actually tested it on practice. – user652061 Oct 10 '17 at 12:38

1 Answers1

0

You need this for some small number of files and it can be done beforehand or dynamically?

If it is a small number and can be done before, use https://convertio.co/txt-svg/ tool and then save svg images for later use.

DanteTheSmith
  • 2,937
  • 1
  • 16
  • 31