Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi Everyone,

This question hopefully wont be as detailed as my other posts as my question is fairly simple.

I have list of Byte arrays, which are delivered by a report server. These arrays are PDFs. I want to be able to print these PDFs using an application that the user can start off and gives feedback of the progress.

What I can already do
  • Using the Process class start a PDF reader which loads a PDF file and doesn't display a window.

    What I can't do
    • Print the PDF document. After some research I have found out that to pass command line arguments to a program that needs to have an entry in the registry which then specifies the behaviour of the program given certain arguments.
      • Convert a Byte array into a PDF document. I suspect that this may be a great deal harder then first anticipated.


        Many thanks

        Laurence
Posted
Comments
Laurence1234 15-Jul-11 10:00am    
I realise the formatting is horrible. It was correct when I wrote it, then when I uploaded it it went like this. I can't seem to edit it back for some reason.

1 solution

"After some research I have found out that to pass command line arguments to a program that needs to have an entry in the registry which then specifies the behaviour of the program given certain arguments."

Since when?
ProcessStartInfo psi = new ProcessStartInfo("MyApp", "My Arguments list /p");
Process.Start(psi);
The program needs to be installed, yes. Otherwise Windows doesn't know where to find it.
 
Share this answer
 
Comments
Laurence1234 15-Jul-11 10:35am    
Yeah, I re-read the article I thought had suggested that. I had got the wrong end of the stick :p

I have tried your approach above, the program opened however it didn't didn't load the file...
OriginalGriff 15-Jul-11 11:01am    
Check the parameters list for the PDF reader - which one are you using?
Laurence1234 15-Jul-11 10:55am    
This is the article I had found :

http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.verbs.aspx

Alongside this one :

http://msdn.microsoft.com/en-us/library/aa969385.aspx

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