printing

How to print a Workbook file made using Apache Poi and java?

狂风中的少年 提交于 2020-01-11 11:25:49
问题 I create one page workbook files in eclipse and need to open the print dialog box and print these files off. I understand how to open the print dialog box and everything, i just can't find how to tell the system that it is the workbook file "wb" that is what i'm wanting to print. So opening the dialog just doesn't work unless it knows what i'm trying to print with it. Could someone at least send me in the right direction Without telling me to read the java print dialog tutorials. I've read

How to print a PDF created with iText?

前提是你 提交于 2020-01-11 09:53:48
问题 Hi I have created a PDF file with an image in it, I want to print my pdf after creating. Better if I have the PDF in memory instead of having a file, and then send it to the printer... Any Idea ? I am using iText. Check my code: import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.Image; import com.lowagie.text.PageSize; import com.lowagie.text.Rectangle; import com.lowagie.text.pdf.PdfContentByte; import com.lowagie.text.pdf

In Java how do I change or set a default printer

£可爱£侵袭症+ 提交于 2020-01-11 07:15:12
问题 I know how to get the list of available printers, I want users to be able to select from a list and set that to the default for the session Using Windows 7 I know that this is easily done I just want to create a simple java program a: To increase my knowledge b: Teachers here are very adverse to playing with printing properties Thanks for your help in advance 回答1: This program works in Eclipse. import java.awt.print.PageFormat; import java.awt.print.PrinterJob; public class PrinterSetup {

ESC POS command ESC* for printing bit image on printer

爷,独闯天下 提交于 2020-01-11 03:56:05
问题 I want to print a bitmap logo file with ESC POS command ESC*. Following is the link for technical documentation of the command. https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=88 According to me, the printer requires the image data in the form of 1s and 0s. So, it prints a dot, with the occurrence of 1 and blank, with the occurrence of 0. But I am not able to figure out how to send multi line bit image data with the help of above command, since the command accepts only

Command line photo printing in Windows 7

孤人 提交于 2020-01-10 20:09:10
问题 I need to print a photo (.jpg) from the command line in Windows 7. I have tried using lpr to no success, and found methods for Windows XP like the following: rundll32 shimgvw.dll ImageView_PrintTo /pt myPhoto.jpg "myPrinter" This doesn't work (not surprising), and my hours of Googling has turned up nothing else. I'm trying to find a stock way to do this on any Windows 7 machine without needing to install or set anything up. Does there exist such a command? 回答1: Maybe reformatting the command

Saving Panel as JPEG, only saving visible areas c#

限于喜欢 提交于 2020-01-10 15:39:07
问题 I'm trying to save, and then print a panel in c#. My only problem is that it only saves the visible areas and when I scroll down it prints that. Bitmap bmp = new Bitmap(this.panel.Width, this.panel.Height); this.panel.DrawToBitmap(bmp, new Rectangle(0, 0, this.panel.Width, this.panel.Height)); bmp.Save("c:\\panel.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); 回答1: Try following public void DrawControl(Control control,Bitmap bitmap) { control.DrawToBitmap(bitmap,control.Bounds); foreach

Change printer properties in excel macro

跟風遠走 提交于 2020-01-10 10:27:12
问题 Is there any way I can change printer properties to color rather than black and white in an Excel macro/Excel VBA? I would like to print in color from the macro but every time I exit excel it sets the color to black and white. I would like for the macro to set the color back to color every time I run it. This is the code I am using to print: Workbooks("Book1.xlsm").Worksheets("Sheet3").PrintOut from:=1, To:=(i / 2) - 0.5 This prints every page effected by the macro but it does it in black and

Change printer properties in excel macro

萝らか妹 提交于 2020-01-10 10:24:32
问题 Is there any way I can change printer properties to color rather than black and white in an Excel macro/Excel VBA? I would like to print in color from the macro but every time I exit excel it sets the color to black and white. I would like for the macro to set the color back to color every time I run it. This is the code I am using to print: Workbooks("Book1.xlsm").Worksheets("Sheet3").PrintOut from:=1, To:=(i / 2) - 0.5 This prints every page effected by the macro but it does it in black and

vim regex for python2 print to python3

百般思念 提交于 2020-01-10 05:38:26
问题 So say I have a python v2.7 file with some code like this: print 'asdf' print 'hi mom!' But I want to run it in python3, I'll need to add those parenthesis to them like so: print('asdf') print('hi mom!') I was trying to use the following regex in vim to solve the problem, but it wasn't working: :%s/print\ '.*'/print('\1')/gc It just gave me print functions (with parenthesis) that had empty strings. Any help is appreciated; thanks. 回答1: This would work for your examples :%s/print \('.*'\)

how to remove print header/footer with code

懵懂的女人 提交于 2020-01-10 05:15:47
问题 I am using the following code to print a page within my application... <html><body onload=""window.print();"">" sHtmlBody = sHtmlBody & "<body>" The window.print() is working fine. I know once the print comes up I can manually go into the settings and remove headers and footer. On IE I know that I have to go to print preview and then remove the print headers. However, is there some line of code which does this automatically so the users of the application don't have to do this? EDIT: