0

I need from my C# application open a PDF file by using Foxit Reader or Adobe Reader in full screen mode. Manually, I do it typing F11 in Foxit Reader and CTRL+L on Adobe Reader. This changes the current file view to "full screen" mode. But programmatically, I have no idea how to do this! Thanks in advance.

as I'm opening the pdf file:

Process.Start(filename);
Jack
  • 16,276
  • 55
  • 159
  • 284
  • wow.. why -1? can someone explain please? it's a C# programming question. – Jack Jun 05 '12 at 03:25
  • Not my downvote, but it would help to see how you're calling those two PDF readers currently. – Michael Petrotta Jun 05 '12 at 03:36
  • If you are just passing the name of the PDF file to `Process.Start`, how do you know it will be opened by Foxit or Adobe? – Blorgbeard Jun 05 '12 at 03:46
  • @Blorgbeard: because on the PCs where the application will run can have only Adobe or Foxit on MS-windows operating system. It's just for some users of my class... – Jack Jun 05 '12 at 03:53

2 Answers2

3

You can use SendKeys to send F11 or CTRL+L to the PDF application after you run it.

Alternatively, Foxit or Adobe may support commandline parameters to open in fullscreen mode. If you don't mind changing to SumatraPDF, I do know you can pass -presentation $file.pdf - opens a PDF file in presentation (full-screen) mode. See the manual for details.

Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
  • Thanks. I'II try `SendKeys` and look at Foxit/Adobe command line supports.SumatraPDF, actually, I can't. Because the PCs that the application will run, can have Foxit/Adobe(is all I know) and I can't change it. – Jack Jun 05 '12 at 03:48
3

Also, in addition to using the other solutions, you could open a Windows Form (or WPF Window) with a WebBrowser control and point it at the PDF file. The PDF file will open in the web browser control. Just set the Windows Form Properties to be Maximized with no border, and that should be the key to getting what you want without messing with Process.

John Davis
  • 736
  • 6
  • 14