pdf - Print on envelopes using Ghostscript with VB.NET Windows Form Application -


i need print 2 page pdf. 1st page needs envelope , 2nd page need print regular piece of paper normal. can in 2 separate pdf's question is: how can set printer use envelope using ghostscript? has ever done this? couldnt find exact parameter needed in order accomplish this. have tried several different things , still prints regular sheet of paper , wont use envelope tray holds envelopes. looks need change mediatype not know parameter that. ideas? suggestions on how accomplish using vb.net/c#? heres code have without parameters dealing envelopes. envelope size 9.5 x 4.15 inches. standard envelope. have tried setting -spapersize=c6 in hopes close enough trigger envelope tray still no luck.

        dim psinfo new processstartinfo()         psinfo.arguments = string.format(" -dprinted -dnocancel=true -dbatch -dnopause -dnosafer -noquery -all -dnumcopies=1 -sdevice=mswinpr2 -soutputfile=""%printer%{0}"" ""{1}""", printername, pdffilename)         psinfo.filename = "c:\program files\gs\gs9.15\bin\gswin64c.exe"         psinfo.redirectstandarderror = true         psinfo.redirectstandardoutput = true         psinfo.useshellexecute = false         dim p system.diagnostics.process = system.diagnostics.process.start(psinfo)         dim s string = p.standarderror.readtoend &      p.standardoutput.readtoend         'system.threading.thread.sleep(15000)         p.waitforexit(15000)         if p.hasexited = false             p.kill()         end if 

when using mswinpr2 device, of ghostscript command line more or less unrelated physical printer. various command line options affect behaviour of ghostscript postscript interpreter, device-specific parameters affect device.

the mswinpr2 device not alter tray/media selection of device (unless set query user print properties on each print). uses printer defaults instead.

in order print on envelope media, need set printer default setting envelope.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -