printing

Trigger Ctrl+P printing for a JQuery Modal Box through keyboard

大憨熊 提交于 2021-01-28 19:52:26
问题 I have a document which pops up on the site within a JQuery Modal Box. The document has a print button at the end which just prints the document in the Pop-Up Box. I am looking to find a solution that I can print the pop-up box by pressing Ctrl+P. Right now Ctrl+p prints all the page including the background ... I am just hoping to find a solution which helps me print the document in the pop-up only. My JQuery Modal Box is in iFrame and is shown in the following way:- <div id="frameContainer"

Printing to port 9100 with PJL and Python

試著忘記壹切 提交于 2021-01-28 05:23:44
问题 I believe this code should work to print a PDF directly to most printers on port 9100. This source and this one among others seems to agree on the details. My printer wakes up and seems to "spool a job" for a moment, but then just goes quiet again. The socket code is very crude of course, but still.. Maybe it's just my particular printer *. Grateful if somebody could test this or point out any errors or improvements. import socket job = [ b'\x1b%-12345X@PJL JOB NAME = "My Print Job Name"\r\n'

Brother printer Esc/P

若如初见. 提交于 2021-01-28 05:19:31
问题 I am wanting to print pricing labels for a list of products. I cannot use the csv as the prices change and am doing this through an in house application. How do I send like an array of data to the printer. I can print one label at a time, however this is slow. Through the P Template software it prints really quick. Any help would be much appreciated. I am sending the commands to the printer in Hex and they work ok. Can print with Esc/P mode and with P Template mode. P Template mode is better

Chrome seems to miscalculate css sizes given in mm unit when printing

我的未来我决定 提交于 2021-01-27 20:51:40
问题 I want to print to A4 using css. A4 is 297mm high - 6 mm margin top - 6 mm margin bottom = 285 mm should be left for content. In IE 11 : I have to set page borders to 6 mm and disable header/footer --> Text appears where it should when I set content height to 284 mm (1 mm diff is close enough for me) In Chrome 33: I don't have to change any settings --> Text is located far below from where it should be. It only works when I set content height to 267 mm (where did 18 mm diff go?) <!DOCTYPE

What parameters to pass to mshtml.dll?

孤人 提交于 2021-01-27 18:35:56
问题 I am currently trying to print a HTML file using mshtml.dll. Looking up in the registry I found for html-files, the following print-to entry: "%systemroot%\system32\rundll32.exe" "%systemroot%\system32\mshtml.dll",PrintHTML "%1" "%2" "%3" "%4" Unexpectedly there are some parameters to pass to mshtml.dll, what are the parameters of mshtml.dll (numbered %1, %2, %3, %4 in this registry information)? 回答1: You found this in the printto verb of the htmlfile progid. Which runs when you drag an HTML

Office.Interop.Word - How to print the document on both sides?

跟風遠走 提交于 2021-01-27 05:33:11
问题 I print documents (batch print) using Word.Document.PrintOut method. How can I print a document on both sides? In the MS Word interface it can be done through the File -> Print -> Print on Both Sides option. Word 2010, C#, .NET 3.5 Many thanks to John for his answer (+1)! There are results of my research: I went to the first path that John recommends, found a few additional articles, like "classic" article on CodeProject (Changing printer settings using C#) and several others derived from it.

page-break/webkit-region-break not working in chrome anymore?

感情迁移 提交于 2021-01-27 04:50:09
问题 I'm trying to make Chrome work with page-break for printing. I've found multiple topics here, and tried a lot of possible solutions, but non of them worked for me. The topic's i've tried: Google Chrome Printing Page Breaks, Page-Break-inside property is not working in chrome, CSS Page-Break Not Working in all Browsers And more.. I've created a jsfiddle to show what i've got for code: http://jsfiddle.net/bLezsLkr/1/ (can't post without code: CSS which is used) @media print { .pageBreak { page

Force landscape orientation in CSS

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-27 04:13:29
问题 I do set to landscape the size property of a CSS file to print pages in landscape @page { margin: 0.1cm; size: landscape; orientation: landscape; size: A4; Some pages are printed into portrait orientation, some in landscape orientation. How can i detect and force the pages to be printed in landscape using CSS ? 回答1: The CSS you provided has problems: The bracket does not close (missing } ), You overwrite size with A4 orientation seems to exist for media queries, but not as an attribute

Print txt file using javascript

喜欢而已 提交于 2021-01-23 04:50:08
问题 I would like to know if it is possible to print a txt file located in the server using javascript. I have noticed that window.print() just opens the print dialog for the current web page 回答1: You can only open the print dialog for the user, and that is as it should be. If you only want to print the text document, there are a couple ways you can trigger the print dialog for it. They require following the Same Origin Policy (your HTML and TXT files need to be in the same domain). The simplest

What is wrong with the syntax with line 7 in my code? It says my print statement has invalid syntax and I can't figure it out?

大兔子大兔子 提交于 2021-01-19 10:01:10
问题 total_cost_of_food = float(input('How much did the food cost? ')) sales_tax = 8.25 tax_plus_total = total_cost_of_food * sales_tax / 100 print("Your tax for this meal was:", tax_plus_total) x = bool(input("Would you like to add a tip? ") if x is False print("Thanks, your total for today is:", tax_plus_total) else print("That is", x, "I would like to add a tip") I keep getting this error for my print statement that is under the if statement, it says it's a syntax error but I don't see anything