printing

How can I print to a variable instead of a file, in Perl?

北战南征 提交于 2020-01-13 08:37:09
问题 How can I print to a variable with Perl? I've been working on a program for a while which logs its iterative progress in a highly verbose fashion... print $loghandle $some_message; However, I'd like to also selectively print some of the messages to a different file. Naturally, I could sprinkle the code with... print $loghandle $some_message print $otherloghandle $some_message Or rewrite the whole business into a function. Blah. What I want to do is do some magic when I open the $loghandle so

How to set div height to 100% of chosen print paper?

亡梦爱人 提交于 2020-01-13 08:08:10
问题 How can i set the height to 100% of chosen print paper? CSS width: 100%; height: 100%; margin: auto; margin-top: 0px !important; border: 1px solid; When i print in Google Chrome, my printed div will only be as high as the content in the div. Can i solve this? Is it possible to make a div as high as chosen paper size? 回答1: width: 100%; height:100%; position:absolute; top:0px; bottom:0px; margin: auto; margin-top: 0px !important; border: 1px solid; also, if position absolute won't work you can

Printing pdf without preview in c #

妖精的绣舞 提交于 2020-01-13 07:21:29
问题 I am trying to print .pdf and .tif files using C# in windows application. Printing is done successfully, but my problem is Adobe reader is opening in background for pdf files and windows print dialogue opens for tif files. Actually i will run my method using a service, so these process should occur silently. What can I do to avoid this? Here is my code public void PrintDocument(string filepath) { //PrintDialog pd = new PrintDialog(); printProcess.StartInfo.FileName = filepath; //Also tried

How to detect bluetooth device and get the bluetooth address of detected device from android app

旧城冷巷雨未停 提交于 2020-01-13 06:46:31
问题 I want to the detect bluetooth device and get the bluetooth address of detected device from my android app . My task is to print a bill by using Bluetooth printer from my android app . 回答1: For the Bluetooth Searching Activity you require following things, Add Permissions in to your AndroidManifest.xml <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH" /> Minimum API level 7 and Android 2.1 version is required.

How do you find a user's last used printer in SysLastValue

眉间皱痕 提交于 2020-01-13 06:39:10
问题 I've been trying to find where a user's last used printer is stored so that I can clear this usage data (as a few users have an issue where the remembered printer keeps defaulting to the XPS writer, despite us having KB981681 installed & the printer being available; just not defaulted on certain AX forms). I know this data's somewhere in the Usage Data, which I can browse via AX: Microsoft Dynamics AX > Tools > Development Tools > Application Objects > Usage Data AOT > System Documentation >

How To Print Image with GTKSharp

僤鯓⒐⒋嵵緔 提交于 2020-01-13 05:43:08
问题 I'm porting an C# .NET application to Mono .NET for executing in OSX. Part of the application involves printing an image. Fairly easy in .NET and boils down to primarily e.Graphics.DrawImage(img, new Rectangle(x, y, printSize.Width, printSize.Height)); in the PrintDocument's PrintPage event. Mono does not have a full implementation of System.Drawing.Printing so it seems that the best way to go about doing this is using GtkSharp. I've found some examples online as to how to print text using a

How to Achieve print preview functionality with css and javascript .?

孤者浪人 提交于 2020-01-13 04:43:29
问题 I am trying to achieve print preview like view on web. I have to show a visual preview of how final print will look like. I have achieved something similar to this demo. var max_pages = 100; var page_count = 0; function snipMe() { page_count++; if (page_count > max_pages) { return; } var long = $(this)[0].scrollHeight - Math.ceil($(this).innerHeight()); var children = $(this).children().toArray(); var removed = []; while (long > 0 && children.length > 0) { var child = children.pop(); $(child)

UIActivityViewController use items in specific actions

…衆ロ難τιáo~ 提交于 2020-01-13 03:24:06
问题 I have a UIActivityViewController and i want to make it have all the actions safari does and more. Currently i can only get mail, messages, twitter, facebook and a semi-working copy. I set the activity items array with a url. I then added a nsstring of that url and added that with the url, and everything worked good like copying worked better by copying the string and i paste it in more areas. But when having the string also, twitter and facebook added the urls into their text and include the

Even page-break for double-sided printing in HTML & CSS

霸气de小男生 提交于 2020-01-12 17:30:48
问题 I've got page breaks working for print media with a quick page-break-after: always . I use these to separate multiple reports in a single batched print job. Unfortunately, when the print job is double-sided, the page break can cause the printer to start a report on the back of the previous report. Is there any way to force a page break to an even page? Or, alternatively, to detect which page number a certain element will appear on? 回答1: There's no built-in functionality in CSS for this. An

How to print a cheque through the receipt printer in Java?

寵の児 提交于 2020-01-12 08:37:28
问题 I have pos58 receipt printer (printer made in China), this printer supports ESC-POS Commands . I want to print out a cheque in Java without JavaPos api. Just I don't know how do this. Is there some way to implement it? Or what the library is? Or are there any examples of that? Thanks for advance. 回答1: Found this implementation after a quick web search, may help: https://code.google.com/p/escprinter/source/browse/trunk/net/drayah/matrixprinter/ESCPrinter.java?r=2 来源: https://stackoverflow.com