cancel
Showing results for 
Search instead for 
Did you mean: 

Printing from a PDF

john.hammond
Level 6
Good morning all,

We've run into an issue when printing a PDF. Currently, this is our approach:
23807.png
We then have a global wait (currently 15 seconds) for this process to run before killing Acrobat. However, we're not getting any confirmation that the print has actually completed in this timeframe, and files are as a result intermittently not appearing on the printer. 

Is there another approach that I'm unable to think of currently? We need to reliably know that Acrobat has opened and sent the file to the printer, and that the print controller has registered that an item is to be added to the print queue before terminating the process.

Open to any and all suggestions!

------------------------------
John Hammond
------------------------------
3 REPLIES 3

John__Carter
Staff
Staff
I've never used it, but it looks like .Net offers functionality in the System.Printing namespace, for example the GetPrintJobInfoCollection method. Maybe you could employ that in a code stage and create the looping 'has it worked?' check you describe?

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Hi John, thanks for getting back to me.

Would that be reliable on a network printer? I'm not knowledgeable myself on .NET myself. It looks like our print queue doesn't consistently contain the file name, which might put up another hurdle?

------------------------------
John Hammond
------------------------------

EVIPUTI
MVP
You can do something like this by extending the code stage:

Dim pdf = GetDocument(Handle, Document Name)
pdf.PrintOut(Background:=False)
pdf = Nothing



------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification Developer
Amazon
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------