printing

Dos based printing using C#.net

扶醉桌前 提交于 2019-12-21 20:24:15
问题 i m using Dotmatrix printer EPSON for printing the reports, and i need the of how to print the reports without using crystalReport and print dialog, i.e. i want the code for DOS based printing in C#.net......... 回答1: I know a very old and dirty way. Just open LPT1 (or the printer port you are using) as a stream and output the characters. 回答2: Maybe this will help? http://support.microsoft.com/kb/322091/EN-US 回答3: Does your printer appear in windows? In other words, can your print to it from

Out of memory Exception while printing in WPF

谁都会走 提交于 2019-12-21 17:48:11
问题 I was trying to print the set of 70 images in WPF. So I used Fixed document as I saw in many references and tried printing using the below code. private void button1_Click(object sender, RoutedEventArgs e) { PrintDialog d = new PrintDialog(); d.PrintDocument(PrintingDoc().DocumentPaginator, "test"); } private FixedDocument PrintingDoc() { FixedDocument document = new FixedDocument(); Visual viewerControl; string[] Documents = System.IO.Directory.GetFiles("../../U/"); DrawingVisual dv;

print directory like tree command

巧了我就是萌 提交于 2019-12-21 17:40:58
问题 I have to print a directory tree. I have the following code: public static void main(String[] args) throws Exception { File root = new File("C:\\Users\\User\\Desktop\\example"); if (!root.isDirectory()) { throw new IllegalArgumentException("Invalid directory: " + root.getName()); } int level = 0; System.out.println(renderFolder(root, level, new StringBuilder(), false)); } private static StringBuilder renderFolder(File folder, int level, StringBuilder sb, boolean isLast) { indent(sb, level,

Firefox printing cuts canvas on end of first page, how do I make it not do that?

非 Y 不嫁゛ 提交于 2019-12-21 17:32:47
问题 http://fiddle.jshell.net/bTtKT/show/ If I print the above page in Chrome as A4 Landscape I get two pages as expected given the size of the canvas on the page, if I do the same in Firefox however (with print preview for example), it gives me only one page and therefor cuts the image/canvas in half. If I change the scale in Firefox however I do start to see the whole image (but then it's too small), so the image is there as a whole but Firefox seams to ignore that its bigger then one page for

WinSpool OpenPrinter Access Denied

夙愿已清 提交于 2019-12-21 17:23:09
问题 This is 335th time this question being asked, by I've found no answer. I'm trying to send raw data directly to printer via WinSpool api from ASP.net C# application. My code is just a copy from here. Error goes here if( OpenPrinter( szPrinterName.Normalize(), out hPrinter, IntPtr.Zero ) ) It works fine for local printer but for shared network printer the result of OpenPrinter (result of GetLastError actually) is always 5 - Access Denied . I've tried different values for PRINTER_DEFAULTS with

PrintQueue.AddJob hangs when printing to non-xps based printers

坚强是说给别人听的谎言 提交于 2019-12-21 12:03:10
问题 I am trying to print an xps document to printers (network printer, some virtual local printers, xps and non xps based) with the following code. C# Source: static void Main(string[] args) { PrintServer printServer = new PrintServer(@"\\printserver.csez.zohocorpin.com"); foreach (PrintQueue queue in printServer.GetPrintQueues()) { Console.WriteLine("Printer: {0}, Port: {1}, ShareName: {2}, status: {3}, PrintingIsCancelled: {4}", queue.Name, queue.QueuePort.Name, queue.ShareName, queue

MS Edge - window.print() is not frame contextual in MS edge

风格不统一 提交于 2019-12-21 09:33:41
问题 Microsoft Edge is not handling window.print() consistently when compared with other browsers. In most browsers calling window.print() from within an iframe on a page will only print the contents of that iframe. However in edge it will always print the whole document. Was this intentional? Is there workaround? Example on JSFiddle. iframe.html ... <body> <a href="#" onclick="window.print()">print iframe document</a> </body> ... index.html ... <body> <a href="#" onclick="window.print()">print

Detect if user has printing capabilities?

爷,独闯天下 提交于 2019-12-21 09:21:46
问题 A client has asked for a print button be added to their site and would like it to be hidden for users who don't have the capability to print, e.g. most mobile devices. Is there any way through JavaScript to detect if a client has printing capabilities? 回答1: The requirement is flawed since most user agents can "print" and the knowledge of whether or not a UA can print is not the websites busines. Many mobile browsers can print and most web browsers can print even if there is no printer

How can I print an image in a web page, fitting the paper size (A3, A4, A5, etc)?

南笙酒味 提交于 2019-12-21 09:16:36
问题 I am currently using IE9 and media queries and I have no need to have this working from other browsers. I tried using a set of rules like: @page { size: auto; margin: 10mm 10mm 10mm 10mm; } //... rules to match the millimiters of all the A formats (A0, A1, A2, etc) including margins and tolerance /* A4 210x297 mm */ @media print and (min-height: 266mm) and (max-height: 288mm) and (min-width: 179mm) and (max-width: 201mm) { .img_port { height: 267mm !important; } } // ... it seems to be

Linux/CUPS printing example/tutorial? [closed]

风流意气都作罢 提交于 2019-12-21 08:16:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I need to print some vector data (or to be more exact: some dots and polylines) using Linux. When I ask Google for that it shows me many tutorials and documentations - but all for end users, no programming examples. So does anybody know a good programmers HOWTO/tutorial that shows printing under Linux? Thanks!