Created
November 18, 2020 20:56
-
-
Save BrianMRO/e0a142900050eadcff50c4391a7ea75c to your computer and use it in GitHub Desktop.
DHPrint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// DHPrint - DeviceHub Print - Sends an uploaded file to a printer via Device Hub | |
/// </summary> | |
/// <param name="mergedFile">The label control file (as PX.SM.FileInfo)</param> | |
/// <param name="printer">The SMPrinter for the Device Hub PrinterID</param> | |
public static void DHPrint(FileInfo mergedFile, SMPrinter printer) | |
{ | |
Dictionary<string, string> parameters = new Dictionary<string, string> { { | |
"FILEID", | |
mergedFile.UID.ToString() | |
} }; | |
string description = "Label"; | |
PrintSettings printSettings = new PrintSettings() { | |
PrinterID = printer.PrinterID, | |
NumberOfCopies = 1, | |
PrintWithDeviceHub = true, | |
DefinePrinterManually = false | |
}; | |
PXGraph.CreateInstance<SMPrintJobMaint>().CreatePrintJob( | |
printSettings, | |
(string)null, | |
parameters, | |
description | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment