Store the order receipt as a PDF file
- 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
outputdirectory (you can use subdirectories such as
outputdir 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.
- This is similar to the last function you implemented (takes an argument, returns a result).
- You have a library you need already imported.
def embed_screenshot_to_receipt(screenshot, pdf_file):
- 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.
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.