Click here to Skip to main content
14,458,486 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm trying to print single page from PDF file using adobe reader.but below code is printing whole file. any one please suggest me to print single page.
Process proc = new Process();
               proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
               proc.StartInfo.Verb = "print"; 
               proc.StartInfo.FileName =@"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe";
               proc.StartInfo.Arguments = String.Format("/h /p \"Page={0}\" \"{1}\"",page, pdfFileName);            
               proc.StartInfo.UseShellExecute = false;
               proc.StartInfo.CreateNoWindow = true;

below details for adobe reader argument option
* /n - Launch a new instance of Reader ever if one is already open
* /s - Don't show the splash screen
* /o - Don't show the open file dialog
* /h - Open as a minimized window
* /p - Open and go straight to the print dialog
* /t - Print the file the specified printer.

Pandiyan T

What I have tried:

i have tried to print single page in PDF file. but it's printing whole PDF file. they provide option for open particular file but not for print option.
David_Wimbley 25-Aug-16 9:24am
Are you able to use a 3rd party library like pdfsharp or itextsharp? Reason i ask is you could pull the desired page out into its own PDF and print the single page in that manner. If you are i'd be happy to help with that.
PandIyan T 26-Aug-16 0:43am
Yes i have used Spire PDF library for get number of pages in particular PDF file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100