Question
Cognizant Technology Solutions
US
Last activity: 20 Mar 2019 18:28 EDT
Openspan, How to Print a document present in a file location using printDocument
I have a requirement to print a pdf document present in a file location.
What i have tried so far..
1. Set the default printer on the machine to the printer to which i want to print the doc.
2. In the automation, dragged a printDocument control from tool box,
3. Initialized the documentName property of the control with the absolute file path(including the filename)
4. Dragged the print method of printDocument control.
I am seeing a notification that the document is sent to the printer (on the bottom right side in the system tray)
5. When i physically check if the document is printed, it prints a blank document.
Did some research on C# script where they have advised to use a even handler for PrintPage event.
I am trying to understand how can i achieve my requirement using the ootb controls using prindDocument or anything else which is present, instead of a C# script