printing

Confirm successful print programmatically in windows

本秂侑毒 提交于 2019-12-19 03:16:42
问题 My company is developing a financial application. Now we have to deal with a new law that demands that we take different actions whether a receipt is printed or not. The receipts are printed on a laserprinter on A4 paper using the standard print queue in windows. Is there any way to programmatically check if a certain print job actually has succeeded? The module requiring this is developed in c#. 回答1: I am not aware of a fully managed way to perform this. Interop with

How to print pdf file in Qt

限于喜欢 提交于 2019-12-19 03:13:36
问题 I have tried to write some code to print a pdf file using Qt but somehow it's not working. If anybody has any idea to solve this problem, please provide your tips. void ChartViewer::onprintBtnClicked(){ String filename = QFileDialog::getOpenFileName(this,"Open File",QString(),"Pdf File(*.pdf)"); qDebug()<<"Print file name is "<<filename; if(!filename.isEmpty()) { if(QFileInfo(filename).suffix().isEmpty()) filename.append(".pdf"); QPrinter printer(QPrinter::HighResolution); printer

UWP Printing from Windows app directly without bringing Print Dialog

血红的双手。 提交于 2019-12-18 22:22:05
问题 Does POS printer just support Epson printers? (related to https://msdn.microsoft.com/en-us/library/windows/apps/mt426652) How to send a document directly to the printer without showing Print Dialog? 回答1: ESC/POS is a command system created by Epson used across a wide range of POS printer systems, aimed at avoiding incompatible command sets by providing universal applicability. Most modern printers support ESC/POS. So, for your first question, I think the answer is no. This POS printer API can

Java printing: creating a PageFormat with minimum acceptable margin

浪尽此生 提交于 2019-12-18 21:14:16
问题 I'm trying to get the PageFormat correct when I print. Below is an example program that shows my dilemma: I get a different result when I use printJob.setPrintable(printable) than when I use printJob.setPageable(book) when I create a Book object using the default PageFormat from the Print job. When I run it, and click "Print", then "Print using Book", I see this console output: doPrint(false) printing on 612.000000x792.000000 paper, imageable area=588.960000x768.960000 printing on 612

Trigger resize event on print

别等时光非礼了梦想. 提交于 2019-12-18 19:15:10
问题 I have a div in which I create a chart using protovis. The div has width: 100% and height: 100% and the code to create the chart uses $('#chart').width() and $('#chart').height() to get the size of the div at render time and fill the page with the chart. I capture the resize event on the window and adjust the div and the chart so that it resizes when the window resizes. Now I need to print. I would have hoped that when the browser is rendering the page for the printer it issues a resize but

Pretty printing a list in a tabular format

女生的网名这么多〃 提交于 2019-12-18 18:39:02
问题 Using Python 2.4, how do I print a list in a nice tabular format? My list is in the below format. mylist=[(('VAL1', 'VAL2', 'VAL3', 'VAL4', 'VAL5', 'VAL6'), AGGREGATE_VALUE)] I have tried pprint , but it does not print the result in a tabular format. EDIT : I would like to see the output in the below format: VAL1 VAL2 VAL3 VAL4 VAL5 VAL6 AGGREGATE_VALUE This table, should account for variable item lengths and still print with proper indentation. 回答1: mylist = [ ( ('12', '47', '4', '574862',

printing dynamically string in one line in python

烂漫一生 提交于 2019-12-18 18:36:20
问题 I'm trying to print strings in one line. I've found solutions but they don't works with windows correctly. I have text file contains names and I want to print them like this name=john then change john to next name and keep name= , I've made this code but didn't work correctly with windows: op = open('names.txt','r') print 'name=', for i in op.readlines(): print '\r'+i.strip('\n') thank you for your time 回答1: Using '\b' as suggested by senderle import sys import time sys.stdout.write('name=')

WebBrowser Control - Console Application - Events Not Firing

岁酱吖の 提交于 2019-12-18 18:30:23
问题 I have been navigating the various WebBrowser control stackoverflow questions, and I can't seem to find an answer to a problem I am having. I am trying to use the WebBrowser control to print a web page. Following MSDN's example, I have created the following console application: namespace WebPrintingMadness { using System; using System.Collections.Generic; using System.Text; /// <summary> /// The entry point of the program. /// </summary> class Program { /// <summary> /// The main entry point

Correct way to send commands directly to printer!

被刻印的时光 ゝ 提交于 2019-12-18 18:04:26
问题 Ok, here is how i do it: procedure TMainWindow.btnRawPrintClick(Sender: TObject); begin BeginPrint; SendStr(#27#69); SendStr('MyData'); SendStr(#10); EndPrint; end; procedure TMainWindow.SendStr(Text: String); var i: Integer; data : Array of Char; begin for i := 1 to Length(Text) do begin SetLength(data,i); data[Pred(i)] := Text[i]; end; if (PrintRawData(printHandle, data, Length(data)) < 0) then begin ShowMessage('PrintRawData Failed'); EndRawPrintPage(printHandle); EndRawPrintJob

PDF printing view issue

怎甘沉沦 提交于 2019-12-18 17:29:31
问题 I have tried in two ways, 1) Am creating a WebView and loading my pdf document, and my application is almost done with its part of the printing process. But in that am facing printing issue. Its not with full A4 sheet view.Can anyone please help,The following code i have used, public void createWebPagePrint(WebView webView) { PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE); PrintDocumentAdapter printAdapter = null; if (Build.VERSION.SDK_INT >= Build.VERSION