printing

How can I force browsers to print background images in CSS?

半城伤御伤魂 提交于 2019-12-17 02:11:16
问题 This question was asked before but the solution is not applicable in my case. I want to make sure certain background images are printed because they are integral to the page. (They are not images directly in the page because there are several of them being used as CSS sprites.) Another solution on that same question suggests using list-style-image , which only works if you have a different image for every icon, no CSS sprites possible. Aside from creating a separate page with the icons inline

Show DataFrame as table in iPython Notebook

安稳与你 提交于 2019-12-17 01:34:14
问题 I am using iPython notebook. When I do this: df I get a beautiful table with cells. However, if i do this: df1 df2 it doesn't print the first beautiful table. If I try this: print df1 print df2 It prints out the table in a different format that spills columns over and makes the output very tall. Is there a way to force it to print out the beautiful tables for both datasets? 回答1: You'll need to use the HTML() or display() functions from IPython's display module: from IPython.display import

Javascript Print iframe contents only

丶灬走出姿态 提交于 2019-12-16 22:22:11
问题 This is my code <script> var body = "dddddd" var script = "<script>window.print();</scr'+'ipt>"; var newWin = $("#printf")[0].contentWindow.document; newWin.open(); newWin.close(); $("body",newWin).append(body+script); </script> <iframe id="printf"></iframe> This works but it prints the parent page, how do I get it to print just the iframe? 回答1: I would not expect that to work try instead window.frames["printf"].focus(); window.frames["printf"].print(); and use <iframe id="printf" name=

Pythonic way to print list items

会有一股神秘感。 提交于 2019-12-16 22:10:41
问题 I would like to know if there is a better way to print all objects in a Python list than this : myList = [Person("Foo"), Person("Bar")] print("\n".join(map(str, myList))) Foo Bar I read this way is not really good : myList = [Person("Foo"), Person("Bar")] for p in myList: print(p) Isn't there something like : print(p) for p in myList If not, my question is... why ? If we can do this kind of stuff with comprehensive lists, why not as a simple statement outside a list ? 回答1: Assuming you are

Pythonic way to print list items

旧街凉风 提交于 2019-12-16 22:10:13
问题 I would like to know if there is a better way to print all objects in a Python list than this : myList = [Person("Foo"), Person("Bar")] print("\n".join(map(str, myList))) Foo Bar I read this way is not really good : myList = [Person("Foo"), Person("Bar")] for p in myList: print(p) Isn't there something like : print(p) for p in myList If not, my question is... why ? If we can do this kind of stuff with comprehensive lists, why not as a simple statement outside a list ? 回答1: Assuming you are

Why doesn't “System.out.println” work in Android?

依然范特西╮ 提交于 2019-12-16 19:47:28
问题 I want to print something in console, so that I can debug it. But for some reason, nothing prints in my Android application. How do I debug then? public class HelloWebview extends Activity { WebView webview; private static final String LOG_TAG = "WebViewDemo"; private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } /** Called when the activity is first created. */ @Override

Why doesn't “System.out.println” work in Android?

跟風遠走 提交于 2019-12-16 19:47:09
问题 I want to print something in console, so that I can debug it. But for some reason, nothing prints in my Android application. How do I debug then? public class HelloWebview extends Activity { WebView webview; private static final String LOG_TAG = "WebViewDemo"; private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } /** Called when the activity is first created. */ @Override

java setting resolution and print size for an Image

时光总嘲笑我的痴心妄想 提交于 2019-12-14 04:16:33
问题 I wrote a program that generates a BufferedImage to be displayed on the screen and then printed. Part of the image includes grid lines that are 1 pixel wide. That is, the line is 1 pixel, with about 10 pixels between lines. Because of screen resolution, the image is displayed much bigger than that, with several pixels for each line. I'd like to draw it smaller, but when I scale the image (either by using Image.getScaledInstance or Graphics2D.scale), I lose significant amounts of detail. I'd

PrintStream doesn't print correctly unicode characters ( UTF-16)

杀马特。学长 韩版系。学妹 提交于 2019-12-14 03:58:42
问题 I want to print correctly unicode (let's say greek characters ) but I have problems. For example : PrintStream oStream = new PrintStream(client.getOutputStream(), true, "UTF-8"); oStream.write(" Customer : Γειά σου\r\n".getBytes()); oStream.write(" ΚΩΔΙΚΟΣ : 00000234242\r\n".getBytes()); oStream.flush(); oStream.close(); OR OutputStreamWriter oStream = new OutputStreamWriter(client.getOutputStream(), "UTF-16"); oStream.write(" Customer : Γειά σου\r\n"); oStream.write(" ΚΩΔΙΚΟΣ : 00000234242\r

Open another page or image in print Preview

◇◆丶佛笑我妖孽 提交于 2019-12-14 03:56:41
问题 I am trying to create a printer friendly page. We've got that sorted using thirdparty software that snapshots the page and spits out image files. Now we have created a link to the image page and would like to create a javascript that opens print preview directly. I have found two javascripts first to open in a new page and another one to open print preview .This all works on IE 9. I need to combine these two javascripts :-) I have tried anything I know to combine them without success.. Could