另一个问题开始问我的问题:https://msdn.microsoft.com/en-us/library/aa394363(v=vs.85).aspx
如果有人读到这个,那么最初的问题是PaperType变量,它应该是普通的,标签的,预印的等...
我使用powershell来查看.net,但我仍然找不到PaperType,虽然它似乎向我显示了其他所有内容...... :(如链接问题中所述,WMI确实有一个当前/默认PaperType,但它的空白。
我想做什么:获取现有的打印队列,复制变量:名称,默认托盘,双面,注释,PaperType。更改驱动程序,然后重新设置变量。除了paperType,我一切都在工作。
有没有人有任何想法?
$Printer = new-object System.Drawing.Printing.PRinterSettings
$Printer | GM
输出:
Name
Clone
CreateMeasurementGraphics Equals
GetHashCode
GetHdevmode
GetHdevnames
GetType
IsDirectPrintingSupported SetHdevmode
SetHdevnames
ToString
CanDuplex
Collate
Copies
DefaultPageSettings
Duplex
FromPage
IsDefaultPrinter
IsPlotter
IsValid
LandscapeAngle
MaximumCopies
MaximumPage
MinimumPage
PaperSizes
PaperSources
PrinterName
PrinterResolutions
PrintFileName
PrintRange
PrintToFile
SupportsColor
ToPage
$Printer.DefaultPageSettings
Name
Clone
CreateMeasurementGraphics Equals
GetHashCode
GetHdevmode
GetHdevnames
GetType
IsDirectPrintingSupported SetHdevmode
SetHdevnames
ToString
CanDuplex
Collate
Copies
DefaultPageSettings
Duplex
FromPage
IsDefaultPrinter
IsPlotter
IsValid
LandscapeAngle
MaximumCopies
MaximumPage
MinimumPage
PaperSizes
PaperSources
PrinterName
PrinterResolutions
PrintFileName
PrintRange
PrintToFile
SupportsColor
ToPage
$Printer.DefaultPageSettings.PrinterSettings
Name
Clone
CreateMeasurementGraphics Equals
GetHashCode
GetHdevmode
GetHdevnames
GetType
IsDirectPrintingSupported SetHdevmode
SetHdevnames
ToString
CanDuplex
Collate
Copies
DefaultPageSettings
Duplex
FromPage
IsDefaultPrinter
IsPlotter
IsValid
LandscapeAngle
MaximumCopies
MaximumPage
MinimumPage
PaperSizes
PaperSources
PrinterName
PrinterResolutions
PrintFileName
PrintRange
PrintToFile
SupportsColor
ToPage