0

I have files I need to drive thru a print driver and save then as files. Can I programactly use the DevMode Structure to drive these files without openning the application it was created in? Also can I change the DevMode Structure values to change to other file types programmatically and continue to drive them and save them to files?

robblot
  • 395
  • 2
  • 5
  • 15

1 Answers1

1

When you say "you have files you want to drive thru a print driver" - I assume you mean these files are input (document) files like a Word document, a Text file, a .jpg file etc, correct? If so, then I guess your idea wont hold good. DEVMODE is a driver structure used by the print driver to communicate to the application. It has the settings which are needed for printing the job. However, the application creates the print job by actually converting its content into the GDI format which is then passed to the print driver which converts it into the printer format. So for eg: A Word doc is read by the Word application, its content converted to GDI API calls and sent to GDI which then sends it to the driver which converts it into the printer language (say PCL or PS).

If you can give more details on why you want to do this, I can help you out

Nitin Unni
  • 358
  • 1
  • 6
  • Hi & Thank You: I have .pdf, .jpg, .docx, xlxs, .cdr files I use to test printer functions with. Right now I am using vb script to convert these files but the operation takes such a long time. These files ate run in duplex and simplex modes and I use the different paper sizes, eg: Letter, A4, legal,statement, and various other paper sizes. And I need them in XL & PST formats. – robblot Feb 25 '11 at 00:03
  • By XL, I assume you mean PCL6 (PCL-XL) format. Not clear what you mean by PST format. Output of a printer driver is a printer language file format (like PCL, Postscript). So if your objective is to run these files through a print driver, my suggestion is to use a tool like HP QTP (Quick Test Pro) and automate the firing of these files. Mucking around with the devmode is really pretty difficult. – Nitin Unni Feb 28 '11 at 17:49
  • If you still want to use something like .NET, have a look at the "Print" verb. Some useful links http://www.eggheadcafe.com/software/aspnet/30441939/how-to-suppress-printdialog-when-using-print-verb.aspx. – Nitin Unni Feb 28 '11 at 17:50