I'm writing an PowerShell application which aim to display a PDF file. PDF can be display in some control e.g. WebBrowser. The PDF file will be located on the disk, not in the Internet.
I was trying to do it with WebBrowser Control and Itext Library, but it didn't work.
Tiny part of my code:
$WebBrowser.Navigate("C:\...\My_file.pdf")
$WebBrowser.Url = "C:\...\My_file.pdf"
Do you have any tips for me how to proceed in this case?
If you just want to open a pdf, I would recommend you to use the Start-Process
cmdlet to open the PDF using the local standard PDF reader:
Start-Process ((Resolve-Path "C:\..\My_file.pdf").Path)
If you are just trying to open a pdf file. you could do something like:
& <path to program> <path to file>
ex:
& "C:\Program Files\Internet Explorer\iexplore.exe" "C:\Users\user\Desktop\diskspaceauth-2017-05-08.pdf"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With