printing

Can't generate pdf with acceptable output quality using Qt

£可爱£侵袭症+ 提交于 2020-01-01 14:55:07
问题 I'm trying to generate a pdf using Qt5 under Windows. My document contains texts, images and charts. As I'm familiar with Qt and Qwt, I believed the best strategy was to create a QWidget with my document layout and simply print it. But I face problems and could not end up with an acceptable result. Here is my MCVE, a simple page document with: A header with title and image A piece of text A simple chart Based on Qt document and How can I print a QWidget in Qt?, I ended up with this code: main

Print data frame with columns center-aligned

扶醉桌前 提交于 2020-01-01 12:32:08
问题 I would like to print a data frame where the columns are center aligned. Below is what I have I tried, I thought printing the data frame test1 would result in the columns being aligned in the center but this is not the case. Any thoughts on how I can do this? test=data.frame(x=c(1,2,3),y=c(5,6,7)) names(test)=c('Variable 1','Variable 2') test[,1]=as.character(test[,1]) test[,2]=as.character(test[,2]) test1=format(test,justify='centre') print(test,row.names=FALSE,quote=FALSE) Variable 1

Printing contents of controls in C#?

风流意气都作罢 提交于 2020-01-01 12:14:16
问题 I have never printed anything using C#. I was just wondering what the standard way to do this was. On my form I have a few listboxes and a few textboxes. I would like to print their contents and show them in a print preview, with a nice layout in a table. Then from their I would like the user to be able to print. Thanks in advance! 回答1: You will want to use System.Drawing.Printing libraries. You'll use the PrintDocument.Print method which you can find on the MSDN Page with Example 回答2: Here's

Linux piping ( convert -> pdf2ps -> lp)

一笑奈何 提交于 2020-01-01 11:44:26
问题 Ok, so I can print a PDF doing: pdf2ps file.pdf - | lp -s But now I want to use convert to merge several PDF files, I can do this with: convert file1.pdf file2.pdf merged.pdf which merges file1.pdf and file2.pdf into merged.pdf , target can be replaced with '-'. Question How could I pipe convert into pdf2ps and then into lp though? 回答1: convert file1.pdf file2.pdf - | pdf2ps - - | lp -s should do the job. You send the output of the convert command to psf2ps, which in turn feeds its output to

Linux piping ( convert -> pdf2ps -> lp)

丶灬走出姿态 提交于 2020-01-01 11:43:46
问题 Ok, so I can print a PDF doing: pdf2ps file.pdf - | lp -s But now I want to use convert to merge several PDF files, I can do this with: convert file1.pdf file2.pdf merged.pdf which merges file1.pdf and file2.pdf into merged.pdf , target can be replaced with '-'. Question How could I pipe convert into pdf2ps and then into lp though? 回答1: convert file1.pdf file2.pdf - | pdf2ps - - | lp -s should do the job. You send the output of the convert command to psf2ps, which in turn feeds its output to

What causes System.Drawing.Printing.PrinterSettings.InstalledPrinters to throw Win32Exception “RPC server not available”?

夙愿已清 提交于 2020-01-01 11:34:12
问题 I have an application that I'm working on and I allow the user to select a printer to use as their printer while printing forms from the application. I'm using .NET 2.0 In the settings screen, I call System.Drawing.Printing.PrinterSettings.InstalledPrinters to get the list of available printers. On a client's machine, the property throws an exception: System.ComponentModel.Win32Exception: The RPC server is unavailable The client is reporting that windows shows his printer as 'ready', and the

How to use print.css to make a select look like normal text

懵懂的女人 提交于 2020-01-01 10:57:11
问题 I have a web page that display this: The Html behind this is: <label>Approved For Payment:</label> <select id="Invoice_ApprovedForPayment" class="dropdownapprovedforpayment" name="Invoice.ApprovedForPayment" lineid="299" disabled="disabled"> <option value="null" selected="selected">Please Approve</option> <option value="true">Accepted</option> <option value="false">On Hold</option> </select> Currently when this page is printed the Please Approve is coming out like shown. As in it prints it as

Java: get printer status (paper low/out)

拜拜、爱过 提交于 2020-01-01 10:52:34
问题 I have printed this way FileWriter imp = new FileWriter("COM2"); while ((linea = br.readLine()) != null) { imp.write(linea); imp.write(0x0A); } Well now Im using the port COM2, I have a printer that receive a hex code and its response will back in type byte, I dont know how to do it with java. Somebody has done it before? Thanks. 回答1: You could try using javax.print.attribute.standard.PrinterStateReason This class is a part of the javax.print.* packages. 来源: https://stackoverflow.com

Java: get printer status (paper low/out)

白昼怎懂夜的黑 提交于 2020-01-01 10:52:05
问题 I have printed this way FileWriter imp = new FileWriter("COM2"); while ((linea = br.readLine()) != null) { imp.write(linea); imp.write(0x0A); } Well now Im using the port COM2, I have a printer that receive a hex code and its response will back in type byte, I dont know how to do it with java. Somebody has done it before? Thanks. 回答1: You could try using javax.print.attribute.standard.PrinterStateReason This class is a part of the javax.print.* packages. 来源: https://stackoverflow.com

Printing a DataTable to textbox/textfile in .NET

随声附和 提交于 2020-01-01 10:17:13
问题 Is there a predefined or "easy" method of writing a datatable to a text file or TextBox Control (With monospace font) such as DataTable.Print(): Column1| Column2| --------|--------| v1| v2| v3| v4| v5| v6| Edit Here's an initial version (vb.net) - in case anyone is interested or wants to build their own: Public Function BuildTable(ByVal dt As DataTable) As String Dim result As New StringBuilder Dim widths As New List(Of Integer) Const ColumnSeparator As Char = "|"c Const HeadingUnderline As