开发者

print to file from c#

开发者 https://www.devze.com 2022-12-15 04:24 出处:网络
How can I generate a .pcl file from c# ? Suppose i have a text file, or an xls file and I want to print it, I can check the print to file chekbox a开发者_开发知识库nd i get a file with extension .pcl.

How can I generate a .pcl file from c# ? Suppose i have a text file, or an xls file and I want to print it, I can check the print to file chekbox a开发者_开发知识库nd i get a file with extension .pcl. How can I achieve this from code, from c#? Most printer drivers know to generate pcl as I've seen.


Your question is much too vague to allow a good answer. There are many variants and versions of PCL. Best thing to do is to install the printer driver of a HP device that's similar to the whatever device is going to use the .pcl. If that's unspecified, pick a HP laser printer that as old as possible.

Generate the file by using the PrintDocument class. You'll need to set the PrinterSettings.PrintToFile property to True and assign PrinterSettings.PrintFileName.

0

精彩评论

暂无评论...
验证码 换一张
取 消