printing

How to get all available Paper Feeds and how to change it in NSPrintInfo obj

我的梦境 提交于 2021-02-11 04:29:54
问题 I'm trying to set the paper feed in a NSPrintInfo object By now, I'm obtaining the paper feed options (from now on trays) from an IPP call ipp_t *request; request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); respose = cupsDoRequest(http, request, "/"); ... string trays = ippGetString(ippFindAttribute(response, "media-source-supported", IPP_TAG_KEYWORD), 0, NULL); This returns me a comma-separated string

Use Node js to to print data to thermal printer

旧时模样 提交于 2021-02-10 21:55:29
问题 I'm developing an application with Node JS where I need to see all available printers in the user's machine, let the user select one of them and print a receipt. Is there a way to achieve this in macOS and Windows ? Note , I have checked all examples in internet,nothing helped. Kindly provide me an complete example. 回答1: In googling there are few libraries that does this job... Take a look on printer for example, it does all the jobs you require... getPrinters() to enumerate all installed

How to Determine Which Printers are Connected using WMI

ぃ、小莉子 提交于 2021-02-10 18:41:57
问题 I've been trying to find a way to figure out which installed printers are 'connected'. After some Googling I figured I had to dive into WMI. So I've built this test: // Struct to store printer data in. public struct MyPrinter { public string Availability; public string ExtendedPrinterStatus; public string Name; public string PrinterStatus; public string Status; public string StatusInfo; public MyPrinter(string a, string eps, string n, string ps, string s, string si) { Availability = a;

Rawprinterhelper network printer ASP.NET MVC

江枫思渺然 提交于 2021-02-10 15:21:20
问题 I'm having trouble trying to print a document from a ASP.NET MVC3 application using RawPrinterHelper (the printer support class developed by Microsoft). I need to send RAW data to a printer which is locally connected to a computer in the network. In my development environment (MS Visual Studio 2010) everything works well. I installed the printer in my OS as a network printer and I pass the name of that printer to RawPrinterHelper. On the real test server things don't work at all. The OS is

macOS Printing in Swift

£可爱£侵袭症+ 提交于 2021-02-10 14:32:21
问题 Please note this is not an iOS question. I have an NSView-based app (i.e. not document-based), and I’d like to bolt on a printing subsystem. I can get NSViews in my main controller to print ok. However, I want to have a special view constructed just for printing. The view should not show in the app’s window. The view contains two NSTextFields, two NSTextViews, and 5 labels. I cannot seem to figure out a way to do this. I have tried various forms of these examples: Add an NSView to my main

macOS Printing in Swift

自闭症网瘾萝莉.ら 提交于 2021-02-10 14:31:14
问题 Please note this is not an iOS question. I have an NSView-based app (i.e. not document-based), and I’d like to bolt on a printing subsystem. I can get NSViews in my main controller to print ok. However, I want to have a special view constructed just for printing. The view should not show in the app’s window. The view contains two NSTextFields, two NSTextViews, and 5 labels. I cannot seem to figure out a way to do this. I have tried various forms of these examples: Add an NSView to my main

Add Duplex option for certain pages in postscript file using ghostscript

不羁岁月 提交于 2021-02-10 13:00:07
问题 I have a pdf file with 3 pages. I want to print first page as simplex and second & third page as duplex(double-sided - second on the front, third on the back). How can I generate the required postscript with ghostscript. I found the below solution on the internet and it works, but it makes the whole document as duplex. gswin64c.exe -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile=output.ps -c "<</PSDocOptions (<</Duplex true>> setpagedevice)>> setdistillerparams" -f input.pdf Above

How to Print Page Number in Print Preview in html page contains table

放肆的年华 提交于 2021-02-10 12:55:31
问题 here i have some of the tables , i need to print this html page, with page number,the table content may differ dynamically, i unable to print the page number dynamically ,I have tried so many ways but i unable to find solution yet. I need to Print page Number like "Page no 2/6" Below is my html sample <style> .page { page-break-before:always; } @page { size: A4; margin: 0; } @media print { @page { size: A4; margin: 0; } } </style> <table class='page'> <tr><td></td></tr>.... </table> <table

How to Print Page Number in Print Preview in html page contains table

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-10 12:52:06
问题 here i have some of the tables , i need to print this html page, with page number,the table content may differ dynamically, i unable to print the page number dynamically ,I have tried so many ways but i unable to find solution yet. I need to Print page Number like "Page no 2/6" Below is my html sample <style> .page { page-break-before:always; } @page { size: A4; margin: 0; } @media print { @page { size: A4; margin: 0; } } </style> <table class='page'> <tr><td></td></tr>.... </table> <table

Printing TableView Contents in JavaFX

♀尐吖头ヾ 提交于 2021-02-10 11:47:50
问题 I am learning JavaFX. I created my TableView and populated it with data. I added a Button such that when it is clicked, the table contents can be printed. Here is the whole code for : `public final class TableViewSample2 extends Application { private TableView<Person> table; private ObservableList<Person> list; public void createTable() { table = new TableView<>(); table.setEditable(true); list = FXCollections.observableArrayList( new Person("Jacob", "Smith", "jacob.smith@example.com"), new