Click here to Skip to main content
15,887,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
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.
C#
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;
               proc.Start();


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.
Posted
Comments
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.
[no name] 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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900