tags:

views:

537

answers:

2

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 and 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.

A: 

Have a look at this:

http://support.microsoft.com/kb/322091

I hope it will help you.

Tony
+1  A: 

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.

Hans Passant
thanks, PrinterSettings.PrintToFile was the hint i needed.