Click here to Skip to main content
11,490,973 members (74,444 online)
Rate this: bad
good
Please Sign up or sign in to 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 15-Jul-11 4:56am
Comments
Laurence1234 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

"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.
  Permalink  
Comments
Laurence1234 at 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 at 15-Jul-11 11:01am
   
Check the parameters list for the PDF reader - which one are you using?
Laurence1234 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 521
1 Andy Lanng 288
2 Maciej Los 240
3 Sascha Lefèvre 240
4 OriginalGriff 153
0 Sergey Alexandrovich Kryukov 9,829
1 OriginalGriff 8,520
2 Sascha Lefèvre 3,574
3 Maciej Los 3,151
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 15 Jul 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100