sstassin
sstassin

Reputation: 388

.net Printing with staple

In my project i have to print a liste of images files (.png) with differents settings, and i ca do it without problem using the native .Net System.Drawing.Printing.PrintDocument classe :

The only thing i am not able to do is to define the Stapling property ?? After spending a lot of time of searching, i am very dissapointed on how to do this :

But if the solution is to use the print ticket class, i 've two others questions :

  1. How do i attach the printing of an existing image file (using a printjob, a PrintDocument ???)
  2. Are thoses classes only available for using XPS document ?

Important constraint : there is no GUI (because the program prints a lot of files in batch mode), so the user cannot change interactivly the staple option.

Upvotes: 3

Views: 1234

Answers (1)

sstassin
sstassin

Reputation: 388

Finally, after spending few more hours of search, i've found the right answer to get and set specific printer settings.

Thanks to this Good Article, i did understand that in order to get/set all the settings of a printer, i have to deal with the DevMode structure of the printer.

Drawbacks :

  • the DevMode structure is specific to a driver, and also to an operating system
  • you have to maintain a list of DevMode address for each parameters you want to change

Benefits :

  • you can access all the functions offered by a printer (even printing on tee-shirt, or saving mode....)
  • the project in the link show a small interface to get/set/examine what parameter have been changed using the Pinter Dialog Settings window. So you yan easily by code change on the fly

Upvotes: 1

Related Questions