printing

Java A3 printing on Macs coming out at A4 scale

匆匆过客 提交于 2019-12-23 17:45:52
问题 I have an odd problem that seems to be specific to Mac computers. I have a prog that prints the content of an AWT drawing surface to an A3 sheet of paper. On Linux and windows machines the output is OK. Printing from a Mac I get the same dialog with the same preset parameters, the printer prints on an A3 sheet of paper as expected, but for some reason the image is scaled to fit an A4 area. Below are the relevant sections of code: public void print() { PrinterJob printJob = PrinterJob

Remove blank page when printing on google chrome

China☆狼群 提交于 2019-12-23 17:35:12
问题 I use @media print {} to make some changes on print. But when I see the print preview in Google chrome it shows an extra blank page on the bottom. How to remove it ? I try some code for it but it still not working. div:last-child{ page-break-after: auto !important; } body,html{ height:auto !important; min-height:200px; } 回答1: Try use this method: * { font-size: 1em !important; line-height: 1 !important; } 来源: https://stackoverflow.com/questions/38416591/remove-blank-page-when-printing-on

Printing with Silverlight and com-interop

谁都会走 提交于 2019-12-23 17:33:14
问题 I'm trying to print from silverlight without a print dialog and for that I'm using System.Runtime.InteropServices.Automation; Right now I'm creating a temporary txt file that contain the text to send to printer. using (dynamic fso = AutomationFactory.CreateObject(@"Scripting.FileSystemObject")) { dynamic file = fso.CreateTextFile(cFileName, true); file.Write(printText); file.Close(); } After that I'm using shell.Aplication to print that document. dynamic shell = AutomationFactory.CreateObject

How to fix the Google Map API when print the whole page?

蓝咒 提交于 2019-12-23 17:18:55
问题 I'm trying to just print exactly what the user sees in maps when he clicks in the Print Button, but I don't know why, the map changes completely. I just want that the map resizes the image to fit exactly in the Print. It doesn't matter if the maps will be small or large. This is what the user sees: But I'm getting this: Portrait Landscape Thanks! 回答1: Google Map API does not support printing: Printing from the JavaScript API is not supported. This is because printing support is inconsistent

Print character to a certain point on console in Python?

安稳与你 提交于 2019-12-23 17:08:59
问题 Is there a way to print a character to a certain point on console using Python (3)? Here's an ideal example on what I'm trying to achieve: def print_char(x, y, char): # Move console cursor to 'x', 'y' # Set character under cursor to 'char' I know it's possible in some other languages, how about Python? I don't mind if I have to use an external library. I'm on a Windows 7. 回答1: If you are on UNIX (if you are not, see below), use curses: import curses stdscr = curses.initscr() def print_char(x,

Executing Python Script From Command Line is Hiding Print Statements

六月ゝ 毕业季﹏ 提交于 2019-12-23 16:46:55
问题 I know this must be a super basic question, however, I have tried finding a simple answer throughout SO and cannot find one. So my question is this: How can I execute a python script from the command line such that I can see print statements. For example, say I have the file test.py: def hello(): print "hello" If I enter the interpreter, import test.py, and then call test.hello(), everything works fine. However, I want to be able to just run python test.py from the command line and have it

Chrome Print - remove URL from footer but keep page number?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 15:49:49
问题 I am designing a web page that needs to be printed out. When I used Chrome to print it, the URL gets into the footer, together with the page number. Is there a way for me to remove the URL from the footer BUT KEEP the page number? thanks! 回答1: There doesn't appear to be a way to do that in Chrome, though it has been requested before: https://productforums.google.com/forum/#!topic/chrome/3KYcXfRIQ74 As far as I can tell, the only choice is on or off. Firefox has quite a bit of flexibility for

How to not print types in Julia?

故事扮演 提交于 2019-12-23 15:26:22
问题 If I have an array of numbers: a = [1,2,3] and print it, I get [1,2,3] but if I have an array of, say, Tuples: b = [(1,2),(3,)] when I print it I get: Tuple{Int64,Vararg{Int64}}[(1,2),(3,)] How to avoid printing the types? 回答1: It cannot be suppressed. julia> b = [(1,2), (3,)] 2-element Array{Tuple{Int64,Vararg{Int64}},1}: (1,2) (3,) Maybe the type is being printed to show you that you are including a Vararg type. If you want an output without the message, you can go ahead and write a wrapper

Printing with vb.net

拥有回忆 提交于 2019-12-23 14:24:24
问题 Is there any simple way to print to a printer with VB.NET? Specifically, with the console . It seems that stuff that works with forms applications dont work with the console. 回答1: Lifted from http://visualbasic.about.com/od/usingvbnet/a/printvb2005.htm Public Class myPrinter Friend TextToBePrinted As String Public Sub prt(ByVal text As String) TextToBePrinted = text Dim prn As New Printing.PrintDocument Using (prn) prn.PrinterSettings.PrinterName _ = "PrinterName" AddHandler prn.PrintPage, _

PrintServiceLookup.lookupDefaultPrintService() returns null

╄→гoц情女王★ 提交于 2019-12-23 13:59:08
问题 PrintServiceLookup.lookupDefaultPrintService() returns NULL as I have a printer installed and set to default printer. If I am using this in a simple program it works fine, but when I try to use it in my applet-based program it returns NULL . Please send me some good solution for this problem. 回答1: In order to access the printer (or any resource on the host computer for that matter) the jar file in which the applet code resides has to be signed, and the user must accept the signer as a trusted