printing

Why is echo faster than print?

不羁岁月 提交于 2019-12-23 20:01:24
问题 In PHP , why is echo faster than print? They do the same thing... Why is one faster than the other? Do they do exactly the same thing? 回答1: echo and print are virtually (not technically) the same thing. The (pretty much only) difference between the two is that print will return the integer 1 , whereas echo returns nothing. Keep in mind that neither is actually a function, but rather language constructs. echo allows you to pass multiple strings when using it as if it were a function (e.g.,

How can I process an image in .NET for a full-page print with a quality like Windows Photo Gallery does it?

こ雲淡風輕ζ 提交于 2019-12-23 19:44:21
问题 I'm writing a printing routing in C#, using the .NET PrintDocument class, handling the OnPrintPage event. I've managed to maximize the margins and print the Image in landscape mode, but it simply does not look as good as when I print the same image file from Windows Photo Gallery (formerly Windows Picture and Fax Viewer), the default image preview program in Windows Vista. I noticed an option there for selecting "Sharpen Image for Printing" , but what does that do? I've thought about printing

Hide Text From Printing

守給你的承諾、 提交于 2019-12-23 19:33:59
问题 I have a print page here: http://www.souq4cars.com/ppreview.php?id=611111161&u=10064&t=users_cars How do i hide the links at the bottom saying 'Close Window' and 'Print Page' from being printed on the printed page? 回答1: You could use the CSS @media rule for this. To start, add a class noprint to the both elements: <a class="noprint">foo</a> and then add a @media print rule to your CSS which hides the elements during print: @media print { .noprint { display: none; } } 回答2: @media print { div

font colors change when printing

非 Y 不嫁゛ 提交于 2019-12-23 19:31:45
问题 I have a really perplexing issue here. I have a table that is built dynamically (probably an unimportant fact here, but just so you know). On the webpage, I have text being set as particular colors based on logic criteria. On the page, it looks great. When going to print preview (and actually printing), the colors are very different. In my code, the colors are: Red - FF0000 Orange - FF8300 Yellow - FFFF00 The image below shows the page and then the printing colors on the left and right,

Printing variant types in OCaml

给你一囗甜甜゛ 提交于 2019-12-23 19:10:31
问题 In my OCaml program, I spend considerable time wring "to_string" for variant types over and over again. Either I need them for debugging purpose, or because I need a specific formatted output. So far, they follow a template such as follows: let rec to_string = function | Var x -> x | Implies (f1, f2) -> Printf.sprintf "(=> %s %s)" (to_string f) (to_string f2) | And (f1, f2) -> Printf.sprintf "(& %s %s)" (to_string f1) (to_string f2) | Or (f1, f2) -> Printf.sprintf "(| %s %s)" (to_string f1)

C++: Deleting a printer queue

蓝咒 提交于 2019-12-23 19:10:07
问题 I'm trying to remove all the files in queue from a printer. I found this piece of code which seemed pretty straight forward. I tried deleting the queue with the code below. It compiles, but SetPrinter returns false. The error message I got was 5, which I tried to decode to a "normal" error message using the approach from this question. But I wasn't able to compile with that, because STR_ELEMS is undefined. Searched google for "STR_ELEMS is undefined" but hit a dead end. Can someone help me

Printing directly from PHP using printer_write() function

笑着哭i 提交于 2019-12-23 19:03:17
问题 I found a code printing directly from PHP: $printer = "cups-pdf"; $ph = printer_open($printer); if ($ph) { $content = "Hello World..."; printer_set_option($ph, PRINTER_MODE, "RAW"); printer_write($ph, $content); printer_close($ph); } else { echo "Couldn't connect..."; } I'm trying to test it using XAMPP on Ubuntu 14.04 LTS. But it gives me an error: Fatal error: Call to undefined function printer_open() in /opt/lampp/htdocs/test/test.php on line 4` How do I fix it? 回答1: Currently, there is no

Save Matlab Simulink Model as PDF with tight bounding box

久未见 提交于 2019-12-23 18:48:56
问题 Given a Simulink block diagram (model), I would like to produce a 'Screenshot' to be used later in a LaTeX document. I want this screenshot to be PDF (vector graphic, -> pdflatex) with a tight bounding box, by that I mean no unneccessary white space around the diagram. I have searched the net, searched stackexchange, searched the matlab doc. But no success so far. Some notes: For figures, there are solutions to this question. I have a Simulink block diagram, it's different (see below). I am

How to print GeckoWebBrowser to default printer?

ぃ、小莉子 提交于 2019-12-23 18:14:40
问题 I'm trying to print the document in a GeckoWebBrowser, but documentation is limited and to me, it's not at all clear. I found some code on the internet that at least communicates with the printer (it starts beeping) but I think the printer is asking for a Letter size paper, but it requires the settings to be from print.GetGlobalPrintSettingsAttribute() , if I try my own settings, it gives me a NotImplementedException . I suspect this is exception is raised on my Gecko.PrinterSettings, because

Ghostscript error with print function in Matlab

雨燕双飞 提交于 2019-12-23 18:00:04
问题 I am trying to save images in Matlab by using the print function: myImage = magic(500); myFigure = figure('visible','off'); r = 1; set(myFigure, 'PaperUnits', 'inches', 'PaperPosition', [0 0 1920 1080]/r); % the program works fine on both computers without the line above % however, the program runs fine on one computer only with this line imagesc(myImage); axis image; print(myFigure, '-dpng', sprintf('-r%d',r), 'myOutput.png'); When I run this program locally with Matlab R2012b, it works as