printing

Random “Printer selected is not valid” errors on Win2K8R2

别等时光非礼了梦想. 提交于 2019-12-23 12:56:22
问题 I recently changed the printing code for automated printing to a TPrinter based solution. (The old solution, writing text directly to the printer network device worked without errors for many years.) The application is written in Delphi 2009 Enterprise and runs continuously in a user session (not as a service). In regular intervals, the application scans a database for new documents, creates the text to be printed, and sends it to a printer. Before printing, the code sets the printer index:

LPR command to print pcl-file from windows service not working(Now a tray application)

不羁的心 提交于 2019-12-23 12:19:54
问题 I've been looking around for a while for a possible solution and explanation, but I can't find anything really. The following command is being run from a windows service. The same command does function if used directly in cmd. It does not return any errors or anything else for that matter. System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics

How to print flex spark datagrid by using the mx PrintDataGrid? Or is there other way to achieve this without using the mx PrintDataGrid?

ⅰ亾dé卋堺 提交于 2019-12-23 12:15:40
问题 this is my first time to ask here since my question is not answerable in the adobe flex forum. So at least finally, I've come to manage it here. Well, Flex 4.5+ is I guess everyone is working on nowadays so I asked this question since I haven't yet find working both spark datagrid and the mx printdatagrid components together . What I'm trying to achieve is to print all the data inside my spark datagrid. So when I do my research, we use the PrintJob or the FlexPrintJob classes. It works fine

C# PrintDocument and Printer Status

对着背影说爱祢 提交于 2019-12-23 10:56:43
问题 I am trying to get the printer status of a PointOfSale printer using the following code: Hashtable properties = new Hashtable(); ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win2_Printer"); foreach (ManagementObject obj in searcher.Get()) { if (obj["name"].ToString() == printerName) { foreach (PropertyData data in obj.Properties) { if(data.Name.ToLower() = "printerstatus") { int printerStatus = Convert.ToInt32(data.Value); } } } } Problem is, the status is

DPI Graphics Screen Resolution Pixels WinForm PrintPageEventArgs

回眸只為那壹抹淺笑 提交于 2019-12-23 10:26:05
问题 How do Dpi Points relate to Pixels for any display my application is running on? int points; Screen primary; public Form1() { InitializeComponent(); points = -1; primary = null; } void OnPaint(object sender, PaintEventArgs e) { if (points < 0) { points = (int)(e.Graphics.DpiX / 72.0F); // There are 72 points per inch } if (primary == null) { primary = Screen.PrimaryScreen; Console.WriteLine(primary.WorkingArea.Height); Console.WriteLine(primary.WorkingArea.Width); Console.WriteLine(primary

Prevent print() from outputting list indices in R

て烟熏妆下的殇ゞ 提交于 2019-12-23 10:07:18
问题 I have a list containing six plots, made like this: voi=c('inadist','smldist','lardist') plist <- llply(voi, function(v,df,s) { list( assign( paste(v,'.violin'), bwplot(groupname~df[,which(colnames(df)==v)]|fCycle*fPhase, data=df, groups=groupname, col=rainbow(1), box.ratio=3, main=paste('Distribution of ', v, ' by Treatment and Cycle'), sub=s, xlab=v, panel=panel.violin)), assign( paste(v,'.hexbin'), hexbinplot(df[,which(colnames(df)==v)]~starttime|groupname, data=df, xlab='Time(s)',main=

Prevent print() from outputting list indices in R

走远了吗. 提交于 2019-12-23 10:05:23
问题 I have a list containing six plots, made like this: voi=c('inadist','smldist','lardist') plist <- llply(voi, function(v,df,s) { list( assign( paste(v,'.violin'), bwplot(groupname~df[,which(colnames(df)==v)]|fCycle*fPhase, data=df, groups=groupname, col=rainbow(1), box.ratio=3, main=paste('Distribution of ', v, ' by Treatment and Cycle'), sub=s, xlab=v, panel=panel.violin)), assign( paste(v,'.hexbin'), hexbinplot(df[,which(colnames(df)==v)]~starttime|groupname, data=df, xlab='Time(s)',main=

Disabling “print” button in .net print preview dialog

隐身守侯 提交于 2019-12-23 09:56:06
问题 I'm working on a C# / .net app. I want the user to be able to print preview, but I don't want the user to be able to print from the print straight from the preview dialog. The print preview dialog has a little printer button on it that sends the previewed pages straight to the printer. Question is, is there a way to get rid of / disable / intercept this button click? 回答1: The PrintPreviewDialog class is actually a wrapper around the PrintPreviewControl class and it is what is supplying the

printing an image in landscape orientation?

早过忘川 提交于 2019-12-23 09:34:44
问题 I am converting a control to a bitmap and print it: using (MemoryStream ms = new MemoryStream()) { chart1.SaveImage(ms, ChartImageFormat.Bmp); Bitmap bm = new Bitmap(ms); PrintDocument doc = new PrintDocument(); doc.PrintPage += (s, ev) => { ev.Graphics.DrawImage(bm, Point.Empty); // adjust this to put the image elsewhere ev.HasMorePages = false; }; doc.Print(); } How can you specify to print it in landscape orientation? 回答1: doc.DefaultPageSettings.Landscape = true; http://msdn.microsoft.com

Add borders to each printed page with CSS?

送分小仙女□ 提交于 2019-12-23 09:34:25
问题 Is it possible in CSS or js to emulate the following format in printed media (eg showing borders for each page, with a page number and some text in the corner, with the content nicely split - and not chopped in half)? I have been using page-break-after to split the content up, but havn't found a way to add this kind of border/page number to each page. This only needs to work in WebKit. For further information, the reason I am doing this is I am printing HTML documents to PDF using wkhtml. 回答1