Saving Printer Settings

What is the best way to save / save printer settings in .Net? There used to be an error in .Net 1.1 in object serialization PrinterSettingand there were some workarounds , but I wonder if there is no better or easier way to do this in later versions of the framework.

The main use case is to allow the user to determine all the print data (including printer settings) for this printer using the standard user interfaces of the printer and save them so that they are restored the next time the user prints to this printer.

+3
source share
4 answers

- DEVMODE , , - . , API (, Fiery... , XPS , , ).

, . , . , , , .

!

+4

PrinterSettings.

+1

: r2 r2 . , API , .net.

0

PrinterSetting PrintFileName.

, .

PrinterSettings Reportviewer

Me.ReportViewer.PrinterSettings.PrintFileName = "abc"
My.Settings.PrinterSettings = Me.ReportViewer.PrinterSettings
My.Settings.Save()

If My.Settings.PrinterSettings IsNot Nothing Then Me.ReportViewer.PrinterSettings = My.Settings.PrinterSettings

In any case, saving the PrinterSetting parameter will be saved only in the standard value. You must use DEVMODE if you want to preserve the exotic things that each of them has.

0
source

Source: https://habr.com/ru/post/1697895/


All Articles