printing

HTML print with absolute postitions

时光怂恿深爱的人放手 提交于 2019-12-18 12:12:36
问题 Is it possible to print a HTML page with truly absolute positioned elements to paper? It seems all browsers are doing a big mess here. It is easy to define a body by absolute units (eg. cm) and place elements by position: absolute inside. However, every browser seem to try to make it impossible to print such a page. FF for example is adding print margins, even when printing to a PDF on linux despite 0-margin page settings. Chrome seems to shrink the page in every case. So how to print

Printing data to printer using PHP

删除回忆录丶 提交于 2019-12-18 12:02:55
问题 I have a question that has been troubling me for at least 3 weeks now. I need to print some data to a printer using php. I have data saved into a $print_output variable, and I know my data is good because when I send it via email, it shows everything that is supposed to be shown. Well, I tried writing this code, where I thought I could test it but wasn't sure if it would have even worked. $handle = printer_open("\\\\192.168.1.33_4\\Printer_Office"); printer_set_option($handle, PRINTER_MODE,

JavaScript print preview

浪子不回头ぞ 提交于 2019-12-18 11:38:27
问题 How can I see print preview of my invoice generated from website. If I print with the script <a href="javascript:window.print()">print this page</a> in the print "print this page" also printed. How can I hide it? 回答1: Addressing the following part of your question: in the print "print this page also printed . How can I hide it? Create a new stylesheet (in this example, I've named it "print.css") and include it in your HTML as follows: <link rel="stylesheet" href="print.css" type="text/css"

Print a struct in C

拈花ヽ惹草 提交于 2019-12-18 11:07:19
问题 I am trying to print a struct that is coming as an argument in a function in order to do some debugging. Is there anyway I could print a structure's contents without knowing what it looks like, i.e. without printing each field explicitly? You see, depending on loads of different #define s the structure may look very differently, i.e. may have or not have different fields, so I'd like to find an easy way to do something like print_structure(my_structure) . NetBeans' debugger can do that for me

fitting PrinterJob Object to specific print format of BufferedImage

穿精又带淫゛_ 提交于 2019-12-18 09:49:08
问题 Im using PrinterJob object in order to print my Bufferedimage, I have a BufferedImage which I proccess and send it to Printer job with Paper Format etc, and I cant make it fittable to my card printer. when i save it to my hard-disk and print via windows printing manager it printing very good on my card printer but with PrinterJob it came out too big and not fittable for a card the size of the card is 86X54mm and the size of my buffered image is 1300x816px The Code : PrinterJob printjob =

Printing Windows Form

点点圈 提交于 2019-12-18 09:44:20
问题 I have inherited some code to print the contents of a form however the image produced on paper seems to have some sort of shadow/blurriness as if its tried to do anti-alasing but not done so very well and the letters are pixelated on the edges. Does anyone know a way of improving the final quality? System.Drawing.Printing.PrintDocument Doc = new System.Drawing.Printing.PrintDocument(); Doc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.Doc_PrintPage123); Doc

Crystal Report Viewer print/export buttons not working in ASP.NET MVC app

帅比萌擦擦* 提交于 2019-12-18 09:33:30
问题 My MVC app uses the push model and the CR viewer for reporting. All works great in displaying the report in the viewer however the print/export buttons give the javascript error 'Object not supported by this action'. I am using VS 2008 and MVC. This happens in my dev environment. Any ideas? 回答1: The answer to this is so stupid its embarrassing - my popup blocker was causing this error. I did get another error or on th the deployed site however and that was a 404 not found on 'aspnet_client

printf and custom class

♀尐吖头ヾ 提交于 2019-12-18 09:14:37
问题 I have my own class that represents a custom string class. I'm using VS2012RC. I have overloaded some operators of my class CustomString. Here's some code: CustomString::CustomString(string setstr) { str = setstr; } CustomString::operator const char *() { return (this->str.c_str()); } CustomString &CustomString::operator = (char *setstr) { str = setstr; return *this; } I can define my object and use it like this: CustomString str = "Test string"; and i can print the result as: printf(str);

Printing PDFs with changed default printer settings

喜欢而已 提交于 2019-12-18 08:54:30
问题 Google/Bing didnt bring up any solution to my following problem, hope someone can help me: We have to print various PDF files in our C# based program. Before we can print, we have to configure the printer, e.g. setting the orientation to landscape. I tried to change the default printer settings e.g. like this: PrinterSettings settings = new PrinterSettings(); settings.PrinterName = "\\\\SomeNetworkPrinter\\"; settings.DefaultPageSettings.Landscape = true; settings.Duplex = Duplex.Horizontal;

window.print not working in Firefox

强颜欢笑 提交于 2019-12-18 08:40:50
问题 function CallPrint() { var prtContent = document.getElementById('<%= pnlDelete.ClientID %>'); var winPrint = window.open('', '', 'left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0'); winPrint.document.write("<h3>Summary</h3><br />" + prtContent.innerHTML); winPrint.document.close(); winPrint.focus(); winPrint.print(); winPrint.close(); } I have a need where I have to print contents of a div. I am using above code to do so. It is working fine in IE but does nothing in Firefox.