How to create a screenshot of a text file in Linux?

The program to do the job produces data in a text file (table, framed |, _, and -. )
You need to create screenshots of these text files, but not manually.
Automation is not a problem, but how and what to run from a script to a certain SOFTWARE (a La ImageMagick) created a screenshot file, which she feed?
And the second question (I think from the realm of fantasy :): is it possible to make a screenshot automatically allocated grid area and not included in the screenshot the empty area around the table?
PS: OS - Ubuntu
June 7th 19 at 14:39
1 answer
June 7th 19 at 14:41
Solution
Path: text file -> [PS] -> [EPS] -> PDF -> [cropped PDF] -> [any format to taste, say, PNG].

For each step there are different solutions. For example, PS can be obtained using a2ps. Or directly to PDF using a pseudo printer PDF CUPS. For other steps there are all sorts of utilities such as ps2eps, epstopdf, epspdf, pdfcrop...
Thank you, kind person!!! :)
Live and learn.... - halie47 commented on June 7th 19 at 14:44

Find more questions by tags LinuxImageMagickScreenshots