Skip navigation
MaxPr
Currently Being Moderated

How to Print a PDF programmatically without the Adobe Reader Window

Jul 30, 2012 7:51 AM

Tags: #print

Hi,

 

I'm trying to print a PDF my application. I would prefer to do it as silent as possible - no PrintDialogue | Adobe Reader Window.

 

  • Language C#
  • Adobe Reader 10.0

 

Here´s some Code:

 

    public static void PrintPDF(string file, string printerName)
    {
        Process proc = new Process();
        proc.StartInfo.FileName = @"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe";
        proc.StartInfo.Arguments = @" /t /h " + "\"" + file + "\"" + " " + "\"" + printerName + "\"";
        proc.StartInfo.UseShellExecute = true;
        proc.StartInfo.CreateNoWindow = true;
        proc.Start();
        Thread.Sleep(1000);
        proc.WaitForInputIdle();
       

proc.Kill();

    }

 

It works, but the Adobe Reader Window is still popping up -> /h (start the reader minimized) does not work.

 

Is there another way to hide the Window ?

 

Regards

 
Replies
  • Currently Being Moderated
    Jul 30, 2012 12:22 PM   in reply to MaxPr

    Moved to Acrobat SDK

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 12:39 PM   in reply to MaxPr

    Correct - this is so that users don't have stuff printing out of their printers w/o their knowledge.

     

    Using standard Windows techniques for hiding windows or opening apps minimized, if you must.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 31, 2012 5:18 AM   in reply to MaxPr

    Hi,

     

    you mixed up the commandline options, so:

    AcroRd32.exe /h /t "......."

    should work (at least until v9..)

     

    HTH, Reinhard

     

    PS: simple test under START->EXECUTE: AcroRd32.exe /h /p "c:\Test.pdf"

    where /p stands for print to standardprinter

    
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 4:54 AM   in reply to MaxPr

    Because silent printing is a security risk – and unlike our competitors we CARE about security!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points