printing

How to concatenate string in java

社会主义新天地 提交于 2021-02-04 16:46:33
问题 Here is my code for string concatenation. StringSecret.java public class StringSecret { public static void main(String[] args) { String s = new String("abc"); s.concat("def"); System.out.println(s); } } I expected that the output will be "abcdef" but I am getting only "abc" printed. What's the problem !. 回答1: In java, string objects are immutable . Immutable simply means unmodifiable or unchangeable. Once string object is created its data or state can't be changed but a new string object is

How to disconnect print event handler in uwp printing?

a 夏天 提交于 2021-01-29 21:52:21
问题 I need to print a single xaml-page within a multiple page UWP-app. I only get as far as printing this page, but when leaving that page and trying to navigate back to it the following exception is thrown: For the PrintTaskRequested-event only one handler at a time can be registered (translated). The MS-instruction says that you have to disconnect the printing event handlers when you leave the printing page. Strange enough I found 2 short and understandable uwp-printing examples here on

Specify Printer when Printing Files

烂漫一生 提交于 2021-01-29 20:52:39
问题 I have a macro that prints all files within a specific folder but each time it opens a file it asks which printer to print from. I want to enter the printer name or IP instead of asking the user or using the default printer. Sub PrintDespatches() Dim wb As Workbook, ws As Worksheet Dim FileName As String, path As String Set wb = ActiveWorkbook Set ws = ActiveSheet path = "Z:\Customer Operations\2021\Despatches\*.csv" FileName = Dir(path, vbNormal) Do Until FileName = "" Application

Use VBA to tell Outlook to print to a specific printer

≡放荡痞女 提交于 2021-01-29 18:06:31
问题 Is there any way to write a VBA macro in Outlook that forces a printout to a specific printer (even if it's not necessarily the default printer), similar to the Word Application.ActivePrinter = "Printer Name" option? I'd like to create a button that prints the current email and attachments to a specific printer (in this case a PDF printer, but I'm guessing it should be the same principle regardless), but can't seem to find a way to force which printer is used in the code. Thanks. 回答1: No,

Using a timer to delay a line by line readline method C#

不羁的心 提交于 2021-01-29 17:43:04
问题 I am using C# Windows Forms using Visual Studio 2010. Don't let the Console part confuse you it's a user defined thing not the actual console. So I have a method that prints a file line by line. I have to make it appear to print slowly so I am currently using Thread.Sleep to slow the line by line printing. I cannot use this because it freezes up some other components in the program. I was hoping to see if this could be done with a timer instead. Though all the examples I see being used with a

How to generate utf-8 tables in jsPDF?

岁酱吖の 提交于 2021-01-29 12:58:56
问题 I test jsPDF playground, Arabic section http://raw.githack.com/MrRio/jsPDF/master/#, but couldn't make a utf table . here is the code which I've used, I wonder how should I fix this, var generateData = function(amount) { var result = []; var data = { coin: "100", game_group: "گروه", game_name: "سلام", game_version: "25", machine: "20485861", vlt: "0" }; for (var i = 0; i < amount; i += 1) { data.id = (i + 1).toString(); result.push(Object.assign({}, data)); } return result; }; function

ESC/POS printing barcode aligned vertically and horizontally in the middle?

青春壹個敷衍的年華 提交于 2021-01-29 12:30:36
问题 My code is currently printing a barcode and hri text easily, but I want everything to be printed dead centre on the label. Can someone please tell me when I should declare the alignment command? I tried declaring it at the beginning and just before the barcode print command, but the barcode is still printing in the top left corner. Here is my align command: def align_esc(self,esc,n): ''' ESC|a|n 0<=n<=2,48<=n<=50 0,48 = Left; 1,49 = Mid; 2,50 = Right ''' align = [esc,n] align_prnt = bytearray

How to generate utf-8 tables in jsPDF?

时光毁灭记忆、已成空白 提交于 2021-01-29 11:46:39
问题 I test jsPDF playground, Arabic section http://raw.githack.com/MrRio/jsPDF/master/#, but couldn't make a utf table . here is the code which I've used, I wonder how should I fix this, var generateData = function(amount) { var result = []; var data = { coin: "100", game_group: "گروه", game_name: "سلام", game_version: "25", machine: "20485861", vlt: "0" }; for (var i = 0; i < amount; i += 1) { data.id = (i + 1).toString(); result.push(Object.assign({}, data)); } return result; }; function

Printing a Numpy Array [closed]

北城余情 提交于 2021-01-29 09:32:48
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 months ago . Improve this question I am trying to print the results of some previous calculations, and am having some issues using Numpy to print the values out of an array correctly. Each of the variables in the loop is defined by calculations previously, and it needs to run thru the speed permutations to get

python win32print can't set custom page size

旧时模样 提交于 2021-01-29 08:42:34
问题 i am trying to print pdf file with custom page size in python with win32print i can change other setting like number of copies but setting custom page length and width is not working it always try to fit pdf content into page by covering whole page this is my code printers=win32print.EnumPrinters(win32print.PRINTER_ENUM_LOCAL) PRINTER_DEFAULTS = {"DesiredAccess":win32print.PRINTER_ALL_ACCESS} temprint=printers[1][2] handle = win32print.OpenPrinter(temprint, PRINTER_DEFAULTS) level = 2