Easily Printing (on paper) text files

I am currently working on GUI in guide that parses data from a text file and plots it. I have been able to print the resulting figure however I would also like the program to print the raw text files along with the graph. Matlab is able to print out text files from the editor with the option to include a header/highlight code etc. but I can not find documentation on how to do this programmatically. Is there a way to open an invisible editor window and tell it to print, similar to how you print figures displayed in a gui?
% copies axes on gui to an invisible figure then prints to default printer
printfig = figure('Visible', 'off');
copyobj(handles_to_axes_in_gui, printfig)
print

답변 (1개)

Jan
Jan 2011년 3월 9일

1 개 추천

Perhaps this helps:
Then you have to create a HMTL file at first.
ADDED: Under Windows you can install the Generic/Text only printer driver. Under Linux lpr can print text directly also.

댓글 수: 1

Will
Will 2011년 3월 10일
Sending the output to internet explorer might function as a work around but re-saving the file with html headers and relying on another program to print it then deleting the extra file seems like a long way around a simple problem and it creates external dependencies. I am surprised that there does not seem to be a simple way to print text to printers from matlab code. I can think of many scenarios where you would run a program, generate some output and want to directly print a hard copy summary as opposed to saving it to a file and printing it manually.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Language Support에 대해 자세히 알아보기

제품

질문:

2011년 3월 9일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by