def create_watermark(wm_text: str): """ Creates a watermark template. """ if wm_text: # Generate the output to a memory buffer output_buffer = BytesIO() # Default Page Size = A4 c = canvas.Canvas(output_buffer, pagesize=PAGESIZE) # you can also add image instead of text # c....
To begin with, in the HTML file there is a form that contains the “Excel Report” button. Therefore, in the corresponding Django view we receive the request to download ‘excel’. Thus, we have to send the file to the user and we can do this through the following code. The result i...