Hi All
How can i print a pdf without previewing it.
Thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hirendra SisodiyaPosted May 3, 2011, 3:35 AM
i think posted date should not be an issue...
thanks
Soft CornerPosted May 3, 2011, 3:05 AM
this thread is old , Posted on: 16 Mar 2011
Thanks
krishna kumar dubeyPosted May 3, 2011, 3:00 AM
NiveditaPosted Mar 18, 2011, 1:24 AM
Thanks for the reply, I searched and found out the same. But this time I was able to print document while it was on my D drive,when I tried printing the document after including it in the solution, it threw an exception saying "file could not be found. and so can not be opened". The document is stored in a folder named "Document" and the code is
Here I am reading the file path
string path = "/Document/filename.PDF";
System.Diagnostics.ProcessStartInfo startInfo = new
System.Diagnostics.ProcessStartInfo();
startInfo.Arguments = " /t \"" + path + "\" \"" + printerName + "\"";
startInfo.FileName = @"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\\acrord32.exe";
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = true;
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
System.Diagnostics.Process process = System.Diagnostics.Process.Start(startInfo);
process.WaitForExit(30000);
if (process.HasExited == false)
{
process.Kill();
}
Thanks in advance
Mahesh ChandPosted Mar 17, 2011, 12:52 PM
http://www.dynamicpdf.com/Dot_NET_Dynamic_PDF_Components_Libraries_PrintManager.csp
Mahesh ChandPosted Mar 17, 2011, 12:51 PM
There is no direct way to print a PDF from C#. You can either launch the Adobe and then use its print feature.
BUT if you MUST print without launching the Adobe reader, I suggest you look into a third-party library such as DynamicPDF or ExpertPDF. These APIs allow you to read, print, edit etc in PDF documents.
Suthish NairPosted Mar 17, 2011, 12:42 PM
NiveditaPosted Mar 17, 2011, 2:01 AM
The pdf document to be printed is stored in the application directory only ...and I need to print it programmatically.
Thanks
Mahesh ChandPosted Mar 16, 2011, 11:51 AM
NiveditaPosted Mar 16, 2011, 10:01 AM
Suthish NairPosted Mar 16, 2011, 9:59 AM