PC Review


Reply
Thread Tools Rate Thread

Problem Printing PDF silently from a Windows Directory watch application

 
 
Confused But Happy
Guest
Posts: n/a
 
      9th Aug 2012
Hi All

Using Adobe 9 version 9.3.0, Visual studio 2008/C#

I have a wee problem.

Due to the restrictions of printing from (a .net browser application) the browser I have created a Windows Watch Application to watch a directory (running it locally at the moment but it will run on the IIS web server).

When a PDF document arrives in the watch folder (created by the .net web app using iTextSharp) the watch application will pick up the PDF document andsend it to the chosen printer using the printer value (that will only change if there is a problem with the printer) selected from a Combobox in the watch application

The problems I am having are

1. The Print Dialogue in Adobe Acrobat always picks up my Default Printer.
2. The print actually does not appear to be going anywhere (not even my default printer).

What is actually happening is as follows

1. The watch application detects the new pdf file
2. The Print Dialogue appears with my default printer selected and the correct document previewed.
3. The Print Dialogue disappears (with no intervention from me) and there is no resulting print ??????
4. If I pause the application just before the Kill command I can hit the OKbutton on the print dialogue and it prints to the Default printer (I get 2copies for some reason).


The values of the vars are as follows
fullFileName = "C:\\Inetpub\\wwwroot\\ZebraBackup\\ZebraBackup\\MyPDFOutputs\\S134463.pdf"

selectedPrinter = "\\\\dun-server6\\Finance Canon"

strArguments = "/t
\" C:\\Inetpub\\wwwroot\\ZebraBackup\\ZebraBackup\\MyPDFOutputs\\S134463.pdf\" \" \\\\dun-server6\\Finance Canon\" "

The Print Dialogue appears with my default printer selected

\\Dun-Server6\HR Printer 3015

"\\\\dun-server6\\Finance Canon\" this is the selected printer from the combobox



Can anyone please assist and tell me where I am going wrong as I feel I am going nuts.

Please see my code below

Many thanks in advance for any assistance offered

Regards

Iain (confused but happy)


ProcessStartInfo startInfo = new ProcessStartInfo("AcroRd32.exe");
string strArguments = "/t \"" + fullFileName + "\" \"" +
selectedPrinter + "\"";

Process proc = new Process();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = fullFileName;
startInfo.Verb = "print";
startInfo.CreateNoWindow = false;
startInfo.ErrorDialog = true;
startInfo.Arguments = strArguments;
startInfo.UseShellExecute = true;
proc.StartInfo = startInfo;
proc.Start();

proc.WaitForExit(5000);
if (proc.HasExited == false)
{
proc.Kill();
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Printing PDF silently from a Windows Directory watch application Confused But Happy Microsoft C# .NET 1 13th Aug 2012 06:09 PM
Deployment of NET 2.0 application - installing silently Toma Catalin Microsoft Dot NET Framework 4 11th Jul 2008 01:39 PM
SyncToy failing silently because of long path name (& relatedWindowsFormsParkingWindow shutdown problem) prepbgg@googlemail.com Windows XP General 0 27th Jun 2008 12:33 PM
Application unexpectedly quits silently vachesacree@yahoo.com Microsoft Dot NET Compact Framework 7 22nd Mar 2006 03:23 PM
VBA code silently crashing. Problem with Data Validation drop down lists. Don Wiss Microsoft Excel Programming 6 27th Feb 2005 10:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:09 AM.