1

I'm printing a pdf file with:

Start-Process -FilePath "C:\file.pdf" –Verb Print 

This opens an empty adobe reader window, prints the file, but keeps the adobe reader open. So, how do I close adobe reader?

Thank you in advance.

1 Answer 1

6

From here seems like that is how AcroRd32 will work - it will keep the Adobe Reader open and you can only control whether it is minimized when it starts or not.

One alternative is to use Foxit Reader as described here- http://www.deltasblog.co.uk/code-snippets/printing-pdf-files-from-command-line-without-adobe-reader/

Or,Hack:

Start-Process -FilePath "test.pdf" –Verb Print
sleep 10
kill -name AcroRd32

Updated hack for multiple Adobe readers open:

Start-Process -FilePath "test.pdf" –Verb Print -PassThru | %{sleep 10;$_} | kill
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for the help manojlds. I thought of doing that, but if I have another pdf file open couldn't it kill it too? I could use foxit reader as a standalone executable so I would be almost sure nobody else would use it.
@Arthur Carvalho - Updated the hack so that already open file won't close. Still a hack :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.