printing

cocoa osx print pdf document

扶醉桌前 提交于 2019-12-24 03:32:36
问题 In my cocoa application I obtain a pdf document from my webview. I need to print that pdf. I read that there is NSPrintOperation printOperationWithView method, but this method prints a view of the document. Is there anyway for printing directly from a file url? How can I achieve this correctly? This is my code: NSString *fileName = [NSString stringWithFormat:@"%@/mypdf.pdf", documentsDirectory]; NSData *pdfFinal = [[[[webView mainFrame] frameView] documentView] dataWithPDFInsideRect:[[

Printing specific items out of a list

只愿长相守 提交于 2019-12-24 03:09:32
问题 I'm wondering how to print specific items from a list e.g. given: li = [1,2,3,4] I want to print just the 3 rd and 4 th within a loop and I have been trying to use some kind of for-loop like the following: for i in range (li(3,4)): print (li[i]) However I'm Getting all kinds of error such as: TypeError: list indices must be integers, not tuple. TypeError: list object is not callable I've been trying to change () for [] and been shuffling the words around to see if it would work but it hasn't

iText Java disable print pdf

霸气de小男生 提交于 2019-12-24 02:57:22
问题 We are using the following code to disable Print option in PDF. Works really well. PdfReader reader = new PdfReader("my-old-file.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf")); stamper.setEncryption("my-owner-password".getBytes(), "my-user-password".getBytes(), PdfWriter.AllowCopy, PdfWriter.STRENGTH40BITS); stamper.close(); Everything was hunky dory till yesterday. We decided to update PDF Reader version to 9.3 from version 8.2 The print option is

What's the difference between barcode fonts vs barcode printer fonts

好久不见. 提交于 2019-12-24 02:22:55
问题 Does anybody have any idea about the differences between barcode fonts (used as a font in reports) and fonts that are printed directly from a barcode printer? Why should we put a star before and after the barcode font? It's my understanding that we don't need that when we use a barcode printer... why not? 回答1: The star character is part of the specification for Code 39. It is used as a delimiter for the barcode itself. Barcode readers will not recognize the code if the stars are not present.

Get default printer remotely

笑着哭i 提交于 2019-12-24 02:17:01
问题 Windows 7: cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -g Windows XP: cscript C:\windows\system32\prnmngr.vbs -g These will get the default printer of the current system. I was wondering if there is a way to run this on my computer to get the default printer of a remote computer by computer name? I tried running: psexec \\c78572 -i -d cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -g And it appears to run.. but I only see the results in a quick

What is the file path, as a string, of a file in the application's resources?

≡放荡痞女 提交于 2019-12-24 02:05:37
问题 The reason I ask is that I want to print, at run-time, a file in the application's resources, like this: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim printProcess As New Process printProcess.StartInfo.CreateNoWindow = True printProcess.StartInfo.FileName = "C:\Users\Geoffrey van Wyk\Documents\Countdown_Timer_Help.rtf" printProcess.StartInfo.FileName = My.Resources.Countdown_Timer_Help printProcess.StartInfo.Verb = "Print"

Configuring a printer's redirect port via prompt

偶尔善良 提交于 2019-12-24 01:54:18
问题 I've been trying to create an installer for a program I wrote in Java, implementing GhostScript, that creates a virtual printer where the file is sent to. My program then reads the files and manages it accordingly. However, I had to manually configure the RedMon Redirect Port (RPT1:) and manually created a new printer, using that port, taking as arguments the .jar file: Arguments configured on the printer's port: I was able to create a new printer via NSIS (the program I'm using to create the

Printing in Silverlight 4 without Print Dialog - Out of Browser and elevated trust

蹲街弑〆低调 提交于 2019-12-24 01:53:39
问题 How can I print in Silverlight 4 without a print dialog showing all printers. Many people say it not possible but they always talk when the app is running in the web browser. In this case I'm out of browser and with elevated trust. Any suggestions? 回答1: Even with elevated trust, you are still going to have to deal with the print dialog using the print API. I know a couple of people who have written POS systems in Silverlight and resorted to using COM interop to handle printing straight to a

UWP : Print with out Printer Popup Dialoag

依然范特西╮ 提交于 2019-12-24 00:55:50
问题 Am developing an application using UWP. I need to add PRINT feature.I have sample code to print. It is showing Print Popup dialoag.But Can any one suggest how to print with out that print popup. How to do it programmatically click Print button. 回答1: In UWP app if you want to use a Windows Driver Printer than I am sorry the only option is to print using the Print Popup dialog. If you want to print to a specific printer without print dialog then there are two ways- The printer should be OPOS

Print multiple pages from TextBox

大兔子大兔子 提交于 2019-12-24 00:45:50
问题 private void PrintTextBox(object sender, PrintPageEventArgs e) { e.Graphics.DrawString(textBox1.Text, textBox1.Font, Brushes.Black, 50, 20); } private void printListButton_Click(object sender, EventArgs e) { PrintDocument pd = new PrintDocument(); pd.PrintPage += PrintTextBox; PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = pd; ppd.ShowDialog(); } I tried in PrintTextBox method using the e.HasMorePages == true but then it continously started to add pages. Do you have any