High resolution print using p5 vs. Processing

Casey Reas wrote a wonderful tutorial on printing [https://processing.org/tutorials/print/] that detailed instructions on how to export high-resolution files in Processing. I would like to do the same with my p5-generated sketches and wonder if p5 offers a similar path. Alternatively, should I convert my p5 file to Processing and follow his approach? Thanks!

Check out https://github.com/zenozeng/p5.js-pdf.

Thank you Moritz Salla!