printing

PrintServiceLookup.lookupPrintService solution in JBoss AS 7

前提是你 提交于 2019-12-22 10:28:48
问题 I am trying to print a pdf document from my JSF web application. When I call the method findPrinter() from main method, PrintServices are found, but when I call this method from web page PrintService are not found. Code mentioned below.. public static void main(final String[] args) throws Exception { PrintTest printTest = new PrintTest(); printTest.findPrinter(); } public void findPrinter() { PrintService[] printServices = PrinterJob.lookupPrintServices(); System.out.println("Print Services

CSS print a custom sized page margin when the content is on multiple pages

风格不统一 提交于 2019-12-22 10:24:01
问题 I'm trying to print an HTML page that might be long and contain text paragraphs and tables. My goal is to define a print margin for every page . I added the following CSS to my page: @media print { body { margin: 2.5cm 0; } } But the problem that I have is that the margin gets added only to the beginning and end of the document and NOT to every single page. As you can see from the attached image I have a margin top in the first page but not in the second one, my desired behavior is something

Win32 PrintDlg, PrintDlgEx, Crashing and quirkiness

ぐ巨炮叔叔 提交于 2019-12-22 09:49:05
问题 I'm tasked with solving the following issue: My application crashes when running on a 64 bit machine when the PrintDlg() function is called. After digging and hair pulling, I've decided the best solution is to replace the original calls of PrintDlg() with its bigger brother, PrintDlgEx(). Doing so fixes one problem (it no longer crashes!), but causes another. When I execute the code, it is not showing the print dialog, just returning a success code, and giving me all of the information for my

Android Application for printing with Bixolon R200

时光怂恿深爱的人放手 提交于 2019-12-22 09:43:39
问题 i am developing an android app for printing with Bixolon R200. i use bxlprint.jar's classes for my work. when i want print persian string like سلام ,printer print weird character. i used UTF-8 and UTF-16 for encoding. can u help me plz ? String PrintTextSample="سلام"; mBxlService.PrintText(PrintTextSample, BxlService.BXL_ALIGNMENT_LEFT, BxlService.BXL_FT_DEFAULT, BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT,"UTF-16"); 回答1: you must use Bixolon Character Map for Printing in other

How can we print different types of data types in objective-C?

爷,独闯天下 提交于 2019-12-22 09:10:34
问题 I want to print values of all the types like char, long... so on and also nsdate, nsdictionary, frame ....I want to now to print values of each type variables. 回答1: Primitive types such as int, float, double, etc can be printed in the same fashion they are printed in C, using printf , fprintf , etc. If you need to print the data of a class you can often use NSObject 's method (NSString *)description to get a NSString representing the data of the object. Here is an example... #import

how to print structure value(like gdb ptype) automatically in C?

不打扰是莪最后的温柔 提交于 2019-12-22 09:01:04
问题 This question stay in my head for a long time. As we know, we can easily print data structure in GDB when we debugging, like gdb ptype command, it can output all field value of structure. I know GDB use bfd library to read symbolic information in object file. My question is: if I want to do this in my C source code, how to do? because I don't want to printf each field of structure one by one. Is there have any exist library to solve this issue? I think that library will not only meets my

How can I print to a label printer from a web page

ぐ巨炮叔叔 提交于 2019-12-22 08:59:22
问题 I have an e-commerce web application and I'd some how like to make that print to a label printer for the back end stuff I have two questions 1) I can't print from a normal webpage straight to the printer (A zedbra LP2844 i think) it just throws out junk 2) I want to be able to print labels to the label printer, but all other printing, such as invoices would go to the default printer - a laser, so need someway of selecting the right printer It will all happen at a fixed location, so I can

Intercepting data sent to printer

99封情书 提交于 2019-12-22 08:47:32
问题 It is the data send from windows based POS application to the receipt printer that I would like to moniter and analyze. I do not have control of the POS application(brand may vary and no source code) so the best way is to intercept the printed data by hooking up a hardware device inline between the POS and the printer. I have done some reading and it seems that most of receipt printers accept ESC/POS command set. Does that mean POS actually sends ESC/POS commands such as 'PrintNormal xyz'?

CSS Print stylesheet - padding on the second page

我们两清 提交于 2019-12-22 08:23:20
问题 I'm designing a print stylesheet for a document which will run to a few pages. I want every page to have a company logo at the top, and top padding of 5 centimeters, so I did this: body { background:url(logo.png) no-repeat center top; padding-top:5cm; } The logo appears on each page as requested, perfectly. But the top padding only appears on the FIRST page, and every subsequent page has padding-top of zero. Am I doing something wrong? How can I get the top padding on EVERY page? 回答1: This

Android network printers discovery: NullPointerException

限于喜欢 提交于 2019-12-22 08:23:08
问题 This question does sound strange, but I never experienced this before. I'm working on network printer application and use NsdManager to discover printers in the WiFi network. It had been working fine for last two weeks, discovering and resolving printers in the same WiFi network. But all of a sudden I started getting the following exception every time I initiate discovery: 06-03 15:38:07.351: ERROR/AndroidRuntime(16849): FATAL EXCEPTION: NsdManager java.lang.NullPointerException at android