nesher13
asked on
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\$($_.Inv oices).pdf "
$result | Where {!$_.Values} | Foreach {Start-Process -FilePath "s:\INVOICES\0070\$($_.Inv
ASKER
Qlemo
Sorry, mistake, the code:
$result | Where {!$_.Values} | Foreach {Start-Process -FilePath "s:\INVOICES\0070\$($_.Inv oices).pdf " –Verb Print}
Sorry, mistake, the code:
$result | Where {!$_.Values} | Foreach {Start-Process -FilePath "s:\INVOICES\0070\$($_.Inv
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.
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.
ASKER
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 ?
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 ?
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?
After that, you either need to access the COM application object, or simulate keystrokes. Do you really want to go that far?
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start-Process itself has a -WindowStyle paramter you can feed with one of Normal, Hidden, Minimzed, Maximized, and that is always worth a try.