Y ywchan Jan 13, 2004 #1 I want to automate the action of print a pdf file in a C# Application How can I do this? Thanks
A Anthony Fine Jan 14, 2004 #2 ywchan, Add a Crystal Report to your project, set all of the properties as needed so your report looks the way you want it. Then, add the following code: private void Form1_Load(object sender, System.EventArgs e) { CrystalDecisions.CrystalReports.Engine.ReportClass x = new CrystalReport1(); x.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"C:\MyPDF.pdf"); } Try this link for additional help... http://support.businessobjects.com/communityCS/TechnicalPapers/rtm_designerandwinformsviewer.pdf Anthony
ywchan, Add a Crystal Report to your project, set all of the properties as needed so your report looks the way you want it. Then, add the following code: private void Form1_Load(object sender, System.EventArgs e) { CrystalDecisions.CrystalReports.Engine.ReportClass x = new CrystalReport1(); x.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"C:\MyPDF.pdf"); } Try this link for additional help... http://support.businessobjects.com/communityCS/TechnicalPapers/rtm_designerandwinformsviewer.pdf Anthony
T Thomas Chan Jan 14, 2004 #3 Oh... I think you have misunderstood what I mean. Actually, I only need to automate the process of printing a pdf file and it is not generated from crystal report. They are just some simple pdf documents. Thanks
Oh... I think you have misunderstood what I mean. Actually, I only need to automate the process of printing a pdf file and it is not generated from crystal report. They are just some simple pdf documents. Thanks
H Henke Jan 14, 2004 #4 If you have Acrobat Reader installed you can do something like this System.Diagnostics.ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.Arguments = @"/p /h c:\yourfile.pdf"; startInfo.FileName = @"C:\Program\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"; startInfo.UseShellExecute = true; System.Diagnostics.Process process = Process.Start(startInfo); process.WaitForExit(); /Henke
If you have Acrobat Reader installed you can do something like this System.Diagnostics.ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.Arguments = @"/p /h c:\yourfile.pdf"; startInfo.FileName = @"C:\Program\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"; startInfo.UseShellExecute = true; System.Diagnostics.Process process = Process.Start(startInfo); process.WaitForExit(); /Henke
Y Yasutaka Ito Jan 22, 2004 #5 Try invoking the action verb "print" against the PDF document using ShellExecuteEx API, or something equivalent in .NET. thanks! -Yasutaka
Try invoking the action verb "print" against the PDF document using ShellExecuteEx API, or something equivalent in .NET. thanks! -Yasutaka