printing

Can I get the icon associated with an installed printer through .Net?

梦想与她 提交于 2019-12-17 16:48:21
问题 I know how to get the list of all of the installed printers on a machine with .Net: foreach (String printer in PrinterSettings.InstalledPrinters) { Console.WriteLine(printer.ToString()); } Console.ReadLine(); InstalledPrinters is just a list of strings though. Is there any way to get the installed printer objects that contain both the name and the icon image that I would ordinarily see under "Devices and Printers" in the Windows Explorer? 回答1: The icon is normally embedded into either one of

ASP.NET IIS server side printing fails

余生长醉 提交于 2019-12-17 16:41:47
问题 I'm building an ASP.NET application that requires printing using PrintDocument method: PrintDocument.Print() Printing works properly in development env with IIS express. when publishing it to an intranet IIS server, printing fails, which I think is caused by permission issue for aspnet working process. I tried to do the following with no success: I created an application pool in integrated pipeline mode for an admin local user with load user profile option set to true I moved the application

Is there a way to track if a user prints a web page?

∥☆過路亽.° 提交于 2019-12-17 16:27:14
问题 Is there a way to track if a user prints a web page? Thanks, Graham 回答1: @Tahir Akhtar had the idea of using a print stylesheet. According to the comments, that doesn't work because the stylesheet is always fetched , regardless of whether the browser currently is in print view or not. How about taking this further: Use a print stylesheet and define a style in it that makes the browser fetch a certain resource when it's rendered . The resource would return a transparent image. As for the

How to hide or disable in-function printed message

与世无争的帅哥 提交于 2019-12-17 15:55:11
问题 Suppose I have a function such as: ff <- function(x) { cat(x, "\n") x^2} And run it by: y <- ff(5) # 5 y # [1] 25 My question is how to disable or hide the 5 printed from cat(x, "\n") such as: y <- ff(5) y # [1] 25 回答1: You can use capture.output with invisible > invisible(capture.output(y <- ff(2))) > y [1] 4 or sink > sink("file") > y <- ff(2) > sink() > y [1] 4 回答2: Here's a nice function for suppressing output from cat() by Hadley Wickham: quiet <- function(x) { sink(tempfile()) on.exit

send pdf file to a printer - print pdf [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-17 15:34:47
问题 This question already has answers here : How can I send a file document to the printer and have it print? (11 answers) Closed 6 years ago . I'm programming a web application with Visual Studio 2010 (C#). I want to send a PDF (saved in my computer) to a printer when I click a button. To create the PDF I used iTextSharp. I tried this, but it just opens Adobe Reader: proc.StartInfo.FileName = @"C:\Archivos de programa\Adobe\Reader10.0\Reader\AcroRd32.exe"; proc.StartInfo.Arguments = String

Python way of printing: with 'format' or percent form? [duplicate]

荒凉一梦 提交于 2019-12-17 15:26:52
问题 This question already has answers here : String formatting: % vs. .format (16 answers) Closed 4 years ago . In Python there seem to be two different ways of generating formatted output: user = "Alex" number = 38746 print("%s asked %d questions on stackoverflow.com" % (user, number)) print("{0} asked {1} questions on stackoverflow.com".format(user, number)) Is there one way to be preferred over the other? Are they equivalent, what is the difference? What form should be used, especially for

window.print() - without opening the print window [duplicate]

陌路散爱 提交于 2019-12-17 12:36:29
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: “Silent” Printing in a Web Application I'd like the window.print() command to print directly, without opening the print window: Is that possible? 回答1: try For Mozilla : http://forums.mozillazine.org/viewtopic.php?t=48336 When you use JavaScript's window.print() to print a Web page in IE, by default, it prompts IE's printer dialog box. To avoid this, use the following JavaScript code: if (navigator.appName ==

Android - how to get or set (print) DPI ( dots per inch ) of JPEG file while loading or saving it programmatically?

回眸只為那壹抹淺笑 提交于 2019-12-17 11:55:35
问题 I have an app developed on Android versions 4.0 and above. ( The app does not support Android versions below 4.0 [Ice Cream Sandwich] ). The question is related to (print) DPI of various images ( for eg. of jpeg or png ) format. This question does NOT relate to SCREEN DPI or sizes of various Android devices. It is also NOT related to showing the Bitmap on the device in screen size. I am using the following code to load the image file in 'Bitmap'. Then I have been cropping it and saving it to

iOS print without allowing UIPrintInteractionController to appear

你说的曾经没有我的故事 提交于 2019-12-17 11:08:17
问题 I am researching a potential app for a client, and I had a question I wasn't able to find the answer on. What I would like to do is print automatically, without having the UIPrintInteractionController get displayed. An important point I should make is this will not be a production app. I know that otherwise this could violate the user's privacy to just print without the user's consent, but again this will not be a public app on the App Store. One app I found that seems to be able to this is

Print a div content using Jquery

╄→尐↘猪︶ㄣ 提交于 2019-12-17 10:53:00
问题 I want to print the content of a div using jQuery. This question is already asked in SO, but I can't find the correct (working) answer. This is is my HTML: <div id='printarea'> <p>This is a sample text for printing purpose.</p> <input type='button' id='btn' value='Print'> </div> <p>Do not print.</p> Here I want to print the content of the div printarea . I tried this: $("#btn").click(function () { $("#printarea").print(); }); But it gives a console error when the button is clicked: Uncaught