Hello all,
I am coming to PS Studio with experience from another development studio (of which I shall omit the name so there's no conflict of interest). In the aforementioned programming suite, I could create a printer canvas object, write text and graphical elements to the object, and then simply send it to the printer on the end user's machine (the user running the application). I have found printing more difficult in PowerShell - and by extension, in PowerShell Studio.
So far, I have tried to print by passing to the MS Word executable, the Wordpad executable, and even the Internet Explorer executable. Although I can get usable printouts using these methods, I find these solutions very "dirty." I am curious if there's any really slick printing solutions that you all are aware of that could be utilized to print "rich text" from an end user's machine, using only PowerShell.
I am not versed in C# or .NET, but I imagine folks would be utilizing System.Drawing.Printing in some way to achieve this. As a self-admitted novice to .NET framework, I am unsure how to work up something from scratch to achieve the aforementioned results ("rich text" printing) via PowerShell
I would love to hear your thoughts on this! Thank you.
Printing & PowerShell; Thoughts?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Printing & PowerShell; Thoughts?
Yes. We use the Net Printing classes to create a graphical context and use standard System.Drawing methods to write into the graphical context (Canvas).
Attached is a simple example.
Attached is a simple example.
- Attachments
-
- Demo-PrintDocument3.psf
- (15.65 KiB) Downloaded 157 times