printing

Printing contents of another page

女生的网名这么多〃 提交于 2019-12-18 15:16:09
问题 In the following link <a href=\"#\" onclick=javascript:print(\"\") style=\"color:blue;\">Print</a>" <script> function print() { //How to print the contents of another page } 回答1: I think you can print the contents of the current page not external page. 回答2: I know it´s an old question, but you can do it like this: function printExternal(url) { var printWindow = window.open( url, 'Print', 'left=200, top=200, width=950, height=500, toolbar=0, resizable=0'); printWindow.addEventListener('load',

Receipt Printer - print from webpage

让人想犯罪 __ 提交于 2019-12-18 13:48:20
问题 I have a receipt Printer and it connected to Serial COM1 on to my comuter. I am trying to print a receipt from the webpage and when it print... it just a blank without any text. (Blank receipt!). It work fine on IE8 but not working on Firefox 3.6 I have an Epson TM-T88II Printer and using "Generic / Text" driver on Windows 7. What is the solution to this? HTML code of receipt: <html> <head> <title></title> </head> <body> <div> <div>Company Name</div> <div>Customer Name</div> <div>Order No<

How to generate a dynamic GRF image to ZPL ZEBRA print

这一生的挚爱 提交于 2019-12-18 13:17:25
问题 I have a problem. I´m generating a dynamic BMP image and trying to send this to a ZEBRA printer by ZPL commands. I need to convert my BMP to a GRF image. I think that my Hexadecimal extracted by the BMP image isn´t correct. The printed image is blurred and incorrect. This is my code: string bitmapFilePath = @oldArquivo; // file is attached to this support article byte[] bitmapFileData = System.IO.File.ReadAllBytes(bitmapFilePath); int fileSize = bitmapFileData.Length; Bitmap ImgTemp = new

Twitter Bootstrap - Print all tab content

我们两清 提交于 2019-12-18 12:54:39
问题 I have the basic bootstrap tabs set up with no dynamically inserted content and print specific media queries in my base stylesheet. When the user prints from the browser I want all the tab content to print, not just the active tab. I know there has to be an easy solution to this, I just can't figure it out. 回答1: try this in your print media query: .tab-content > .tab-pane { display: block !important; opacity: 1 !important; visibility: visible !important; } 回答2: @Scott's answer didn't work for

Writing a pytest function for checking the output on console (stdout)

你离开我真会死。 提交于 2019-12-18 12:52:38
问题 This link gives a description how to use pytest for capturing console outputs. I tried on this following simple code, but I get error import sys import pytest def f(name): print "hello "+ name def test_add(capsys): f("Tom") out,err=capsys.readouterr() assert out=="hello Tom" test_add(sys.stdout) Output: python test_pytest.py hello Tom Traceback (most recent call last): File "test_pytest.py", line 12, in <module> test_add(sys.stdout) File "test_pytest.py", line 8, in test_add out,err=capsys

java PrinterJob not printing to fit paper

蓝咒 提交于 2019-12-18 12:44:09
问题 i am stuck currently when printing a jpeg file with the default printer. In my program when i select an image from a folder, i need to print it using the printer default settings (paper size, margins, orientation). Currently i got this: PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); final BufferedImage image = ImageIO.read(new File("car.jpg")); PrinterJob printJob = PrinterJob.getPrinterJob(); printJob.setPrintService(printService); printJob.setPrintable(new

Javascript for loop console print in one line

给你一囗甜甜゛ 提交于 2019-12-18 12:43:35
问题 I'm trying to get the output from my for loop to print in a single line in the console. for(var i = 1; i < 11; i += 1) { console.log(i); } Right now it's 1 2 3 4 5 6 7 8 9 10 How can I get the output all in one line (like this 1 2 3 4 5 6 7 8 9 10 )? 回答1: Build a string then log it after the loop. var s = ""; for(var i = 1; i < 11; i += 1) { s += i + " "; } console.log(s); 回答2: No problem, just concatenate them together to one line: var result = ''; for(var i = 1; i < 11; i += 1) { result =

Creating a raw printer queue in CUPS (host) and adding them through CUPS (client)

删除回忆录丶 提交于 2019-12-18 12:36:59
问题 I want to make my RasPi act as a little print and file server in a small home network consisting of three Linux clients. Unfortunately, Brother provides only binary drivers for x86, so I cannot run my Brother printer on the RasPi. However, I found a blog entry proposing to create a raw queue on the RasPi's CUPS install and access this queue from the clients using binary drivers installed on them. Here is the blog entry: http://chemdroid.net/en/raspberry-pi/36-raspberry-pi-as-print-server

Java printing directly to a Postscript network printer

蓝咒 提交于 2019-12-18 12:28:56
问题 I've got Postscript code/data (?) in memory (in a Java Tomcat webapp) that I'd like to send directly to a networked PS printer. Is there an easy way (i.e. just popping open a port and sending the text) to print this, bypassing all of the O/S-specific drivers and stuff (and hopefully not even requiring extra jars)? A link to example code showing how to do this? Thanks, Dave 回答1: open a TCP socket to the LPR port on the target printer. send your data; as long as the printer comprehends it, you

How to convert a printer driver to a stand-alone console application which can generate a printer file containing the bytes to be sent to the printer?

安稳与你 提交于 2019-12-18 12:25:07
问题 I have a situation where the only way to generate a certain datafile is to print it manually to FILE: under Windows and save it in a file for further processing. I would really like to have a small stand-alone program which embeds this binary printer driver so I can run it from a batch file and have it generate that binary file for me, as we can then fully automate the "save file in Visio, 'print' it and upload it to the final destination and trigger a remote test". Is this possible with a