Start-Process | landscape mode

Hi folks,  how I can in powershell print off the results of the following code in landscape mode:

$result | Where {!$_.Values} | Foreach {Start-Process -FilePath "s:\INVOICES\0070\$($_.Invoices).pdf"
nesher13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Depends on what you mean with "print". Sounds as if you need to control how Acrobat Reader (or FoxIt or whatever PDF viewer you use) displays the PDF, and that usually depends on the viewer's abilities.
Start-Process itself has a -WindowStyle paramter you can feed with one of Normal, Hidden, Minimzed, Maximized, and that is always worth a try.
0
nesher13Author Commented:
Qlemo

Sorry, mistake, the code:

$result | Where {!$_.Values} | Foreach {Start-Process -FilePath "s:\INVOICES\0070\$($_.Invoices).pdf" –Verb Print}
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
The "print" verb prints out the document with the settings put into the document or the default printer's default settings. So correct way to handle this is to generate the PDFs in landscape mode - which sounds unreasonable, as invoices are of letter type most of the time.
Also, if you print out a portrait PDF in landscape mode, it will require two pages, as you can't change the PDF page layout other than by zooming.
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

nesher13Author Commented:
Qlemo

it will require two pages, as you can't change the PDF page layout other than by zooming.

Landscape printing contain only 1 page. I search for programmatically solution. Maybe there is another cmdlet ?
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Controlling an application is only feasible if you know the application exactly - e.g. fixing to use Acrobat Reader.
After that, you either need to access the COM application object, or simulate keystrokes. Do you really want to go that far?
0
nesher13Author Commented:
Qlemo

Acrobat is the right application.
so when you double click on the pdf file, Acrobat opens the file.

After that, you either need to access the COM application object, or simulate keystrokes. Do you really want to go that far?


My knowledge of programming com objects and keystroke tend to zero. I would have preferred a more simple solution, or existing code that uses these technologies.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
The only "easy" way I can see is to preset a landscape printer, and start the PDF with
    AcroRd32.exe /N /T PdfFile PrinterName
Some examples for commandline paramters, and some pointers to documentation, can be found at http://www.robvanderwoude.com/commandlineswitches.php#Acrobat.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.