To print the contents of a TRichEdit I use
RichEdit.Print('My Document Name');
Some times I need to print it on "printer1" other times I need to print it on "printer2"
Question:
How I tell the system what printer to use ?
You set the Printer.PrinterIndex. As documented, setting '-1' sets to the default printer, and the Printers property contains a list of installed printers.
Related
What would be a good method to automatically route print jobs to different printers based on the printed filename?
It looks like Ricoh Print and Share may be able to do it though I haven't tried... they categorize the tool as a "virtual printer driver", but, in general it seems that we would just want to insert some program between the system print interface and the actual printer. So, the term 'print filter' seems like it might be relevant also.
Thoughts?
UPDATE: RedMon looks interesting. See here.
I'd like to know if there's a way to set a minimum number of copies to be printed via code, because I need a document to be printed by duplicate.
I read the documentation on Apple developers page but I couldn't find anything.
I know you can set the number of copies from the printer dialog, but I need the minimum to be 2 by default.
Thanks in advance!
EDIT:
I tried this and it didn't work for me, at least in Xamarin.
There is nothing exposed via UIPrintInteractionController or its delegates that allows you to change/override the number of copies.
The way I approach this is to write my own UIController that defines the properties that the user is allowed to change and then use UIPrintInteractionController.PrintToPrinter to directly print the content.
Another approach is to disable the number of copies display:
UIPrintInteractionController.ShowsNumberOfCopies = false;
And then provide a two element array to PrintingItems vs. PrintingItem that just contains two copies of your print object.
Another approach just allow the user to select the printer via UIPrinterPickerController, save the UIPrinter to skip it in the future and then call PrintToPrinter twice.
I have set up a rule to quite simply print out an email when received from a certain address (Amazon sales) - The idea being that as orders come in, they are auto printed and waiting to be packed.
However the amazon emails require 2 pages.
under the Rules menu in Outlook, the option is simply "Print" but no further print preferences are available.
Is there a way to get it to print the first page only? a script possibly?
No, Outlook Object Model does not porvide any fine controls over the print functionality. As a workaround, you can export the message as a DOC file (MailItem.saveAs), then programmatically load it in Word and use the Word Obejct Model to print it.
There's a PrintOut method in Excel that prints stuff.
It accepts a printer name as a parameter, and that printer name is not just a system printer name, but a combination of both system printer name and port to which the printer is connected.
.PrintOut ActivePrinter:="MyPrinter" & " on " & "Ne00:"
If you only provide a system name, Excel will not find it and will not print.
Note that " on " piece in the middle. It is actual English word "on" that makes "excel printer name" human-friendly.
The problem is, this little piece is different on each localised version of Excel. Therefore, code that wants to compose true "excel printer name" would need to include a huge switch where all possible Excel locales would be listed with corresponding translation of "on". I haven't even got such list. But I would like to have it, or to hear about a way to figure out this piece on the fly. The Application.International property does not seem to contain an answer.
This guy uses the registry entries at
\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices\
http://www.dailydoseofexcel.com/archives/2008/04/05/getting-the-printer-port/
You can first read the ActivePrinter property. It will return the string as per the locale. Once you have the string, you can get what exact version of "on" to use!
I'm using a file open dialog to chose image files for further editing. The filter list contains an "All supported formats" entry which represents a long list of file formats.
Since Vista automatically appends the wildcard patterns in the filter combobox, the expanded combobox is too wide to fit completely on the screen. Besides that it doesn't look very well.
So is it possible to disable this behaviour and let Vista display the original filter string?
Regards,
Daniel
Vista only appends the file format list to the text if you haven't already done so yourself. So if your filter is "All Supported Formats|*.jpg;*.bmp;..." then it will automatically add it, but if it's "All Supported Formats (*.*)|*.*" then it doesn't. It does check that there is a wildcard, but it doesn't check that they match, so either of these approaches would work:
"All Supported Formats (*.*)|*.jpg;*.bmp;*.gif"
"All Supported Formats (*.jpg;...)|*.jpg;*.bmp;*.gif"