public ProcessData ( PrintTicket ticket, byte data, string driver, string inargs, string devsetup ) : byte[] | ||
ticket | PrintTicket | |
data | byte | |
driver | string | |
inargs | string | |
devsetup | string | |
Результат | byte[] |
public override void Print(CloudPrintJob job) { using (Ghostscript gs = new Ghostscript()) { PrintTicket printTicket = job.GetPrintTicket(); byte[] printData = job.GetPrintData(); List<string> args = new List<string>(); args.Add("-dAutoRotatePages=/None"); if (printTicket.OutputColor != OutputColor.Color) { args.Add("-sColorConversionStrategy=Gray"); args.Add("-dProcessColorModel=/DeviceGray"); } byte[] printdata = gs.ProcessData(printTicket, printData, "pdfwrite", args.ToArray(), null); WindowsRawPrintJob pj = new WindowsRawPrintJob { JobName = job.JobTitle, UserName = job.Username, PrinterName = job.Printer.Name, PrintData = printdata, RunAsUser = true }; pj.Print(); } }
protected void PrintData(string username, PrintTicket ticket, string printername, string jobname, byte[] data, string driver) { using (Ghostscript gs = new Ghostscript()) { if (driver != null) { byte[] outdata = gs.ProcessData(ticket, data, driver, null, null); WindowsRawPrintJob pj = new WindowsRawPrintJob { JobName = jobname, PrinterName = printername, UserName = username, PrintData = outdata, RunAsUser = true }; pj.Print(); } else { gs.PrintData(username, ticket, printername, jobname, data, new string[] { }); } } }
protected void PrintData(string username, PrintTicket ticket, string printername, string jobname, byte[] data, Dictionary<string, string> pjljobattribs) { using (Ghostscript gs = new Ghostscript()) { string driver = ticket.OutputColor == OutputColor.Color ? "pxlcolor" : "pxlmono"; byte[] pcldata = gs.ProcessData(ticket, data, driver, null, null); PaginatedPrintData pcljob = ProcessPCL(pcldata, pjljobattribs, ticket); WindowsRawPrintJob job = new WindowsRawPrintJob { PagedData = pcljob, JobName = jobname, PrinterName = printername, UserName = username, RunAsUser = true }; job.Print(); } }