Cover size (and spine width) varies with number of pages.
Write new code, or revise old code, to draw things randomly in panel boxes. (PostScript code is good for making printed art.)
Set page sizes (wide, high) to trim size + bleed size. Set page margin sizes.
Set number of pages to make.
For each page, have code:
Repeat above steps for the cover art, adding title and other text elements.
Set Acrobat Distiller settings to match size of book’s interior pages.
Run PostScript code through Distiller, to make the PDF file for interior.
Repeat, using cover size, to make PDF file with several possible covers.
Select best cover, extract page, and save as a one-page PDF.
At POD printer’s website, start new book project.
Set: title, number of pages, size, binding.
Upload files for interior and cover.
Order a copy. (Wait 1-2 weeks for printing and shipping.)