printing

CSS Print Stylesheet: hide everything except specific image, show that full-page

血红的双手。 提交于 2019-12-13 14:05:58
问题 I'm trying to build a stylesheet that prints only a specific image, and sizes the image to cover the entire page. In my media="print" stylesheet, I have: @page { margin: 0.5in; } body { width: 100%; } body * { visibility: hidden; } #specificimage { visibility: visible; position: fixed; top: .5in; left: .5in; width: 7.5in; height: auto; } The html structure is similar to this: <body> <div> <div> <div> <img id="specificimage" src="image.png" /> </div> </div> </div> </body> It prints fine in

Excel VBA printer API, set colour and duplex

江枫思渺然 提交于 2019-12-13 12:12:54
问题 here's my problem. I am trying to access the printer and change the colour and duplex settings. So far the code I have allows me to change the user preferences of the networked printer. But I have the following two problems below. 1) The codes set's the printer to either simplex or duplex as intended, however is does not set the colour preference correctly! 2) Excel is not automatically picking up the new settings, I still have to go in and manually click the reset button for the new changes

How do I print something underlined in Python?

不羁的心 提交于 2019-12-13 11:52:11
问题 print("hello") The output should be the word "hello", but underlined. 回答1: You can do it by using escape characters. print "\033[4mhello\033[0m" 回答2: You may type print("\u0332".join("hello ")) enter image description here 回答3: string = 'Hello world' emptystring = '' for i in range(0, len(string)): if string[i] == ' ': emptystring = emptystring + string[i] else: emptystring= emptystring+string[i]+str('\u0332') print(emptystring) Here is the output 来源: https://stackoverflow.com/questions

AWT-EventQueue-0" java.lang.NullPointerException

非 Y 不嫁゛ 提交于 2019-12-13 11:06:28
问题 Thank you for your help guys, i have got the code to look like below, it is not all mine but i have been editing it to try and do what i want, i am almost done i am just getting one error message at the final hurdle, i am getting a error message : Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at java.text.AttributedString.<init>(AttributedString.java:127) at PrintText.print(PrintText.java:109) at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1973) at sun

Printing an HTML form using jQuery

坚强是说给别人听的谎言 提交于 2019-12-13 10:53:26
问题 I am having an HTML form, and I need to print(HardCopy) particular area.. The problem is I am unable to get the form Text1 and Text2 values on the. Since I need that HTML form to be filled with some value, while clicking print it should print as hardcopy. My Code <script type="text/javascript"> $(document).ready(function(){ $("#print").click(function(){ alert($('#click').html()); // It shows only form elements; I need a form typed element too. How? window.print(); }); }); </script> </head>

Django admin overriding - adding a print button

十年热恋 提交于 2019-12-13 10:17:39
问题 I would like to create a "print button" inside an app in django admin interface to load a page in another browser tab (a view that is already coded) and let the user print it directly from admin interface. I used the override to add a "print" button near the "history" button following this example: overriding admin templates I have a model named "Card", each card has a unique number which is used to load a corresponding view, now I need to take this number and pass it to the print button to

Python Printing Dictionary Key and Value side by side

可紊 提交于 2019-12-13 09:59:10
问题 I want a program that prints Key and Value side by side for the following code: This is a Dictionary: d = {'M': ['Name1', 'Name2', 'Name3'], 'F': ['Name1','Name2','Name3']} I want the a program that prints in the following form: M, Name1 M, Name2 M, Name3 F, Name1 F, Name2 F, Name3 回答1: d = {'M': ['Name1', 'Name2', 'Name3'], 'F': ['Name1','Name2','Name3']} for key in d.keys(): for value in d[key]: print key,value edit: A more elegant solution may be: for key,value in d.iteritems(): print key

print empty asterisk triangle c

允我心安 提交于 2019-12-13 09:56:19
问题 So I've looked up and only found normal triangles questions out there. This one is a bit tricky. Given a N, your program should create an asterisk unfilled triangle with a N side size. Example 1 Inform N: 1 * Example 2: Inform N: 2 ** * Example 3: Inform N: 3 *** ** * Example 4: Inform N: 4 **** * * ** * Example 5: Inform N: 5 ***** * * * * ** * Here's my attempt, I could only make a filled triangle inefficiently void q39(){ int n,i,b; printf("Inform N: "); scanf ("%i",&n); for ( i = 0; i < n

Function stops my program

半世苍凉 提交于 2019-12-13 09:18:40
问题 I am trying to use the print function of PrintWriter. When I use this method, my program continues to run but all my other functions doesn't work. public void printVertices(PrintWriter os) { for(int i = 0; i < vert.size(); i++) { os.print(vert.get(i) + " "); } os.close(); } 回答1: Again, the problem is that you close the PrintWriter , which also closes the underlying OutputStream or Writer . You probably added the os.close(); statement, because otherwise the PrintWriter will buffer the output

Python output is different than what I need

泪湿孤枕 提交于 2019-12-13 09:13:30
问题 Hi guys I'm farely new to python and I need your help. import sys, http.client file = open('out.txt', 'w') showlines = 50 npa = [] try: servername = sys.argv[1] except: servername = 'localcallingguide.com' server = http.client.HTTPConnection(servername) for i in range(1000): if i < 10: npa.append('00' + str(i)) elif i >= 10 and i < 100: npa.append('0' + str(i)) else: npa.append(str(i)) for i in range(len(npa)): filename = '/lca_rcdist.php?npa1=503&nxx1=745&npa2=503&nxx2=' + npa[i] server