Store the order receipt as a PDF file
Store the order receipt as a PDF file
def store_receipt_as_pdf(order_number):
Hints
- You need to import an RPA Framework library that handles PDF files.
- The function needs to take an argument (the order number - to be used in the file name to ensure a unique name) and return a result (the file system path to the PDF file).
- The Beginners' python course contains a chapter about this exact topic.
- You want to store the PDF files inside the
output
directory (you can use subdirectories such asreceipts
inside theoutput
dir if you like), since that location is supported by Control Room when it stores the process output artifacts. If you place stuff elsewhere, it will not end up in Control Room process output artifacts.
Take a screenshot of the robot
def screenshot_robot(order_number):
Hints
- This is similar to the last function you implemented (takes an argument, returns a result).
- You have a library you need already imported.
Embed the robot screenshot to the receipt PDF file
def embed_screenshot_to_receipt(screenshot, pdf_file):
Hints
- You have the library you need already imported.
- The function that adds your screenshot to the PDF also takes care of opening and closing the PDF document. How convenient!
- You want to append the screenshot to the end of the document, not replace it entirely.
Go to order another robot
If you got this far, this might be pretty straightforward! You just have to click a button! Congratulations, you have successfully completed the iteration of order process.