i've got an PDF file and want to open it on clients desktop (so i don't know the directory of his default PDF reader)...
...
File.WriteAllBytes(pdfByteArray, path);
File.Open(path, FileMode.Open);
...
seems not to work here...
Right-click the PDF, choose Open With > Choose default program or another app in. 2. Choose Adobe Acrobat Reader DC or Adobe Acrobat DC in the list of programs, and then do one of the following: (Windows 10) Select Always use this app to open .
Right-click on the thumbnail of any PDF file. On the menu, click Get Info. Navigate to the Open With: section and select Adobe Acrobat DC or Reader from the drop-down list. Tap Change All to apply this change to all future PDF documents.
You can set aLL PDF's to open in 100% view by going to Edit>Preferences>Page Display>Default layout and zoom. If the creator has set a file to open at a different size, those settings will be ignored.
Open Acrobat Reader and select Edit > Preferences. Click Internet in the left panel of the Preferences menu and then select Internet Settings. Select the Programs tab. Click Manage Add-Ons and choose Acrobat Reader in the list of add-ons.
Try opening it like this:
File.WriteAllBytes(pdfByteArray, path);
Process.Start(path);
If path
ends with some extension (like .PDF) that has an associated program with it will be opened with this program.
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