printing

Google JavaScript API - Chrome.printerProvider: Printer id format

▼魔方 西西 提交于 2021-01-29 06:20:58
问题 I trying to use chrome.printerProvider to make a printing extension. Can anyone give me an example about PrintInfo id ? I'm request print via network and I setting PrintInfo Id by printer address but it's not working. Here is my script: chrome.printerProvider.onGetPrintersRequested.addListener(function callback(resultCallback) { resultCallback([{ id: '192.16.1.18', // printer address name: 'My Printer', }]); }); or chrome.printerProvider.onGetPrintersRequested.addListener(function callback

Print pdf in duplex mode From C#

ⅰ亾dé卋堺 提交于 2021-01-29 05:52:03
问题 I have a pdf file that I would like to print from my C# app. I was able to figure out in code if the printer is duplex capable but get the pdf to print in duplex from my code. Here is my code for regular simplex printing. I was able to check the metadata of the pdf's print dialog preset to duplex. but it does not work. string verbToUse = "PrintTo"; startInfo.Verb = verbToUse; startInfo.Arguments = workCenterPrinterName.Value.ToString(); Process p = Process.Start(startInfo); p.WaitForExit(5000

Print pdf in duplex mode From C#

时间秒杀一切 提交于 2021-01-29 05:52:02
问题 I have a pdf file that I would like to print from my C# app. I was able to figure out in code if the printer is duplex capable but get the pdf to print in duplex from my code. Here is my code for regular simplex printing. I was able to check the metadata of the pdf's print dialog preset to duplex. but it does not work. string verbToUse = "PrintTo"; startInfo.Verb = verbToUse; startInfo.Arguments = workCenterPrinterName.Value.ToString(); Process p = Process.Start(startInfo); p.WaitForExit(5000

PrintTicket DllHost.exe Memory Climbs

假装没事ソ 提交于 2021-01-29 05:25:28
问题 I'm using PrintTickets to print a large number of WPF objects and things are printing fine. We do have a situation that has been reported where the program is using a ton of the dllhost.exe memory and climbs until the machine eventually crashes. I've narrowed it down to creating a PrintTicket and the printqueue.getprintcapabilitiesasxml() . Each time these are called it jumps the memory usage of the dllhost.exe each time by sometimes 3+ MB. Can anyone tell me either how to avoid this if

Printing with PHP - Different font sizes?

好久不见. 提交于 2021-01-29 05:20:04
问题 I work at a school and am writing a wizard-style front end for our helpdesk. Students will grab the tablet, fill in their name, pick the issue they're having and a ticket will be opened on the system. We have a receipt printer shared at the desk and using PHP's printer_* functions, I'm able to print out simple receipts using RAW mode. The student will take the receipt back to class to show the teacher as proof they were with us. So far my code works great: $handle = printer_open("EPSON TM

Close Application after WebBrowser print

前提是你 提交于 2021-01-29 04:10:02
问题 I tried to print formatted HTML using WebBrowser class. After the print, I want to close the application. If I tried to use close the application the printing is not working. I tried using the timer also nothing works. Please find the code below. static void Main(string[] args) { var b = new Program(); string appPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath); b.runBrowserThread("file://" + appPath + "/receipt.html"); } private void runBrowserThread(string url) { var th =

WebBrowser, wait until finished printing

一个人想着一个人 提交于 2021-01-29 03:11:49
问题 I'm working with the WebBrowser control in C#. I use the WebBrowser in a form and I insert some HTML and CSS into this WebBrowser. It works well. I would like to print from this WebBrowser directly and check the print status. If it finishes, the application will close automatically. I searched for something like: WebBrowser.Print() wait until complete. .NET. It works, but when I'm in debug mode, my code never goes through the event "DocumentCompleted". So I tried printing in form's Shown

Print file to continuous paper using win32print Python

亡梦爱人 提交于 2021-01-29 02:42:09
问题 I want to print a file to the continuous paper using win32print in Python, but I have a problem in the set of the paper size .. When I following the code from: here the paper size always use A4 paper , I changed the paper size and the form name but nothing changed. import win32print import win32ui import win32con devmode.PaperSize = 50 devmode.PaperLength = 50 devmode.PaperWidth = 50 devmode.Orientation = 1 printer = win32print.GetDefaultPrinter() hprinter = win32print.OpenPrinter(printer)

Python: Parse from list only prints last item, not all?

我怕爱的太早我们不能终老 提交于 2021-01-29 02:22:50
问题 My code: from urllib2 import urlopen from bs4 import BeautifulSoup url = "https://realpython.com/practice/profiles.html" html_page = urlopen(url) html_text = html_page.read() soup = BeautifulSoup(html_text) links = soup.find_all('a', href = True) files = [] base = "https://realpython.com/practice/" def page_names(): for a in links: files.append(base + a['href']) page_names() for i in files: all_page = urlopen(i) all_text = all_page.read() all_soup = BeautifulSoup(all_text) print all_soup The

Python: Parse from list only prints last item, not all?

烂漫一生 提交于 2021-01-29 02:05:33
问题 My code: from urllib2 import urlopen from bs4 import BeautifulSoup url = "https://realpython.com/practice/profiles.html" html_page = urlopen(url) html_text = html_page.read() soup = BeautifulSoup(html_text) links = soup.find_all('a', href = True) files = [] base = "https://realpython.com/practice/" def page_names(): for a in links: files.append(base + a['href']) page_names() for i in files: all_page = urlopen(i) all_text = all_page.read() all_soup = BeautifulSoup(all_text) print all_soup The