printing

Encoding date in Zebra printer

五迷三道 提交于 2019-12-13 19:59:56
问题 I need to encode "date field" in my Zebra M4Plus printer from UTF-8 to UTF-16. For this I need to use "required translation table". In documentation I found this: ~DER:JIS.DAT,27848,300021213001... But I don-t know what is JIS.DAT and why 27848. This is my code example: qz.append("^XA"); qz.append("^FO160,635"); qz.append("^A@R,30,30,E:TT0003M_.FNT"); qz.append("~DER:.DAT,27848,Данные для вывода^FS"); - it not work. Printer go to offline. Who has experience with this, help please. 回答1: Please

on Linux, printing function addresses always prints 1 (c++)

空扰寡人 提交于 2019-12-13 18:36:13
问题 I'm developing a c++ program that is dealing with addresses for different variables and functions. When I compiled my program on a Linux based OS, all functions including the main get the address of 1 instead of an 8 digit hexa number like other variables, which did not happen in Windows. I wrote this small piece of code to explain the issue #include <iostream> using namespace std; void Function1(); void Function1() { } int main() { int tmp; void (*a) ()=&Function1; cout<<a<<endl; cout<<

Zebra Printer - Cut on last page

笑着哭i 提交于 2019-12-13 18:34:32
问题 I've a Zebra ZT610 and I want to print a label, in pdf format, containing multiple pages and then have it cut on the last page. I've tried using the delayed cut mode and sending the ~JK command but I'm using a self written java application to do the invocation of printing. I've also tried to add the string "${^XB}$" into the PDF document before each page break, except the last, and used the pass-through setting in the driver to inhibit the cut command but that seems to not work either as the

How to print multiple copies of a file using win32com (or an alternative)

独自空忆成欢 提交于 2019-12-13 18:21:13
问题 I'm trying to send multiple copies of a file to a printer using the win32com library. Printing a single copy works fine, but it appears the Copies parameter doesn't affect the number of copies printed (even if I put Copies=2, as below, it only ever prints out a single page). from win32com import client word = client.Dispatch("Word.Application") word.Documents.Open(file_to_print) word.ActivePrinter = printer word.ActiveDocument.PrintOut(Copies=2) word.ActiveDocument.Close() word.Quit() If this

Using sed to print between delimiters

余生长醉 提交于 2019-12-13 18:14:34
问题 This is an extension of my previous question recommended by the answerer. Basically, I need sed to print text between delimiters. The delimiters could span multiple lines like: (abc d) Below are sample input and output. Input (123) aa (a(b)cd)) (g) (c)fff abcd(aabb d)aa (aeb)oe correct output 123 a(b aabb d Note: I only want the text between the first pair of delimiters. If the delimiter spans two lines than I just want the text between first pair that span two lines and move on to the third

Getting default printer change notification using c++ in Windows service

橙三吉。 提交于 2019-12-13 18:00:15
问题 I need to tap default printer change notification, is it possible? My scenario is that I want to execute a command whenever default printer is changed in window. What my command does is, it just takes default printer information from registry and save it in HKLM. So, I have a service for this. Using this service, how can i tap notifications whenever a default printer is changed. I am using C++. 回答1: From a regular application, I would listen for a WM_SETTINGCHANGE message and then call

ASCII raw symbols to control a printer from a .txt file

♀尐吖头ヾ 提交于 2019-12-13 16:41:11
问题 A label printer is controled by sending a string of raw ASCII characters (which formats a label). Like this: string s = "\x02L\r" + "D11\r" + "ySWR\r" + "421100001100096" + date + "\r" + "421100002150096" + time + "\r" + "421100001200160" + price + "\r" + "E\r"; RawPrinterHelper.SendStringToPrinter(printerName, s); This hardcoded variant works well. Now I want to put the control string to a .txt file and read it during runtime. Like this: string printstr; TextReader tr = new StreamReader(

Unable to open the PDF, which was generated using print to pdf code written in C#

心已入冬 提交于 2019-12-13 15:54:46
问题 I used C# to print a file to PDF using Microsoft Print to PDF printer. The file was successfully generated. But I am not able to open that because Adobe Reader says that the file is damaged. This is the code PrintDocument pd = new PrintDocument { PrinterSettings = new PrinterSettings { PrinterName = "Microsoft Print to PDF (redirected 2)", PrintToFile = true, PrintFileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/test.pdf" } }; pd.PrintPage += new

how to print a QGraphicsScene that has text and graphics

拥有回忆 提交于 2019-12-13 15:13:16
问题 I have a QGraphicsScene that has graphics as well as text drawn on it. When I try to print, the graphics are fine, but the text is using a font size defined in points, so scene->render() when I pass it a QPainter initialized with a QPrinter , has VERY large text. How am I supposed to print a QGraphicsScene that has text on it? edit: Here is my current printing code, where scene_ is my custom subclass of QGraphicsScene : QPrinter printer(QPrinter::HighResolution); QPrintDialog dialog(&printer,

Supplementary properties/settings for JavaScript:window.print() to enable Backgrounds by default

烂漫一生 提交于 2019-12-13 14:16:20
问题 I would like tot give my Print this Page button a special magical property sothat it automatically enabled the by default unset property (see picture) namely to Do Print the Backgrounds of div colors and bg images etc. <a href="#" onclick="javascript:window.print()"><? echo __('Print'); ?></a> Clues, ideas, code, answers or suggestions as answers are all tremmendously welcome and I a will appreciate any hints at all for this dream to come true. Thanks in advance. 回答1: This cannot be done,