The Canvas class natively supports saving its contents using the PostScript language via its postscript() method. This stores the graphical representation of canvas items, such as lines, rectangles, polygons, ovals, and arcs, however, it does not do so for embedded widgets and images.
We will modify a previous recipe that dynamically generates this type of simple items to add the functionality to save a representation of the canvas into a PostScript file.