printing

Print on continuous paper using c#

梦想与她 提交于 2019-12-18 07:46:36
问题 I write a one POS system. I want to print on continuous paper but I don't figure out how I can accomplish this. I use the .net (C#). I try with crystal report as well as System.drawing classes. Any idea will be helpful for me... 回答1: If you're using a C# PrintDocument to generate your print job, could you just initialize the paper size to what you need for header/footer then increment the PageHeight property before you draw a new line? printdoc.DefaultPageSettings.PaperSize.Height +=

page-break-inside:avoid equivalent for Firefox and/or IE

女生的网名这么多〃 提交于 2019-12-18 07:28:24
问题 I understand that the CSS page-break-inside:avoid instruction is supposed to prevent a page break within a div when an HTML document is printed. Through searching the internet, I have found that it is only supported by Opera and IE8. Is there a work around that allows me to prevent page breaks in Firefox (3.6) or IE versions less than 8? 回答1: Sorry, my answer is "not possible", although I'd love it if anyone can prove me wrong. I've ran into the same problem lately, and after doing a little

Printing html tables, preventing rows from spanning multiple pages

烂漫一生 提交于 2019-12-18 07:14:14
问题 I generate html programmatically in order to have it rendered nicely for printing. I have to print tables that may span several pages. This poses some challenges such as preventing cell contents to spread over two pages like this: I found a solution in this answer, which uses page-break-inside:avoid , along with this answer, which uses display: block for the <tr> elements in order to prevent them from getting split up vertically. However, this also causes the rows not to vertically align with

Silent print HTML file in C# using WPF

不羁岁月 提交于 2019-12-18 06:50:56
问题 EDIT: Completely rewrote question and added bounty. Based on many tutorials and stackoverflow questions I can now: Print multiple pages together as one document. Print actual content. Align content correctly on page. Print correct size documents. The solution requires the HTML document to have some white space in the bottom and the style tag html{ overflow:hidden; } - to hide the scrollbars and to allow scrolling to be used for pagination - but I can accept this. The ONLY remaining problem is

HTML/CSS - Why background-color turns white when printing?

笑着哭i 提交于 2019-12-18 06:08:06
问题 My background color or even the font colors of my elements suddenly turns white when printing. Here's a sample markup: <div id="ActionPanel"> <input type="button" onclick="javascript:window.print();" value="Print"> </div> <p id="P1"> Hello World! </p> <p id="P2"> Hello Web! </p> <p id="P3"> Hello StackOverflow </p> an here's the CSS @media all { body { background-color:green; } #P1 { background-color:#f00; } } @media print { #ActionPanel { visibility:hidden; } } 回答1: All backgrounds are

WPF: Best method for printing paginated datagrids

六月ゝ 毕业季﹏ 提交于 2019-12-18 05:48:08
问题 Boy did I get an education looking into this. I guess I've been spoiled by Powerbuilder, which has fantastic functionality for this out of the box. Does anyone seriously write custom documentpaginator objects to handle reporting needs for their LOB apps? I want to be able to print "for free" and not have to code like crazy just to take whats on the screen and throw it on paper. How are people doing this? Does anyone have a recommended 3rd party for allowing printing of largish datagrids?

Print media queries being ignored in Chrome?

十年热恋 提交于 2019-12-18 05:47:08
问题 I'm creating some print specific styles using the following: @media print { /* Styles */ } As we are using SASS all the styles get compiled into one stylesheet, styles.css at runtime, which is declared in the <head> of the document as follows: <link rel='stylesheet' href='/assets/css/styles.css'> Now when I print from chrome (Ctrl+P), it completely ignores my print styles but Firefox (30.0) is fine. IE(11) is terrible but this is because we have a lot of show/hide panels which IE doesn't seem

Run javascript/jquery only on screen media, not print

随声附和 提交于 2019-12-18 05:46:11
问题 How can I run a jquery function only on @media screen ? Background: I have a screen.css stylesheet and a print.css stylesheet. I have two javascript functions, one of which I do not want to run on the printed version want of the page. 回答1: Any script would be ran when the page loads, so using if (Modernizr.mq('only screen')) {$('h1').text('media screen');} is pointless as it runs your script while you're on @media screen . Instead, you have to detect whenever the media query changes, and

Set PDF to print with no scaling

↘锁芯ラ 提交于 2019-12-18 05:44:18
问题 I am generating a PDF (using fpdf) and I am wondering if there is a way to set the document's properties to to default to print with no scaling. So when you select print from the print dialogue menu, scaling is set to none. I'm trying to determine if this is a user setting or something I can control in the creation of the PDF. Thanks in advance. 回答1: Scaling is controlled by the PDF application - it is not set in the file. 回答2: I've done it adding to the method _putcatalog() the following:

How to access a printer name from IP on network in C#?

…衆ロ難τιáo~ 提交于 2019-12-18 05:25:14
问题 I can get to the printer with the name "\\xxxx\[name of printer]" but have no idea how to access this with only the IP of the printer. Any ideas? EDIT: The answers seem to suggest that I can simply swap out the printer name for the IP address of the printer, however this does not seem to be the case. Any MORE ideas? UPDATE: the reason for addressing the printer as an IP is that the networking guys gave all of the printers the same share name, so I have no way to distinguish them, other than