printing

flutter capture the widget to image and then create PDF file to printer

余生长醉 提交于 2020-01-23 17:35:05
问题 My flutter app captures the widget to image and then creates PDF file to printer, but it shows ridiculous result as below picture. Let me know if you have any better method to print Chinese character and qr image to a receipt (bluetooth printer with paper width 75mm) Here with the widget: RepaintBoundary( key: _renderObjectKey, child: ListView( children: <Widget>[ Form( key: tableNumberFormKey, child: ListTile( title: TextFormField( initialValue: "", style: TextStyle(fontSize: 48.0),

Printing with my custom fonts is not working

自闭症网瘾萝莉.ら 提交于 2020-01-23 16:58:45
问题 I created a webpage with the custom font, I can see the fonts applied in the browser but its not applied in the printed page. I followed the below way for printing : The fonttest.css file contains the following content : @font-face { font-family: "myriad"; src: url("../fonts/myriad.otf") format('truetype'); } @font-face { font-family: "serifa-bold"; src: url("../fonts/serifa_bold.ttf") format('truetype'); } @font-face { font-family: "serifa"; src: url("../fonts/serifa.ttf") format('truetype')

Retrieving list of all installed printers via JavaScript

僤鯓⒐⒋嵵緔 提交于 2020-01-23 16:22:45
问题 I have been given a screenshot from a web page which shows the list of all installed printers accessible by the client (local and network ones) in a combobox and let user select one. Even there is a button to refresh the list! I do not have access to the page and cannot prove the functionality. Is that even possible to do this or simulate this job by any means in a web page? 回答1: If I had to hazard a guess, I'd say that it's most likely a list of network printers, retrieved via some server

C# code to get maximum dpi of installed or selected printer

醉酒当歌 提交于 2020-01-23 13:29:11
问题 I want to get Maximum Dpi of installed or selected printer. I tried PrinterSettings ps = new PrinterSettings(); MessageBox.Show(ps.PrinterResolutions.ToString()); and I get this output: System.Drawing.Printing.PrinterSettings+PreinterResolutionCollection (The desired output is 600x600). 回答1: Using LINQ: PrinterSettings ps = new PrinterSettings(); var maxResolution = ps.PrinterResolutions.OfType<PrinterResolution>() .OrderByDescending(r => r.X) .ThenByDescending(r => r.Y) .First(); MessageBox

Windows 8 printing Postscript file programmatically

拟墨画扇 提交于 2020-01-23 09:11:07
问题 I've spotted a strange problem while printing a Postscript file . So here is my setup: I have a Windows 8 PC , on this PC there is an C# application "NetworkPrintTest.exe", which, when executed, should open a PDF, generate a Postscript file and ultimately should print it. But it doesn't do anything. I don't get an error but it won't print either. The same program runs error free on windows 7 and i even get the printer to print the file. As mentioned above the .ps file is generated

C++, ternary operator, std::cout

纵饮孤独 提交于 2020-01-23 04:52:11
问题 How to write the following condition with a ternary operator using C++ int condition1, condition2, condition3; int / double result; //int or double .... std::cout << ( condition1: result1 : "Error" ) << ( condition2: result2 : "Error" ) << ( condition3: result3 : "Error")...; 回答1: Depends on what type is result1, result2 etc. expressionC ? expression1 : expression2 isn't valid for all types of expression1 and expression2 . They must necessarily be convertible to a common type, roughly

How to use PrintDocument with a scrollable Panel?

二次信任 提交于 2020-01-22 02:48:08
问题 How do I use PrintDocument with a scrollable panel`? Here is some of my code: MemoryImage = new Bitmap(pnl.Width, pnl.Height); Rectangle rect = new Rectangle(0, 0, pnl.Width, pnl.Height); pnl.DrawToBitmap(MemoryImage, new Rectangle(0, 0, pnl.Width, pnl.Height)); Rectangle pagearea = e.PageBounds; e.Graphics.DrawImage(MemoryImage, (pagearea.Width / 2) - (pannel.Width / 2), pannel.Location.Y); 回答1: This is a simplified method to print the content of a ScrollableControl to a Bitmap. A

Get the total amount of pages from Win32_PrintJob

早过忘川 提交于 2020-01-21 03:48:05
问题 The Win32_PrintJob WMI class has lots of properties. (see: Win32_PrintJob on MSDN) I have a small .NET application that poles the printing jobs and displays the jobs' information. The TotalPages propery gives the amount of pages sent. But that figure DOESN'T take into account the number of copies requested by the user. So, if a user wants to print 5 copies of a two page document, the value of TotalPages will be 2, not 10. How can i get the number of copies for a printing job, or get the total

How to print a df in Terminal without loosing format?

梦想与她 提交于 2020-01-21 03:25:28
问题 How can I print a df in the Terminal without loosing the format? Lets say I have a df like this: In: df Out: TFs No Esenciales Genes regulados Genes Regulados Positivamente Genes Regulados Negativamente No Tentativo de genes a silenciar No Real de genes a silenciar No Tentativo de genes a inducir 146 YdeO 20 18 2 2 2 0 But when I use print to display it in the shell, It looses its format In: print (df) Out: TFs No Esenciales Genes regulados Genes Regulados Positivamente \ 146 YdeO 20 18 Genes

How to set printer margin in java

坚强是说给别人听的谎言 提交于 2020-01-20 08:07:24
问题 when trying to print using the Print API - the margins seem to be something not in our control!.. Please help me out to set printer margins or is there any way to set margins at Operating system level. By default all the four left, right, top and bottom are set to 1. 回答1: I'm using the Java Printing API, but have problems setting print margins. ... Solution I had to provide additional print attributes to override the default print margins, MediaPrintableArea. Most printers cannot print on the