473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How to print a pdf file?

I want to automate the action of print a pdf file in a C# Application
How can I do this?
Thanks
Jul 21 '05 #1
4 1439
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.ExportForma tType.PortableDocFormat,
@"C:\MyPDF.pdf");
}

Try this link for additional help...

http://support.businessobjects.com/c...ormsviewer.pdf

Anthony
"ywchan" <yw****@hkem.com> wrote in message
news:eQ**************@TK2MSFTNGP11.phx.gbl...
I want to automate the action of print a pdf file in a C# Application
How can I do this?
Thanks

Jul 21 '05 #2
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
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

"Thomas Chan" <yw****@hkem.com> skrev i meddelandet
news:Ot**************@TK2MSFTNGP09.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4
Try invoking the action verb "print" against the PDF document using
ShellExecuteEx API, or something equivalent in .NET.

thanks!
-Yasutaka

"ywchan" <yw****@hkem.com> wrote in message
news:eQ**************@TK2MSFTNGP11.phx.gbl...
I want to automate the action of print a pdf file in a C# Application
How can I do this?
Thanks


Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Manfred Schwab | last post by:
Recording messages and print statements in a textfile during program execution. Is there a similar command to redirect errormessages or print statements into a standart asciifile during...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
7
by: Ron | last post by:
Hi All, Is it possible to have Access print a report, identical to one that would print to a printer, only print to a "standard" text file? I can't find it in help and when I try to just print...
3
by: Max58kl | last post by:
Trying to access data and print it to the screen using Perl Builders I/O Window -------------------------------------------------------------------------------- Hi I am using a program called...
3
by: itdaddy | last post by:
hey perl gurus! i am new to this forum cause i need help. I have done many scripts. but i want to use perl to do this: What I want to do is this. I have a QRP file that I can convert to a txt...
2
by: alivip | last post by:
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, #...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
5
by: prakashturkar | last post by:
Hi, I am Prakash.... I have tried to print an MS Word file using the basic print utilities provided in JAVA.But while asking for printing through my own code i am getting proble for example..."The...
2
by: dmorand | last post by:
When I try to print a 'print version' of my page it looks fine in IE 7, but when I print in IE 6 the margins are all screwed up. The page itself looks the same in both browsers, it's just when I...
11
by: JWest46088 | last post by:
I'm having difficulty trying to figure out how to print a text file from a hash table one line at a time. I have the text file read into the hash table and can print the text file all at once, but I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.