Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

ps and printing

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 12-14-2007   #1 (permalink)
RS
Guest


 

ps and printing

I sure do find this thread useful.

I have written my first powershell script and want to send it's output
nightly to our laser printer. Everything seems to be working fine, except
that my secretary complains that the (default) font is too small to read.
Now, I'm not sure I've ever installed/deleted/selected or unselected any
font. So, my question....how can I specify which font or font size I would
like to be printed at run time. I've looked for an answer now for several
weeks (out-printer doesn't seem to have anything to help) and just can't
seem to find anyone talking about printers and fonts. Any help...gulp...
My application queries an sql db and prepares a unicode report nightly,
(text), which presently, I'm simply piping to the printer using
'out-printer'


My System SpecsSystem Spec
Old 12-17-2007   #2 (permalink)
Kuma
Guest


 

Re: ps and printing

On Dec 15, 1:08 pm, "RS" <fp...@xxxxxx> wrote:
Quote:

> I sure do find this thread useful.
>
> I have written my first powershell script and want to send it's output
> nightly to our laser printer. Everything seems to be working fine, except
> that my secretary complains that the (default) font is too small to read.
> Now, I'm not sure I've ever installed/deleted/selected or unselected any
> font. So, my question....how can I specify which font or font size I would
> like to be printed at run time. I've looked for an answer now for several
> weeks (out-printer doesn't seem to have anything to help) and just can't
> seem to find anyone talking about printers and fonts. Any help...gulp...
> My application queries an sql db and prepares a unicode report nightly,
> (text), which presently, I'm simply piping to the printer using
> 'out-printer'
From the help file on out-printer:
The Out cmdlets do not format objects; they just render them and send
them to the specified display destination.
No way that i can see to get powershell to change the font size before
sending it to out-printer. What I would suggest is sending the output
to a text file, then opening it with word, changing the size, then
printing it. IE

#Generate a file
Get-Help Get-WmiObject -Full | Out-File -Encoding 'Unicode' -FilePath
'C:\test.txt'
Create a Word App
$w=New-Object -ComObject Word.Application
#Load your file
$w.Documents.Add('C:\test.txt') > $null
#If you don't pipe it to null it spits out lots of useless information
#Change Font Size
$w.ActiveDocument.Content.Font.Size = 20
#Send To Default Printer
$w.PrintOut()
#Close File Discarding Changes
$w.ActiveDocument.Close(0)
#Close Word
$w.quit()

Not ideal but hopefully its a workaround until someone smarter than I
can help out.

GL
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
UAC and Printing Knihtisk Vista print fax & scan 3 03-27-2008 01:15 PM
Printing gwen Vista music pictures video 0 09-19-2007 08:22 AM
HP Printing RK_Tekt Vista print fax & scan 0 08-06-2007 01:08 PM
Printing Don Loeb Vista networking & sharing 4 06-22-2007 09:55 AM
Re: printing from win 98 ???? I still need help with this J Vista print fax & scan 3 04-18-2007 03:20 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51