printing

Printing a BufferedImage in Java

最后都变了- 提交于 2019-12-20 04:23:32
问题 Does anyone know how to print a BufferedImage in Java? 回答1: Printing is just like drawing on the screen, so eventually you get a Graphics object, and you just drawImage into it. 回答2: I'm not sure what you mean by print. Print on a printer? Print to standard out? Write to a file? You can check out this tutorial from sun. If you're looking to write to a file. Open in your favorite image tool and print from there. http://download.oracle.com/javase/tutorial/2d/images/saveimage.html If you're

Is it possible to send a file to a printer with a batch file?

余生长醉 提交于 2019-12-20 03:30:44
问题 How can I use a batch file to send a text file or a .doc or similar, to a printer plugged into the computer through a USB port? 回答1: Also to get the printer name: wmic printer get name /value | findstr Name It will list all printers like: Name=PDF Name=Microsoft XPS Document Writer Name=Fax And if you know part of the name, you may include it in a variable dynamically with FOR . @echo off for /f "tokens=2 delims==" %%a in ( 'wmic printer get name /value ^| findstr PartOfThePrinterName' ) do (

Programmatically print multiple copies from command line

不羁岁月 提交于 2019-12-20 03:08:46
问题 My application generates between 35 and 55 PDF files of which I have to automatically print four copies. All these files are in a single folder. My requirement is to use a batch file to print four copies of each file. I have Adobe Acrobat Reader installed. How do I do this? 回答1: Adobe Reader is only capable of printing a single copy directly. However, nothing prevents you from looping and printing it 4 times. It may take longer, though, since the document has to be sent to the printer four

Python3 - Use a variables inside string formatter arguments

主宰稳场 提交于 2019-12-20 03:03:36
问题 I have some formatted columns that I'm printing. I would like to use the following variables to set the lengths in my .format arguments number_length = 5 name_length = 24 viewers_length = 9 I have print('{0:<5}{1:<24}{2:<9}'.format(' #','channel','viewers'), end = '') Ideally I would like something like print('{0:<number_length}{1:<name_length}{2:<viewers_length}'.format( ' #','channel','viewers'), end = '') But this gives me an invalid string formatter error. I have tried with % before the

IE8 Printing issues with Jqplot

蓝咒 提交于 2019-12-20 02:15:34
问题 I am testing jqplot with IE8. When I tried to print, the axes labels were offset. I used Andrew Bullock's Canvashack as a workaround.(http://blog.muonlab.com/2010/06/02/getting-position-absolute-canvas-elements-to-print-correctly-in-ie/) It still did not fix the issue. I am new to scripting. Is there anything wrong with my code? Please help. Thanks, Shu <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http:/

tput cup in python on the commandline

点点圈 提交于 2019-12-20 01:49:30
问题 Is there an elegant solution to do this shell script in Python without importing os ? tput cup 14 15; echo -ne "\033[1;32mtest\033[0m" ; tput cup 50 0 This just has been gnawing in my mind for some time now :) Thanks 回答1: All the terminfo capabilities are accessible via curses. Initialize it and use curses.tiget*() to get the capabilities you care about. 回答2: Thanks Ignacio Vazquez-Abrams for your input, it was a great push in the right direction. In the end i came up with this little code

window.matchMedia('print') failing in Firefox and IE

女生的网名这么多〃 提交于 2019-12-20 01:43:52
问题 I have a print button that launches the print functionality on any webpage. The button hides as soon as the user clicks on it and shows if the user is done printing or presses close in the print window. It works fine in Chrome but is failing in firefox and IE. <input type="button" onclick="launchPrint()" value= "Print me" /> function launchPrint(){ $(".print-box").hide(); window.print(); } (function() { if (window.matchMedia) { var mediaQueryList = window.matchMedia('print'); mediaQueryList

Printing UTF-8-encoded byte string

情到浓时终转凉″ 提交于 2019-12-20 01:35:28
问题 I have a data of a form: v = "\xc5\x84" This is a byte representation of an utf-8 encoded character "ń". How can I print >>ń<< using variable v? I'm using python 2.7.2 In original the variable v contained string: v = "\\xc5\\x84" (double backslashes) vs v = "\xc5\x84" (single backslashes) which is by itself valid utf-8 character. 回答1: Edit In my machine the output depends on the shell/python used, as shown below. As commented by Klaus a major actor here would be the locale setting in your

How to print Google Map markers

不羁的心 提交于 2019-12-20 01:32:30
问题 I am using Google Map Version 3 API to add markers on Google Map. The problem is that, markers show up on browsers. but when users print the map through browser's print command, nothing shows up. The question is, - How can I display markers on printed materials? - Comparisons : On the browser - markers are clearly visible After Print (IE7, IE8) - markers are not printed (on paper or PDF) After Print (FireFox 3.5.4) - only markers are printed 回答1: I suggest you try out the Static Maps API. You

PHP Server Side Printing Ubuntu Server

对着背影说爱祢 提交于 2019-12-20 01:14:32
问题 I have been all over stack looking at what is required to do this and have wound up being slightly confused. Lets get one thing straight this is a local based intra-net and I do understand that PHP is server side. I am running a company management solution on a web based PHP,JAVA,Jquery Idea. and we would like to print reports directly from the "LINUX" server and receipts etc. I have installed cups on the server and the server is printing fine and I am now just stuck on whether or not it is